/**
 * Lithops Auth - Frontend Styles
 *
 * @package Lithops_Auth
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
	--la-bg: #ffffff;
	--la-text: #121826;
	--la-muted: #5b6472;
	--la-line: #e7ebf3;
	--la-shadow: 0 10px 24px rgba(18, 24, 38, 0.08);

	--la-dark: #111827;
	--la-dark-2: #0b1220;

	--la-soft: #f3f4f6;

	--la-danger: #b42318;
	--la-ok: #067647;
	--la-info: #2563eb;
}

/* ==========================================================================
   Auth Block Container
   ========================================================================== */

.la-auth-wrap {
	font-family:
		ui-sans-serif,
		system-ui,
		-apple-system,
		Segoe UI,
		Roboto,
		Arial,
		sans-serif;
	color: var(--la-text);
	line-height: 1.45;
}

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

.auth-block {
	background: transparent;
	padding: 26px 0;
	margin-bottom: 20px;
}

@media (min-width: 992px) {
	.auth-block {
		padding: 34px 0;
	}
}

.auth-card {
	background: #fff;
	border: 1px solid var(--la-line);
	border-radius: 12px;
	box-shadow: var(--la-shadow);
	padding: 16px;
	max-width: 480px;
	margin: 0 auto;
}

@media (min-width: 992px) {
	.auth-card {
		padding: 18px;
	}
}

/* ==========================================================================
   Auth Header
   ========================================================================== */

.auth-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 14px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--la-line);
}

