/* ==========================================================================
   SeedsVision — auth pages (login, register, profile setup, password)
   ========================================================================== */

/* Layout */

.auth-page {
	padding: 56px var(--container-pad);
	display: flex;
	justify-content: center;
}

.auth-card {
	width: 100%;
	max-width: 480px;
}

.auth-card--narrow { max-width: 380px; }
.auth-card--wide   { max-width: 560px; }

.auth-card__eyebrow {
	font-size: 14px;
	color: var(--color-fg-muted);
	margin: 0 0 10px;
}

.auth-card__title {
	font-size: 30px;
	font-weight: 700;
	margin: 0 0 10px;
	line-height: 1.15;
	letter-spacing: -0.01em;
}

.auth-card__subtitle {
	font-size: 14px;
	color: var(--color-fg-muted);
	margin: 0 0 8px;
	line-height: 1.5;
}

.auth-card__required-note {
	font-size: 13px;
	color: var(--color-fg-muted);
	margin: 0 0 28px;
}

.auth-card__subtitle + .auth-card__required-note {
	margin-top: 4px;
}

/* Inline notices (?error= / ?reset=success / ?confirmed=1) */

.auth-notice {
	font-size: 14px;
	line-height: 1.5;
	padding: 12px 14px;
	border-radius: 4px;
	margin: 0 0 18px;
}

.auth-notice--error {
	background: #fbe9e7;
	color: #b2271b;
	border: 1px solid #f1c6c1;
}

.auth-notice--info {
	background: #eef3fb;
	color: #1f3a6e;
	border: 1px solid #cfdef4;
}

.auth-notice--center {
	text-align: center;
}

/* Stacks the "email resent" notice above the confirmation panel, centered. */
.auth-confirm-stack {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	max-width: 460px;
}

.auth-confirm-stack .auth-notice {
	width: 100%;
}

/* Form */

.auth-form {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.field__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
}

.field__label {
	font-size: 14px;
	color: var(--color-fg);
	font-weight: 400;
}

.field__label .required {
	color: var(--color-fg);
}

.field__hint {
	font-size: 12px;
	color: var(--color-fg-muted);
	margin: 6px 0 0;
	line-height: 1.5;
}

.field__error {
	font-size: 12px;
	color: #b2271b;
	margin: 6px 0 0;
	line-height: 1.4;
}

.input--error,
.select--error {
	border-color: #b2271b;
	background: #fdecec;
}

.input--error:focus,
.select--error:focus {
	border-color: #b2271b;
	background: #fff;
}

.field--error .field__label {
	color: #b2271b;
}

.checkbox-stack--error {
	padding: 12px;
	border: 1px solid #f1c6c1;
	background: #fbe9e7;
	border-radius: 4px;
}

/* Inputs */

.input,
.select,
.textarea {
	width: 100%;
	padding: 14px 16px;
	background: #fff;
	border: 1px solid #d4d4d4;
	border-radius: 4px;
	font-size: 15px;
	color: var(--color-fg);
	font-family: inherit;
	line-height: 1.4;
	transition: border-color var(--transition), box-shadow var(--transition);
}

.input::placeholder,
.textarea::placeholder {
	color: #8a8a8a;
}

.input:focus,
.select:focus,
.textarea:focus {
	outline: none;
	border-color: var(--color-yellow);
	box-shadow: 0 0 0 1px var(--color-yellow);
	background: #fff;
}

/* Errored fields keep the red treatment, even while focused. */
.input--error:focus,
.select--error:focus {
	border-color: #b2271b;
	box-shadow: 0 0 0 1px #b2271b;
	background: #fff;
}

/* Legacy modifier — inputs are bordered by default now. */
.input--bordered {
	background: #fff;
}

.input-wrap {
	position: relative;
}

.input-wrap .input {
	padding-right: 48px;
}

