/* =============================================================================
   Auth Kit — Base + Casa Areco theme (v0.3.0)
   ============================================================================= */

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

.auth-kit label,
.auth-kit input,
.auth-kit button,
.auth-kit p,
.auth-kit h1,
.auth-kit small,
.auth-kit a {
	margin: 0;
	line-height: 1.4;
}

.auth-kit input[type="text"],
.auth-kit input[type="email"],
.auth-kit input[type="password"] {
	line-height: 1.4;
	height: auto;
	min-height: 0;
}

.auth-kit {
	--ak-color-primary:      #696a3d;
	--ak-color-primary-dark: #565737;
	--ak-color-accent:       #c27d38;
	--ak-color-accent-dark:  #9f6847;
	--ak-color-bg:           #e4e2db;
	--ak-color-surface:      #ffffff;
	--ak-color-text:         #2b2b2b;
	--ak-color-muted:        #6b6b6b;
	--ak-color-border:       #d6d3cb;
	--ak-color-error:        #b3261e;
	--ak-color-error-bg:     #fdecea;
	--ak-color-success:      #2e7d32;
	--ak-color-success-bg:   #e6f4e6;
	--ak-color-warn:         #b47409;
	--ak-color-warn-bg:      #fdf3e2;

	--ak-radius:    6px;
	--ak-radius-lg: 10px;

	--ak-font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

	font-family: var(--ak-font);
	color: var(--ak-color-text);
	background: var(--ak-color-bg);
	padding: 2rem 1rem;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	min-height: 100%;
}

.auth-kit__form {
	background: var(--ak-color-surface);
	border-radius: var(--ak-radius-lg);
	padding: clamp(1.5rem, 4vw, 2.5rem);
	width: 100%;
	max-width: 460px;
	box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.02);
	border: 1px solid var(--ak-color-border);
}

.auth-kit__title {
	font-family: var(--ak-font);
	font-weight: 700;
	font-size: 1.75rem;
	line-height: 1.15;
	margin: 0 0 0.35rem;
	color: var(--ak-color-primary);
	letter-spacing: -0.01em;
}

.auth-kit__subtitle {
	font-weight: 500;
	color: var(--ak-color-muted);
	margin: 0 0 1.5rem;
	font-size: 0.95rem;
	line-height: 1.4;
}

/* Banner de mensajes */
.auth-kit__message {
	padding: 0.75rem 1rem;
	border-radius: var(--ak-radius);
	font-weight: 500;
	font-size: 0.9rem;
	line-height: 1.4;
	margin-bottom: 1rem;
	border: 1px solid transparent;
}

.auth-kit__message[hidden] { display: none; }

.auth-kit__message--error {
	background: var(--ak-color-error-bg);
	border-color: var(--ak-color-error);
	color: var(--ak-color-error);
}

.auth-kit__message--success {
	background: var(--ak-color-success-bg);
	border-color: var(--ak-color-success);
	color: var(--ak-color-success);
}

.auth-kit__message a {
	color: inherit;
	font-weight: 700;
	text-decoration: underline;
	margin-left: 0.25rem;
}

/* Rows/fields */
.auth-kit__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
	margin-bottom: 1rem;
}

.auth-kit__row .auth-kit__field { margin-bottom: 0; }

@media (max-width: 480px) {
	.auth-kit__row {
		grid-template-columns: 1fr;
		gap: 0;
		margin-bottom: 0;
	}
	.auth-kit__row .auth-kit__field { margin-bottom: 1rem; }
}

.auth-kit__field {
	margin-bottom: 1rem;
	display: flex;
	flex-direction: column;
}

.auth-kit__field label {
	font-weight: 600;
	font-size: 0.85rem;
	margin-bottom: 0.35rem;
	color: var(--ak-color-text);
}

