.ast-auth-modal {
	padding: 20px;
	backdrop-filter: blur(10px);
}

.ast-auth-modal .ast-modal-inner {
	width: min(100%, 520px);
	padding: 28px;
	border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
	background:
		radial-gradient(circle at top right, color-mix(in srgb, var(--accent) 18%, transparent), transparent 44%),
		var(--surface);
}

.ast-auth-modal-header {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 20px;
}

.ast-auth-modal-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--accent);
}

.ast-auth-modal-title {
	margin: 0;
	font-size: clamp(26px, 3vw, 32px);
	line-height: 1.08;
}

.ast-auth-modal-copy {
	margin: 0;
	color: var(--muted);
}

.ast-auth-tabs {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin-bottom: 16px;
}

.ast-auth-social-stack {
	display: grid;
	gap: 18px;
}

.ast-auth-tab {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	border-radius: 14px;
	border: 1px solid var(--border);
	background: var(--surface-alt);
	color: var(--text);
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.ast-auth-tab:hover,
.ast-auth-tab:focus-visible {
	border-color: color-mix(in srgb, var(--accent) 42%, var(--border));
	background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 18%, var(--surface-alt)), color-mix(in srgb, var(--accent) 10%, var(--surface)));
	color: color-mix(in srgb, var(--accent) 70%, var(--text));
	box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 16%, transparent);
	transform: translateY(-1px);
}

.ast-auth-tab.is-active {
	background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 18%, var(--surface)), color-mix(in srgb, var(--accent) 8%, var(--surface)));
	border-color: color-mix(in srgb, var(--accent) 46%, var(--border));
	box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 18%, transparent);
}

.ast-auth-google {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 50px;
	border-radius: 16px;
	border: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
	background: var(--surface);
	color: var(--text);
	text-decoration: none;
	font-weight: 700;
	box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
	transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.ast-auth-google:hover,
.ast-auth-google:focus-visible {
	transform: translateY(-1px);
	border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
	box-shadow: 0 18px 34px rgba(15, 23, 42, 0.12);
}

.ast-auth-google-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
}

.ast-auth-google-icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

.ast-auth-divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 18px 0;
	color: var(--muted);
	font-size: 13px;
}

.ast-auth-divider::before,
.ast-auth-divider::after {
	content: '';
	flex: 1;
	height: 1px;
	background: color-mix(in srgb, var(--border) 88%, transparent);
}

.ast-auth-pane {
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.ast-auth-pane[hidden] {
	display: none !important;
}

.ast-auth-fields {
	display: grid;
	gap: 12px;
}

.ast-auth-field {
	display: grid;
	gap: 8px;
}

.ast-auth-field-label {
	font-size: 13px;
	font-weight: 700;
	color: var(--text);
}

.ast-auth-input {
	width: 100%;
	min-height: 48px;
	padding: 0 14px;
	border-radius: 14px;
	border: 1px solid var(--border);
	background: color-mix(in srgb, var(--surface-alt) 62%, var(--surface));
	color: var(--text);
	font: inherit;
	transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.ast-auth-input:focus {
	outline: none;
	border-color: color-mix(in srgb, var(--accent) 52%, var(--border));
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
	background: var(--surface);
}

.ast-auth-password-wrap {
	position: relative;
	display: flex;
	align-items: center;
}

.ast-auth-password-wrap .ast-auth-input {
	padding-right: 52px;
}

.ast-auth-password-toggle {
	position: absolute;
	top: 50%;
	right: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 12px;
	background: transparent;
	color: color-mix(in srgb, var(--muted) 72%, var(--text));
	cursor: pointer;
	transform: translateY(-50%);
	transition: background 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.ast-auth-password-toggle:hover,
.ast-auth-password-toggle:focus-visible,
.ast-auth-password-toggle.is-visible {
	border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
	background: color-mix(in srgb, var(--accent) 12%, var(--surface));
	color: var(--accent);
	box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 12%, transparent);
	outline: none;
}

.ast-auth-password-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
}

.ast-auth-password-icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

.ast-auth-password-icon-hide {
	display: none;
}

.ast-auth-password-toggle.is-visible .ast-auth-password-icon-show {
	display: none;
}

.ast-auth-password-toggle.is-visible .ast-auth-password-icon-hide {
	display: inline-flex;
}

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

.ast-auth-checkbox {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--muted);
}

