/*
 * AquaManga Full-Page Authentication  (UTOON-style)
 * Loaded ONLY on /login/ page. Button class is .aqua-auth-btn
 * (not .aqua-btn) to avoid clashing with branding.css.
 * File: assets/css/aqua-auth-page.css
 */

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

:root {
	--ap: #00c4cc; --ap-d: #009ea5;
	--ap-glow: rgba(0,196,204,0.25); --ap-glow2: rgba(0,196,204,0.12);
	--bg: #06090f; --card: #0d1421; --card-b: #182030;
	--inp: #111827; --inp-b: #1f2d3d;
	--tx: #e2e8f2; --tx-m: #5a6a7e; --tx-s: #3d4f62;
	--err: #f87171; --ok: #34d399; --tab-bg: #131e2e;
	--r-card: 22px; --r-inp: 14px; --r-btn: 999px;
}

body.aqua-auth-page {
	min-height: 100dvh; min-height: 100vh;
	margin: 0 !important; padding: 0 !important;
	background: var(--bg); color: var(--tx);
	font-family: -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
	-webkit-font-smoothing: antialiased; overflow-x: hidden;
}

/* Hide any stray theme chrome on this page */
body.aqua-auth-page .site-header,
body.aqua-auth-page #masthead,
body.aqua-auth-page #colophon,
body.aqua-auth-page .site-footer,
body.aqua-auth-page .aqua-mobile-bottom-nav,
body.aqua-auth-page .mobile-bottom-nav,
body.aqua-auth-page .aqua-bottom-nav { display: none !important; }