.input-wrap__toggle {
	position: absolute;
	right: 6px;
	top: 50%;
	transform: translateY(-50%);
	background: transparent;
	border: 0;
	padding: 8px;
	color: var(--color-fg-muted);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: color var(--transition), background var(--transition);
}

.input-wrap__toggle:hover {
	color: var(--color-fg);
	background: rgba(0, 0, 0, 0.04);
}

.input-wrap__toggle[aria-pressed="true"] .icon-eye-on { display: none; }
.input-wrap__toggle[aria-pressed="false"] .icon-eye-off { display: none; }

/* Suppress the browser-native password reveal control (Edge honours ::-ms-reveal)
   so only our custom eye toggle is shown — otherwise two eye icons appear. */
.input-wrap input::-ms-reveal,
.input-wrap input::-ms-clear {
	display: none;
}

/* Select */

.select {
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%23111111' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
	background-repeat: no-repeat;
	background-position: right 16px center;
	background-size: 12px 8px;
	padding-right: 44px;
	cursor: pointer;
}

/* File upload (PDF/DOCX/JPG attachment) */

.file-upload {
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 14px 16px;
	background: #efefef;
	border-radius: 4px;
	flex-wrap: wrap;
}

.file-upload__input {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.file-upload__button {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid #c8c8c8;
	color: var(--color-fg);
	padding: 10px 22px;
	font-size: 14px;
	font-weight: 400;
	border-radius: 4px;
	cursor: pointer;
	line-height: 1.2;
	transition: background var(--transition), border-color var(--transition);
}

.file-upload__button:hover {
	background: #f4f4f4;
	border-color: #a8a8a8;
}

.file-upload__input:focus-visible + .file-upload__button {
	outline: 2px solid var(--color-fg);
	outline-offset: 2px;
}

.file-upload__info {
	font-size: 13px;
	color: var(--color-fg-muted);
	line-height: 1.5;
	flex: 1;
	min-width: 220px;
}

.file-upload__filename {
	flex-basis: 100%;
	font-size: 13px;
	color: var(--color-fg);
	margin-top: 4px;
	word-break: break-all;
}

/* Checkbox & radio */

.checkbox,
.radio {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	font-size: 14px;
	line-height: 1.5;
	cursor: pointer;
	color: var(--color-fg);
}

.checkbox input[type="checkbox"],
.radio input[type="radio"] {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	margin: 2px 0 0;
	accent-color: #000;
	cursor: pointer;
}

.checkbox a,
.radio a {
	text-decoration: underline;
	color: inherit;
}

.checkbox-stack {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-top: 6px;
}

.radio-group {
	display: flex;
	flex-wrap: wrap;
	gap: 28px 48px;
	margin-top: 4px;
}

/* Buttons */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 24px;
	font-size: 15px;
	font-weight: 400;
	font-family: inherit;
	border-radius: 4px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background var(--transition), color var(--transition), border-color var(--transition);
	text-decoration: none;
	line-height: 1.2;
}

.btn:hover { text-decoration: none; }

.btn--block { width: 100%; }