.ast-auth-checkbox input {
	width: 16px;
	height: 16px;
	accent-color: var(--accent);
}

.ast-auth-link {
	color: var(--accent);
	text-decoration: none;
	font-size: 13px;
	font-weight: 700;
}

.ast-auth-link:hover,
.ast-auth-link:focus-visible {
	text-decoration: underline;
}

.ast-auth-link-button {
	display: inline-flex;
	align-items: center;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.ast-auth-meta-forgot {
	justify-content: flex-start;
}

.ast-auth-submit {
	width: 100%;
	min-height: 50px;
	border: none;
	border-radius: 16px;
	background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent));
	color: #fff;
	font: inherit;
	font-weight: 800;
	cursor: pointer;
	box-shadow: 0 18px 30px color-mix(in srgb, var(--accent) 22%, transparent);
	transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.ast-auth-submit:hover,
.ast-auth-submit:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 22px 34px color-mix(in srgb, var(--accent) 26%, transparent);
}

.ast-auth-submit[disabled] {
	opacity: 0.72;
	cursor: wait;
	transform: none;
}

.ast-auth-status {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-top: 6px;
	padding: 14px 16px;
	border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
	border-radius: 16px;
	background: color-mix(in srgb, var(--surface-alt) 70%, var(--surface));
}

.ast-auth-status[hidden] {
	display: none !important;
}

.ast-auth-status-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 900;
	line-height: 1;
}

.ast-auth-status-content {
	display: grid;
	gap: 4px;
	min-width: 0;
}

.ast-auth-status-title {
	display: block;
	font-size: 13px;
	font-weight: 800;
	line-height: 1.2;
}

.ast-auth-status-text {
	display: block;
	font-size: 13px;
	line-height: 1.45;
	color: var(--muted);
}

