/**
 * AS Review Form — frontend styles.
 * Dark Modern Portfolio theme. No external framework.
 */

.asrf {
	--asrf-bg: #0F172A;
	--asrf-card: #162235;
	--asrf-primary: #1EA7FF;
	--asrf-primary-dark: #1690dd;
	--asrf-focus: #3b82f6;             /* blue-500 */
	--asrf-btn-from: #2563eb;          /* blue-600 */
	--asrf-btn-to: #0891b2;            /* cyan-600 */
	--asrf-btn-from-hover: #1d4ed8;    /* blue-700 */
	--asrf-btn-to-hover: #0e7490;      /* cyan-700 */
	--asrf-border: #374151;            /* gray-700 (card) */
	--asrf-input-border: #4b5563;      /* gray-600 */
	--asrf-border-hover: rgba(30, 167, 255, 0.5);
	--asrf-text: #FFFFFF;
	--asrf-label: #d1d5db;             /* gray-300 */
	--asrf-muted: #6b7280;             /* gray-500 */
	--asrf-star: #4b5563;              /* gray-600 */
	--asrf-secondary: #A8B3C5;
	--asrf-gold: #facc15;              /* yellow-400 */
	--asrf-error: #ff5c72;
	--asrf-success: #33d69f;
	--asrf-radius: 12px;
	--asrf-input-h: 56px;

	box-sizing: border-box;
	max-width: 700px;
	margin: 0 auto;
	color: var(--asrf-text);
	font-family: inherit;
	line-height: 1.5;
}

.asrf *,
.asrf *::before,
.asrf *::after {
	box-sizing: border-box;
}

/* ---------- Card ---------- */
.asrf-form {
	background-image: linear-gradient(to bottom right, #1f2937cc, #111827cc);
	backdrop-filter: blur(4px);
	border: 1px solid var(--asrf-border);
	border-radius: 24px;
	padding: 40px;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

@media (max-width: 560px) {
	.asrf-form {
		padding: 32px 24px;
	}
}

.asrf-title {
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 700;
	color: var(--asrf-text);
	letter-spacing: -0.02em;
}

.asrf-subtitle {
	margin: 0 0 15px;
	font-size: 15px;
	color: var(--asrf-muted);
}

/* ---------- Layout ---------- */
.asrf-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
	margin-bottom: 15px;
}

@media (max-width: 560px) {
	.asrf-grid {
		grid-template-columns: 1fr;
	}
}

.asrf-field {
	margin-bottom: 15px;
}

.asrf-grid .asrf-field {
	margin-bottom: 0;
}

.asrf-label {
	display: flex;
	align-items: center;
	margin-bottom: 8px;
	font-size: 14px;
	font-weight: 600;
	color: var(--asrf-label);
}

/* Labels that use mb-3 in the reference. */
.asrf-photo-field > .asrf-label,
#asrf-stars-label {
	margin-bottom: 12px;
}

.asrf-required {
	color: var(--asrf-primary);
	margin-left: 4px;
}

/* ---------- Label icons ---------- */
.asrf-label-icon {
	width: 13px;
	height: 13px;
	flex: 0 0 auto;
	margin-right: 6px;
}

.asrf-icon--name {
	color: #60a5fa;   /* blue-400 */
}

.asrf-icon--position {
	color: #22d3ee;   /* cyan-400 */
}

.asrf-icon--rating {
	color: #facc15;   /* yellow-400 */
}

.asrf-icon--review {
	color: #c084fc;   /* purple-400 */
}

/* ---------- Inputs ---------- */
.asrf-input {
	width: 100%;
	padding: 13px 16px;
	background: rgba(17, 24, 39, 0.5);   /* gray-900/50 */
	border: 1px solid var(--asrf-input-border);
	border-radius: var(--asrf-radius);
	color: var(--asrf-text);
	font-size: 15px;
	font-family: inherit;
	line-height: 1.5;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
	outline: none;
}

.asrf-textarea {
	min-height: 140px;
	resize: none;
}

.asrf-input::placeholder {
	color: var(--asrf-muted);
}

.asrf-input:hover {
	border-color: var(--asrf-border-hover);
}

.asrf-input:focus {
	border-color: var(--asrf-focus);
	background: rgba(17, 24, 39, 0.8);
	box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.6);
}

.asrf-input.asrf-input--invalid {
	border-color: var(--asrf-error);
	box-shadow: 0 0 0 2px rgba(255, 92, 114, 0.4);
}

/* ---------- Star rating ---------- */
.asrf-stars {
	display: inline-flex;
	gap: 8px;
	padding: 2px 0;
}

.asrf-star {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 2px;
	background: none;
	border: none;
	cursor: pointer;
	color: var(--asrf-star);
	transition: color 0.2s ease, transform 0.15s ease;
	outline: none;
}

.asrf-star-icon {
	width: 38px;
	height: 38px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: fill 0.2s ease, stroke 0.2s ease;
}

.asrf-star:hover {
	transform: scale(1.12);
}