.btn--primary {
	background: #000;
	color: #fff;
	border-color: #000;
}
.btn--primary:hover { background: #222; border-color: #222; }
.btn--primary:disabled { background: #888; border-color: #888; cursor: not-allowed; }

.btn--outline {
	background: #fff;
	color: #000;
	border-color: #000;
}
.btn--outline:hover { background: #f4f4f4; }

.btn--text {
	background: transparent;
	border: 0;
	padding: 8px 4px;
	color: var(--color-fg);
	text-decoration: underline;
}

.btn--muted {
	background: #f2f2f2;
	color: var(--color-fg);
	border-color: #f2f2f2;
}
.btn--muted:hover { background: #e6e6e6; border-color: #e6e6e6; }

.btn-stack {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 8px;
}

/* Two buttons side by side (e.g. Назад / Надіслати) */
.btn-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-top: 8px;
}

.btn-row .btn { width: 100%; }

.auth-form__submit { margin-top: 10px; }

/* Auxiliary rows under the form */

.auth-meta {
	margin-top: 18px;
	font-size: 14px;
	color: var(--color-fg);
}

.auth-meta a {
	text-decoration: underline;
}

.auth-row-between {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.auth-row-between a {
	font-size: 14px;
	text-decoration: underline;
}

/* Email-confirm specific */

.auth-resend {
	font-size: 14px;
	color: var(--color-fg);
	margin: 22px 0 18px;
}

.auth-resend__timer { font-variant-numeric: tabular-nums; }

/* When the cooldown ends the JS adds .is-ready — hide the "через 00:xx" part so
   only the active "Надіслати повторно" link remains (no stray "через"). */
.auth-resend.is-ready .auth-resend__countdown { display: none; }

.auth-resend__link {
	background: transparent;
	border: 0;
	padding: 0;
	color: var(--color-fg);
	text-decoration: underline;
	cursor: pointer;
	font: inherit;
}

.auth-resend__link:disabled {
	color: var(--color-fg-muted);
	cursor: default;
	text-decoration: none;
}

/* Centered confirmation card (check-your-email, envelope icon) */

.auth-card--center {
	max-width: 460px;
	text-align: center;
}

.auth-confirm__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto 18px;
	color: var(--color-yellow);
}

.auth-card--center .auth-card__subtitle {
	margin: 0 auto 8px;
	max-width: 380px;
}

.auth-card--center .auth-resend {
	text-align: center;
}

.auth-confirm__back {
	display: inline-flex;
	min-width: 260px;
	margin-top: 6px;
}

/* Success toast */

.toast {
	position: fixed;
	top: 96px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 1100;
	display: flex;
	align-items: center;
	gap: 16px;
	max-width: calc(100vw - 32px);
	padding: 16px 20px;
	background: var(--color-green-dark);
	color: #fff;
	border-radius: 6px;
	box-shadow: var(--shadow-pop);
	animation: toastIn 200ms ease-out;
}

.toast[hidden] { display: none; }

.toast__icon {
	flex-shrink: 0;
	display: inline-flex;
}

.toast__msg {
	font-size: 15px;
	line-height: 1.3;
}

.toast__close {
	flex-shrink: 0;
	background: transparent;
	border: 0;
	padding: 4px;
	margin-left: 8px;
	color: #fff;
	opacity: 0.8;
	display: inline-flex;
	cursor: pointer;
	transition: opacity var(--transition);
}

.toast__close:hover { opacity: 1; }

@keyframes toastIn {
	from { opacity: 0; transform: translate(-50%, -12px); }
	to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Multi-step (profile setup) */

[data-step][hidden] { display: none; }

/* Modal */

.modal[hidden] { display: none; }

.modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.4);
}

.modal__dialog {
	position: relative;
	background: #fff;
	border-radius: 6px;
	max-width: 440px;
	width: 100%;
	padding: 28px;
	box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
	animation: modalPop 160ms ease-out;
}

@keyframes modalPop {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

.modal__title {
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 12px;
	line-height: 1.3;
}

.modal__body {
	color: var(--color-fg-muted);
	font-size: 14px;
	line-height: 1.5;
	margin: 0 0 22px;
}

.modal__actions {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.modal__actions .btn {
	padding: 10px 22px;
	font-size: 14px;
}

/* Full-screen submit loader */

.auth-loading-overlay {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.72);
	backdrop-filter: blur(2px);
	cursor: wait;
}

.auth-loading-overlay__spinner {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 4px solid rgba(0, 0, 0, 0.12);
	border-top-color: var(--color-yellow);
	animation: authSpin 0.7s linear infinite;
}

@keyframes authSpin {
	to { transform: rotate(360deg); }
}

/* Responsive */

@media (max-width: 600px) {
	.auth-page { padding: 32px 16px; }
	.auth-card__title { font-size: 24px; }
	.field__row { grid-template-columns: 1fr; }
	.radio-group { gap: 14px; }
}