.ast-auth-status[data-state='pending'] {
	border-color: color-mix(in srgb, var(--accent) 24%, var(--border));
	background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.ast-auth-status[data-state='pending'] .ast-auth-status-icon {
	background: color-mix(in srgb, var(--accent) 18%, transparent);
	color: var(--accent);
}

.ast-auth-status[data-state='pending'] .ast-auth-status-title {
	color: color-mix(in srgb, var(--accent) 78%, var(--text));
}

.ast-auth-status[data-state='success'] {
	border-color: color-mix(in srgb, #10b981 30%, var(--border));
	background: color-mix(in srgb, #10b981 10%, var(--surface));
}

.ast-auth-status[data-state='success'] .ast-auth-status-icon {
	background: color-mix(in srgb, #10b981 18%, transparent);
	color: #10b981;
}

.ast-auth-status[data-state='success'] .ast-auth-status-title {
	color: #10b981;
}

.ast-auth-status[data-state='error'] {
	border-color: color-mix(in srgb, #f43f5e 28%, var(--border));
	background: color-mix(in srgb, #f43f5e 10%, var(--surface));
}

.ast-auth-status[data-state='error'] .ast-auth-status-icon {
	background: color-mix(in srgb, #f43f5e 18%, transparent);
	color: #f43f5e;
}

.ast-auth-status[data-state='error'] .ast-auth-status-title {
	color: #f43f5e;
}

.ast-auth-register-note {
	margin: 0;
	font-size: 12px;
	color: var(--muted);
}

.ast-auth-verify-summary {
	display: grid;
	gap: 6px;
	padding: 14px 16px;
	border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
	border-radius: 16px;
	background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

.ast-auth-verify-email {
	margin: 0;
	font-size: 15px;
	font-weight: 800;
	color: var(--text);
}

.ast-auth-meta-verify {
	align-items: center;
	justify-content: space-between;
}

.ast-auth-resend-card {
	display: grid;
	gap: 12px;
	padding: 14px 16px;
	border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
	border-radius: 16px;
	background: color-mix(in srgb, var(--surface-alt) 72%, var(--surface));
}

.ast-auth-resend-copy {
	display: grid;
	gap: 4px;
}

.ast-auth-resend-title {
	margin: 0;
	font-size: 13px;
	font-weight: 800;
	color: var(--text);
}

.ast-auth-resend-note {
	margin: 0;
	font-size: 12px;
	line-height: 1.5;
	color: var(--muted);
}

.ast-auth-resend-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 0 14px;
	border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
	border-radius: 999px;
	background: color-mix(in srgb, var(--accent) 10%, var(--surface));
	color: var(--accent);
	font-size: 13px;
	font-weight: 800;
}

.ast-auth-resend-button:hover,
.ast-auth-resend-button:focus-visible {
	background: color-mix(in srgb, var(--accent) 16%, var(--surface));
	text-decoration: none;
}

.ast-auth-resend-button[disabled] {
	opacity: 0.68;
	cursor: not-allowed;
	text-decoration: none;
}

.ast-auth-resend-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}

.ast-auth-resend-state {
	display: inline-flex;
	align-items: center;
	min-height: 30px;
	padding: 0 12px;
	border-radius: 999px;
	border: 1px solid color-mix(in srgb, var(--border) 88%, transparent);
	background: color-mix(in srgb, var(--surface) 88%, var(--surface-alt));
	font-size: 12px;
	font-weight: 800;
	color: var(--muted);
}

.ast-auth-resend-state[data-state='cooldown'] {
	border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
	background: color-mix(in srgb, var(--accent) 10%, var(--surface));
	color: var(--accent);
}

.ast-auth-resend-state[data-state='ready'] {
	border-color: color-mix(in srgb, #10b981 24%, var(--border));
	background: color-mix(in srgb, #10b981 10%, var(--surface));
	color: #10b981;
}

.ast-auth-resend-state[data-state='locked'] {
	border-color: color-mix(in srgb, #f43f5e 26%, var(--border));
	background: color-mix(in srgb, #f43f5e 10%, var(--surface));
	color: #f43f5e;
}

.ast-auth-resend-quota {
	font-size: 12px;
	font-weight: 700;
	color: var(--muted);
}

html[data-theme='dark'] .ast-auth-modal .ast-modal-inner {
	border-color: rgba(138, 180, 255, 0.16);
	background:
		radial-gradient(circle at top right, rgba(91, 140, 255, 0.16), transparent 42%),
		linear-gradient(180deg, rgba(18, 24, 40, 0.98), rgba(16, 21, 34, 0.98));
	box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
}

html[data-theme='dark'] .ast-auth-google {
	background: rgba(18, 24, 40, 0.92);
	box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
}

html[data-theme='dark'] .ast-auth-input {
	background: rgba(15, 23, 42, 0.76);
}

html[data-theme='dark'] .ast-auth-verify-summary {
	border-color: rgba(138, 180, 255, 0.18);
	background: rgba(26, 33, 53, 0.88);
}

html[data-theme='dark'] .ast-auth-resend-card {
	border-color: rgba(138, 180, 255, 0.14);
	background: rgba(26, 33, 53, 0.6);
}

html[data-theme='light'] .ast-auth-status[data-state='success'] .ast-auth-status-title,
html[data-theme='light'] .ast-auth-status[data-state='success'] .ast-auth-status-icon {
	color: #0f9f62;
}

@media (max-width: 640px) {
	.ast-auth-modal {
		padding: 14px;
	}

	.ast-auth-modal .ast-modal-inner {
		padding: 22px 18px;
		width: min(100%, 100%);
	}

	.ast-auth-tabs {
		grid-template-columns: 1fr;
	}

	.ast-auth-meta {
		flex-direction: column;
		align-items: flex-start;
	}

	.ast-auth-meta-verify,
	.ast-auth-resend-meta {
		align-items: flex-start;
		justify-content: flex-start;
	}
}