.auth-icon {
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: var(--la-dark);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.auth-icon svg {
	width: 18px;
	height: 18px;
	color: #fff;
}

.auth-title {
	font-weight: 800;
	font-size: 16px;
	margin: 0;
	letter-spacing: -0.01em;
}

.auth-subtitle {
	font-size: 13px;
	color: var(--la-muted);
	margin: 2px 0 0 0;
}

/* ==========================================================================
   Form Rows
   ========================================================================== */

.reg-row {
	display: grid;
	grid-template-columns: 1fr;
	gap: 10px;
}

.reg-row.two {
	grid-template-columns: 1fr;
}

@media (min-width: 576px) {
	.reg-row.two {
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}
}

/* ==========================================================================
   Labels and Inputs
   ========================================================================== */

.reg-label {
	font-size: 12px;
	color: var(--la-muted);
	margin: 0 0 6px;
	font-weight: 700;
}

.reg-input {
	width: 100%;
	border: 1px solid var(--la-line);
	background: #fff;
	border-radius: 12px;
	padding: 11px 12px;
	font-size: 14px;
	outline: none;
	transition:
		border-color 0.15s,
		box-shadow 0.15s;
}

.reg-input:focus {
	border-color: #cbd5e1;
	box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.reg-input[aria-invalid='true'] {
	border-color: rgba(180, 35, 24, 0.45);
	box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.1);
}

.reg-input:disabled {
	background: var(--la-soft);
	cursor: not-allowed;
}

/* ==========================================================================
   Hints
   ========================================================================== */

.reg-hint {
	margin-top: 10px;
	font-size: 13px;
	color: var(--la-muted);
}

.reg-alt {
	margin-top: 14px;
	padding-top: 12px;
	border-top: 1px solid var(--la-line, #e5e7eb);
	font-size: 13px;
	color: var(--la-muted);
	text-align: center;
}

.reg-alt .reg-link {
	margin-left: 4px;
}

/* ==========================================================================
   Actions
   ========================================================================== */

.reg-actions {
	margin-top: 12px;
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.la-auth-wrap .btnx {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 14px;
	border-radius: 12px;
	border: 1px solid var(--la-dark);
	background: var(--la-dark);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	text-decoration: none;
	transition:
		background 0.12s ease,
		opacity 0.12s ease;
	cursor: pointer;
}

.la-auth-wrap .btnx:hover {
	background: var(--la-dark-2);
	color: #fff;
}

.la-auth-wrap .btnx:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.la-auth-wrap .btnx.secondary {
	background: #fff;
	color: var(--la-text);
	border-color: var(--la-line);
	font-weight: 600;
}

.la-auth-wrap .btnx.secondary:hover {
	background: var(--la-soft);
}

.reg-actions .btnx {
	width: 100%;
	justify-content: center;
	padding: 12px 14px;
}

@media (min-width: 420px) {
	.reg-actions .btnx {
		width: auto;
	}
}

/* ==========================================================================
   Links
   ========================================================================== */

.reg-link {
	font-size: 14px;
	color: var(--la-text);
	text-decoration: underline;
	text-underline-offset: 4px;
	text-decoration-thickness: 1px;
	text-decoration-color: #c9d1e3;
	cursor: pointer;
	background: none;
	border: none;
	padding: 0;
}

.reg-link:hover {
	text-decoration-color: var(--la-text);
}

.reg-link:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* ==========================================================================
   Status Messages
   ========================================================================== */

.reg-status {
	padding: 12px;
	border: 1px solid var(--la-line);
	border-radius: 12px;
	background: #fbfcff;
	color: var(--la-muted);
	font-size: 14px;
	margin-bottom: 12px;
}

.reg-status b {
	color: var(--la-text);
}

.reg-status.ok {
	border-color: rgba(6, 118, 71, 0.18);
	background: #ecfdf5;
}

.reg-status.ok b {
	color: var(--la-ok);
}

.reg-status.err {
	border-color: rgba(180, 35, 24, 0.22);
	background: #fef2f2;
}

.reg-status.err b {
	color: var(--la-danger);
}

.reg-status.info {
	border-color: rgba(37, 99, 235, 0.22);
	background: #eff6ff;
}

.reg-status.info b {
	color: var(--la-info);
}

/* ==========================================================================
   Hidden State
   ========================================================================== */

.reg-hidden {
	display: none !important;
}

/* ==========================================================================
   Code Inputs (6 digits)
   ========================================================================== */

.code-wrap {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 8px;
}

.code-input {
	width: 100%;
	text-align: center;
	border: 1px solid var(--la-line);
	background: #fff;
	border-radius: 12px;
	padding: 12px 0;
	font-size: 16px;
	font-weight: 800;
	outline: none;
	transition:
		border-color 0.15s,
		box-shadow 0.15s;
}

.code-input:focus {
	border-color: #cbd5e1;
	box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}

.code-input[aria-invalid='true'] {
	border-color: rgba(180, 35, 24, 0.45);
	box-shadow: 0 0 0 3px rgba(180, 35, 24, 0.1);
}

.code-input:disabled {
	background: var(--la-soft);
	cursor: not-allowed;
}

@media (max-width: 360px) {
	.code-wrap {
		gap: 6px;
	}
	.code-input {
		padding: 11px 0;
		font-size: 15px;
	}
}

/* ==========================================================================
   Row Inline
   ========================================================================== */

.row-inline {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 10px;
}

/* ==========================================================================
   Loading Spinner
   ========================================================================== */

.la-loading {
	position: relative;
}

.la-loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 8px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #fff;
	border-radius: 50%;
	animation: la-spin 0.8s linear infinite;
}

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

/* ==========================================================================
   Feature Disabled Info Box
   ========================================================================== */

.la-feature-disabled {
	padding: 20px;
	background: var(--la-soft);
	border: 1px solid var(--la-line);
	border-radius: 12px;
	text-align: center;
	max-width: 480px;
	margin: 20px auto;
}

.la-feature-disabled-icon {
	width: 48px;
	height: 48px;
	margin: 0 auto 15px;
	background: var(--la-line);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

.la-feature-disabled-icon svg {
	width: 24px;
	height: 24px;
	color: var(--la-muted);
}

.la-feature-disabled-title {
	font-size: 16px;
	font-weight: 700;
	margin: 0 0 8px;
	color: var(--la-text);
}

.la-feature-disabled-text {
	font-size: 14px;
	color: var(--la-muted);
	margin: 0;
}