.auth-kit__field input[type="text"],
.auth-kit__field input[type="email"],
.auth-kit__field input[type="password"] {
	font-family: var(--ak-font);
	font-weight: 500;
	font-size: 0.95rem;
	padding: 0.7rem 0.85rem;
	border: 1.5px solid var(--ak-color-border);
	border-radius: var(--ak-radius);
	background: var(--ak-color-surface);
	color: var(--ak-color-text);
	width: 100%;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.auth-kit__field input:focus {
	outline: none;
	border-color: var(--ak-color-primary);
	box-shadow: 0 0 0 3px rgba(105, 106, 61, 0.15);
}

.auth-kit__field input.is-invalid { border-color: var(--ak-color-error); }
.auth-kit__field input.is-valid   { border-color: var(--ak-color-success); }

/* Password */
.auth-kit__password-wrap { position: relative; }
.auth-kit__password-wrap input { padding-right: 2.75rem; }

.auth-kit__toggle {
	position: absolute;
	right: 0.5rem;
	top: 50%;
	transform: translateY(-50%);
	background: transparent;
	border: none;
	color: var(--ak-color-muted);
	padding: 0.35rem;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: color 0.15s ease, background 0.15s ease;
}
.auth-kit__toggle:hover {
	color: var(--ak-color-primary);
	background: rgba(105, 106, 61, 0.08);
}
.auth-kit__toggle:focus-visible {
	outline: 2px solid var(--ak-color-primary);
	outline-offset: 1px;
}

.auth-kit__strength {
	display: flex;
	gap: 4px;
	margin-top: 0.5rem;
}
.auth-kit__strength span {
	flex: 1;
	height: 4px;
	background: var(--ak-color-border);
	border-radius: 2px;
	transition: background 0.2s ease;
}
.auth-kit__strength[data-level="1"] span:nth-child(-n+1) { background: #d32f2f; }
.auth-kit__strength[data-level="2"] span:nth-child(-n+2) { background: #ed6c02; }
.auth-kit__strength[data-level="3"] span:nth-child(-n+3) { background: #f9a825; }
.auth-kit__strength[data-level="4"] span:nth-child(-n+4) { background: var(--ak-color-success); }

.auth-kit__error {
	color: var(--ak-color-error);
	font-size: 0.8rem;
	margin-top: 0.3rem;
	font-weight: 500;
	line-height: 1.3;
}
.auth-kit__error:empty { display: none; }

.auth-kit__match {
	font-size: 0.8rem;
	margin-top: 0.3rem;
	font-weight: 500;
	line-height: 1.3;
}
.auth-kit__match:empty { display: none; }
.auth-kit__match.is-match   { color: var(--ak-color-success); }
.auth-kit__match.is-nomatch { color: var(--ak-color-error); }

/* Checkbox T&C */
.auth-kit__field--check { flex-direction: column; }
.auth-kit__check {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	cursor: pointer;
	font-weight: 500;
	font-size: 0.88rem;
	color: var(--ak-color-text);
	line-height: 1.4;
	margin-bottom: 0;
}
.auth-kit__check input[type="checkbox"] {
	margin-top: 0.15rem;
	accent-color: var(--ak-color-primary);
	width: 1.05rem;
	height: 1.05rem;
	flex-shrink: 0;
	cursor: pointer;
}
.auth-kit__check a {
	color: var(--ak-color-accent);
	text-decoration: underline;
}
.auth-kit__check a:hover { color: var(--ak-color-accent-dark); }

/* Honeypot */
.auth-kit__honeypot {
	position: absolute !important;
	left: -10000px !important;
	top: -10000px !important;
	height: 1px !important;
	width: 1px !important;
	overflow: hidden !important;
}

/* Submit */
.auth-kit__submit {
	width: 100%;
	padding: 0.85rem 1rem;
	background: var(--ak-color-primary);
	color: #fff;
	border: none;
	border-radius: var(--ak-radius);
	font-family: var(--ak-font);
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.05s ease;
	margin-top: 0.5rem;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	letter-spacing: 0.01em;
}
.auth-kit__submit:hover  { background: var(--ak-color-primary-dark); }
.auth-kit__submit:active { transform: translateY(1px); }
.auth-kit__submit:focus-visible {
	outline: 3px solid var(--ak-color-accent);
	outline-offset: 2px;
}
.auth-kit__submit:disabled {
	background: var(--ak-color-muted);
	cursor: not-allowed;
}
.auth-kit__submit.is-loading .auth-kit__submit-text { visibility: hidden; }
.auth-kit__submit-loader {
	display: none;
	position: absolute;
	width: 20px;
	height: 20px;
	border: 2.5px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: ak-spin 0.7s linear infinite;
}
.auth-kit__submit.is-loading .auth-kit__submit-loader { display: block; }
@keyframes ak-spin { to { transform: rotate(360deg); } }

/* Foot */
.auth-kit__foot {
	text-align: center;
	margin: 1rem 0 0;
	color: var(--ak-color-muted);
	font-weight: 500;
	font-size: 0.9rem;
}
.auth-kit__foot a {
	color: var(--ak-color-accent);
	font-weight: 600;
	text-decoration: none;
}
.auth-kit__foot a:hover {
	color: var(--ak-color-accent-dark);
	text-decoration: underline;
}

/* ==================== Panels (check-email / verify / expired) ==================== */
.auth-kit__panel {
	text-align: center;
	max-width: 480px;
}

.auth-kit__icon {
	color: var(--ak-color-primary);
	display: flex;
	justify-content: center;
	margin-bottom: 1rem;
}
.auth-kit__icon--success { color: var(--ak-color-success); }
.auth-kit__icon--error   { color: var(--ak-color-error); }
.auth-kit__icon--warn    { color: var(--ak-color-warn); }

.auth-kit__lead {
	font-size: 1rem;
	line-height: 1.5;
	color: var(--ak-color-text);
	margin: 0 0 1rem;
	font-weight: 500;
}

.auth-kit__hint-block {
	font-size: 0.85rem;
	line-height: 1.5;
	color: var(--ak-color-muted);
	margin: 0.75rem 0 0;
	font-weight: 500;
}

.auth-kit__actions {
	margin-top: 1.5rem;
	display: flex;
	justify-content: center;
	gap: 0.75rem;
}

.auth-kit__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.75rem 1.5rem;
	background: var(--ak-color-primary);
	color: #fff !important;
	border-radius: var(--ak-radius);
	font-family: var(--ak-font);
	font-weight: 600;
	font-size: 0.95rem;
	text-decoration: none !important;
	transition: background 0.15s ease, transform 0.05s ease;
	border: none;
	cursor: pointer;
	min-height: 44px;
	letter-spacing: 0.01em;
}
.auth-kit__button:hover  { background: var(--ak-color-primary-dark); color: #fff !important; }
.auth-kit__button:active { transform: translateY(1px); }
.auth-kit__button:focus-visible {
	outline: 3px solid var(--ak-color-accent);
	outline-offset: 2px;
}

/* Resend form (dentro del panel expired) */
.auth-kit__resend-form {
	text-align: left;
	margin-top: 1.25rem;
}

/* Field inline: remember + forgot en una fila */
.auth-kit__field--inline {
	flex-direction: row;
	justify-content: space-between;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.auth-kit__inline-link {
	color: var(--ak-color-accent);
	font-weight: 600;
	font-size: 0.85rem;
	text-decoration: none;
}

.auth-kit__inline-link:hover {
	color: var(--ak-color-accent-dark);
	text-decoration: underline;
}

/* Turnstile widget */
.auth-kit__turnstile {
	margin: 0.5rem 0 1rem;
	display: flex;
	justify-content: center;
	min-height: 65px;
}

@media (max-width: 400px) {
	.auth-kit__turnstile {
		transform: scale(0.95);
		transform-origin: center;
	}
}