.asrf-star:focus-visible {
	border-radius: 8px;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

/* Active (selected or hover-highlighted) stars fill gold. */
.asrf-star.is-active {
	color: var(--asrf-gold);
}

.asrf-star.is-active .asrf-star-icon {
	fill: currentColor;
}

.asrf-stars-hint {
	display: block;
	margin-top: 8px;
	font-size: 12px;
	color: var(--asrf-muted);
}

/* ---------- Field footer / character counter ---------- */
.asrf-field-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: 6px;
}

.asrf-field-footer .asrf-error {
	margin-top: 0;
}

.asrf-counter {
	margin-left: auto;
	font-size: 12px;
	color: var(--asrf-muted);
	white-space: nowrap;
}

/* ---------- Profile photo (avatar + button) ---------- */
.asrf-file-input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

.asrf-photo-row {
	display: flex;
	align-items: center;
	gap: 20px;
}

.asrf-avatar {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 80px;
	height: 80px;
	flex: 0 0 auto;
	border-radius: 50%;
	background: rgba(31, 41, 55, 0.5);   /* gray-800/50 */
	border: 2px dashed var(--asrf-input-border);
	cursor: pointer;
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
	outline: none;
}

.asrf-avatar:hover,
.asrf-avatar:focus-visible,
.asrf-avatar.is-dragover {
	border-color: var(--asrf-primary);
	background: rgba(30, 167, 255, 0.06);
	box-shadow: 0 0 22px rgba(30, 167, 255, 0.22);
}

.asrf-avatar-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.asrf-avatar-placeholder svg {
	width: 30px;
	height: 30px;
	color: var(--asrf-muted);
}

.asrf-avatar-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}

.asrf-photo-actions {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
}

.asrf-upload-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 16px;
	background: rgba(55, 65, 81, 0.6);   /* gray-700/60 */
	border: 1px solid var(--asrf-input-border);
	border-radius: 8px;
	color: var(--asrf-label);
	font-size: 14px;
	font-weight: 500;
	font-family: inherit;
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.asrf-upload-btn svg {
	width: 15px;
	height: 15px;
}

.asrf-upload-btn:hover {
	color: var(--asrf-text);
	border-color: var(--asrf-muted);
	background: #374151;   /* gray-700 */
}

.asrf-remove-btn {
	padding: 0;
	background: none;
	border: none;
	color: var(--asrf-muted);
	font-size: 13px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: color 0.2s ease;
}

.asrf-remove-btn:hover {
	color: var(--asrf-text);
	text-decoration: underline;
}

.asrf-photo-hint {
	font-size: 12px;
	color: var(--asrf-muted);
}

@media (max-width: 420px) {
	.asrf-photo-row {
		gap: 14px;
	}
}

/* ---------- Errors & alerts ---------- */
.asrf-error {
	display: block;
	min-height: 16px;
	margin-top: 6px;
	font-size: 13px;
	color: var(--asrf-error);
}

.asrf-alert {
	margin-bottom: 22px;
	padding: 14px 18px;
	border-radius: var(--asrf-radius);
	font-size: 14px;
	font-weight: 500;
}

.asrf-alert--success {
	background: rgba(51, 214, 159, 0.12);
	border: 1px solid rgba(51, 214, 159, 0.4);
	color: var(--asrf-success);
}

.asrf-alert--error {
	background: rgba(255, 92, 114, 0.12);
	border: 1px solid rgba(255, 92, 114, 0.4);
	color: var(--asrf-error);
}

/* ---------- Submit button ---------- */
.asrf-submit {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	padding: 16px 32px;
	margin-top: 4px;
	background-image: linear-gradient(to right, var(--asrf-btn-from), var(--asrf-btn-to));
	border: none;
	border-radius: var(--asrf-radius);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.2s ease, background-image 0.3s ease;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.asrf-submit-content {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.asrf-submit-icon {
	width: 20px;
	height: 20px;
}

.asrf-submit:hover {
	background-image: linear-gradient(to right, var(--asrf-btn-from-hover), var(--asrf-btn-to-hover));
	transform: translateY(-4px);
	box-shadow: 0 20px 40px rgba(59, 130, 246, 0.3);
}

.asrf-submit:active {
	transform: translateY(0);
}

.asrf-submit:focus-visible {
	outline: none;
	box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.4);
}

.asrf-submit.is-loading {
	pointer-events: none;
	opacity: 0.5;
	transform: none;
}

.asrf-submit.is-loading .asrf-submit-text {
	opacity: 0.75;
}

/* ---------- Spinner ---------- */
.asrf-spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: asrf-spin 0.7s linear infinite;
}

.asrf-submit.is-loading .asrf-spinner {
	display: inline-block;
}

@keyframes asrf-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.asrf-star,
	.asrf-input,
	.asrf-submit,
	.asrf-avatar,
	.asrf-upload-btn {
		transition: none;
	}
	.asrf-star:hover,
	.asrf-submit:hover {
		transform: none;
	}
	.asrf-spinner {
		animation-duration: 1.4s;
	}
}