.aqua-auth-scene { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.auth-glow { position: absolute; border-radius: 50%; filter: blur(90px); }
.auth-glow-1 { width: 380px; height: 380px; background: var(--ap); opacity: .08; top: -120px; left: -80px; animation: glowDrift 9s ease-in-out infinite alternate; }
.auth-glow-2 { width: 260px; height: 260px; background: #0066ff; opacity: .07; bottom: -60px; right: -60px; animation: glowDrift 12s ease-in-out infinite alternate-reverse; }
.auth-glow-3 { width: 200px; height: 200px; background: var(--ap); opacity: .05; top: 60%; left: 60%; animation: glowDrift 15s ease-in-out infinite alternate; }
@keyframes glowDrift { from { transform: translate(0,0) scale(1); } to { transform: translate(24px,18px) scale(1.08); } }

.aqua-auth-outer {
	position: relative; z-index: 1;
	min-height: 100dvh; min-height: 100vh;
	display: flex; flex-direction: column; align-items: center;
	padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 32px);
}

.aqua-auth-back {
	align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
	color: var(--tx-m); text-decoration: none; font-size: 14px; font-weight: 500;
	padding: 18px 4px; transition: color .2s; -webkit-tap-highlight-color: transparent;
}
.aqua-auth-back:hover { color: var(--tx); }
.aqua-auth-back svg { flex-shrink: 0; }

.aqua-auth-avatar { margin-bottom: -36px; position: relative; z-index: 2; }
.aqua-auth-logo-img, .aqua-auth-logo-fallback {
	width: 72px; height: 72px; border-radius: 50%;
	border: 3px solid var(--ap);
	box-shadow: 0 0 0 6px rgba(0,196,204,.1), 0 0 24px var(--ap-glow);
	display: flex; align-items: center; justify-content: center;
}
.aqua-auth-logo-img { object-fit: contain; background: var(--card); }
.aqua-auth-logo-fallback { background: var(--card); font-size: 28px; font-weight: 900; color: var(--ap); }

.aqua-auth-card {
	width: 100%; max-width: 400px;
	background: var(--card); border: 1px solid var(--card-b); border-radius: var(--r-card);
	padding: 52px 22px 28px;
	box-shadow: 0 32px 80px rgba(0,0,0,.65), 0 0 0 1px rgba(255,255,255,.03), inset 0 1px 0 rgba(255,255,255,.04);
	animation: cardEntrance .45s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes cardEntrance { from { opacity: 0; transform: translateY(22px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }

.aqua-auth-head { text-align: center; margin-bottom: 20px; }
.aqua-auth-title { font-size: 24px; font-weight: 800; letter-spacing: -.4px; color: var(--tx); margin: 0 0 6px; }
.aqua-auth-sub { font-size: 14px; color: var(--tx-m); line-height: 1.5; margin: 0; }

.aqua-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--tab-bg); border-radius: 12px; padding: 4px; gap: 4px; margin-bottom: 22px; }
.aqua-tab { appearance: none; background: transparent; border: none; color: var(--tx-m); font: 600 15px/1 inherit; padding: 11px 8px; border-radius: 9px; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; -webkit-tap-highlight-color: transparent; }
.aqua-tab.is-active { background: var(--ap); color: #000; box-shadow: 0 2px 14px var(--ap-glow); }
.aqua-tab:not(.is-active):hover { color: var(--tx); background: rgba(255,255,255,.05); }

.aqua-alert { border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.45; margin-bottom: 18px; animation: fadeSlideIn .25s ease both; }
.aqua-alert[hidden] { display: none !important; }
.aqua-alert.is-error { background: rgba(248,113,113,.1); border: 1px solid rgba(248,113,113,.28); color: var(--err); }
.aqua-alert.is-success { background: rgba(52,211,153,.1); border: 1px solid rgba(52,211,153,.28); color: var(--ok); }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

.aqua-panel { display: none; }
.aqua-panel.is-active { display: flex; flex-direction: column; gap: 14px; animation: panelSwipe .28s ease both; }
@keyframes panelSwipe { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: translateX(0); } }

.aqua-field { display: flex; flex-direction: column; gap: 6px; }
.aqua-label { font-size: 13px; font-weight: 600; color: var(--tx); letter-spacing: .15px; }

.aqua-input-row { position: relative; display: flex; align-items: center; }
.aqua-ico { position: absolute; left: 14px; width: 17px; height: 17px; color: var(--tx-s); pointer-events: none; flex-shrink: 0; }
.aqua-input {
	width: 100%; height: 50px; background: var(--inp);
	border: 1.5px solid var(--inp-b); border-radius: var(--r-inp);
	color: var(--tx); font: 15px/1 inherit; padding: 0 46px 0 42px; outline: none;
	-webkit-appearance: none; transition: border-color .2s, box-shadow .2s;
}
.aqua-input::placeholder { color: var(--tx-m); font-size: 14px; }
.aqua-input:focus { border-color: var(--ap); box-shadow: 0 0 0 3px var(--ap-glow2); }
.aqua-input.is-err { border-color: var(--err); box-shadow: 0 0 0 3px rgba(248,113,113,.18); }
.aqua-input.is-ok { border-color: var(--ok); }

.aqua-eye { position: absolute; right: 10px; background: none; border: none; cursor: pointer; color: var(--tx-m); padding: 8px; display: flex; align-items: center; justify-content: center; transition: color .2s; border-radius: 8px; -webkit-tap-highlight-color: transparent; }
.aqua-eye:hover { color: var(--tx); }
.aqua-eye svg { width: 17px; height: 17px; }

.aqua-err { display: block; font-size: 12px; color: var(--err); animation: fadeSlideIn .2s ease; }
.aqua-err:empty { display: none; }

.aqua-strength { height: 3px; background: var(--inp-b); border-radius: 999px; overflow: hidden; margin-top: 2px; }
.aqua-strength-fill { height: 100%; width: 0; border-radius: 999px; transition: width .3s ease, background .3s ease; }

.aqua-row-spread { display: flex; align-items: center; justify-content: space-between; margin-top: -2px; }
.aqua-check-label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--tx-m); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.aqua-check { accent-color: var(--ap); width: 16px; height: 16px; cursor: pointer; }
.aqua-text-link { font-size: 14px; font-weight: 600; color: var(--ap); text-decoration: none; }
.aqua-text-link:hover { text-decoration: underline; }

.aqua-auth-btn {
	appearance: none; width: 100%; height: 52px; border: none; border-radius: var(--r-btn);
	background: linear-gradient(135deg, var(--ap) 0%, var(--ap-d) 100%);
	color: #000; font: 700 16px/1 inherit; cursor: pointer;
	display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px;
	box-shadow: 0 4px 22px var(--ap-glow);
	transition: transform .15s ease, box-shadow .15s ease, opacity .15s;
	-webkit-tap-highlight-color: transparent;
}
.aqua-auth-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 30px var(--ap-glow); }
.aqua-auth-btn:active:not(:disabled) { transform: scale(.98); }
.aqua-auth-btn:disabled { opacity: .65; cursor: not-allowed; transform: none; }

.aqua-spinner { width: 20px; height: 20px; stroke: #000; animation: spinRound .75s linear infinite; }
@keyframes spinRound { to { transform: rotate(360deg); } }

.aqua-switch-text { text-align: center; font-size: 14px; color: var(--tx-m); margin: 0; }
.aqua-inline-btn { appearance: none; background: none; border: none; font: 600 14px inherit; color: var(--ap); cursor: pointer; padding: 0; -webkit-tap-highlight-color: transparent; }
.aqua-inline-btn:hover { text-decoration: underline; }

.aqua-terms { text-align: center; font-size: 12px; color: var(--tx-s); margin: -6px 0 0; line-height: 1.5; }
.aqua-terms a { color: var(--tx-m); text-decoration: underline; }
.aqua-terms a:hover { color: var(--ap); }

@media (max-width: 400px) {
	.aqua-auth-card { border-radius: 18px; padding: 52px 16px 24px; }
	.aqua-auth-title { font-size: 21px; }
	.aqua-input { font-size: 14px; }
}
@media (min-height: 800px) {
	.aqua-auth-outer { justify-content: center; padding-top: 0; }
	.aqua-auth-back { position: absolute; top: 0; left: 16px; }
}
