/* Auth pages (admin/coach login, password.php). Standalone; no Tailwind dependency. */
.auth-page {
    --accent: #22d3ee;
    --accent-2: #3b82f6;
    --accent-soft: rgba(34, 211, 238, .14);
    --accent-ring: rgba(34, 211, 238, .28);
    --bg: #050b1a;
    --panel: rgba(13, 22, 43, .72);
    --line: rgba(148, 178, 255, .14);
    --line-strong: rgba(148, 178, 255, .26);
    --text: #eef4ff;
    --muted: #93a3c4;
    --faint: #64748b;
    --field: rgba(6, 13, 30, .72);
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    -webkit-font-smoothing: antialiased;
}
.auth-theme-admin { --accent: #818cf8; --accent-2: #a855f7; --accent-soft: rgba(129, 140, 248, .15); --accent-ring: rgba(129, 140, 248, .3); }
.auth-theme-coach { --accent: #34d399; --accent-2: #06b6d4; --accent-soft: rgba(52, 211, 153, .14); --accent-ring: rgba(52, 211, 153, .3); }
.auth-page *, .auth-page *::before, .auth-page *::after { box-sizing: border-box; }
.auth-page a { color: inherit; text-decoration: none; }
.auth-page [hidden] { display: none !important; }
.auth-icon { width: 18px; height: 18px; flex-shrink: 0; }

/* ── Background ─────────────────────────────────────────────────────── */
.auth-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.auth-orb { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; animation: auth-drift 18s ease-in-out infinite alternate; }
.auth-orb-a { width: 560px; height: 560px; top: -180px; left: -140px; background: var(--accent); opacity: .22; }
.auth-orb-b { width: 520px; height: 520px; bottom: -220px; right: -120px; background: var(--accent-2); opacity: .2; animation-delay: -9s; }
.auth-ring { position: absolute; border: 1px solid var(--line); border-radius: 50%; }
.auth-ring-a { width: 900px; height: 900px; top: -420px; left: -360px; }
.auth-ring-b { width: 700px; height: 700px; bottom: -380px; right: -260px; border-color: rgba(148, 178, 255, .09); }
.auth-grid {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(148, 178, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 178, 255, .05) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
}
@keyframes auth-drift { to { transform: translate3d(60px, 40px, 0) scale(1.08); } }

/* ── Layout ─────────────────────────────────────────────────────────── */
.auth-shell {
    position: relative; z-index: 1;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    max-width: 1180px;
    margin: 0 auto;
    padding: 32px 28px;
    gap: 56px;
    align-items: center;
}
.auth-side { display: flex; flex-direction: column; justify-content: space-between; min-height: min(640px, calc(100vh - 64px)); padding: 8px 0; }
.auth-brand { display: inline-flex; align-items: center; gap: 12px; font: 700 20px/1 'Outfit', sans-serif; letter-spacing: -.01em; }
.auth-brand-mark {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 10px 30px -8px var(--accent-ring);
    color: #fff;
}
.auth-brand-mark .auth-icon { width: 22px; height: 22px; }
.auth-brand-name span { color: var(--accent); }
.auth-side-body { margin: 40px 0; }
.auth-eyebrow {
    display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
    border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .03);
    font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--accent);
}
.auth-eyebrow::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.auth-side-title { margin: 22px 0 16px; font: 700 clamp(34px, 3.6vw, 50px)/1.08 'Outfit', sans-serif; letter-spacing: -.03em; }
.auth-side-title span {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-side-lead { max-width: 440px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.75; }
.auth-features { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 12px; max-width: 440px; }
.auth-features li {
    display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px;
    border: 1px solid var(--line); background: rgba(255, 255, 255, .025);
    transition: border-color .25s, transform .25s;
}
.auth-features li:hover { border-color: var(--line-strong); transform: translateX(4px); }
.auth-feature-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.auth-features strong { display: block; font-size: 14px; font-weight: 700; }
.auth-features small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.auth-side-foot { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--faint); font-size: 12px; }
.auth-side-foot .auth-icon { width: 15px; height: 15px; color: var(--accent); }

.auth-main { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.auth-card {
    position: relative; width: 100%; max-width: 460px;
    padding: 40px 38px 34px;
    border-radius: 28px;
    border: 1px solid var(--line-strong);
    background: linear-gradient(160deg, rgba(23, 34, 64, .82), var(--panel));
    backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 40px 80px -30px rgba(0, 0, 0, .7);
    animation: auth-rise .6s cubic-bezier(.2, .8, .2, 1) both;
}
.auth-card::before {
    content: ''; position: absolute; top: -1px; left: 12%; right: 12%; height: 2px; border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent-2), transparent);
}
@keyframes auth-rise { from { opacity: 0; transform: translateY(16px) scale(.985); } }
.auth-copy { margin: 0; color: var(--faint); font-size: 12px; text-align: center; }

/* ── Card content ───────────────────────────────────────────────────── */
.auth-head { margin-bottom: 26px; }
.auth-badge {
    display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 20px; border-radius: 18px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff;
    box-shadow: 0 16px 34px -12px var(--accent-ring), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.auth-badge .auth-icon { width: 26px; height: 26px; }
.auth-badge.is-success { background: linear-gradient(135deg, #34d399, #10b981); box-shadow: 0 16px 34px -12px rgba(16, 185, 129, .45); }
.auth-badge.is-warning { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.auth-title { margin: 0; font: 700 28px/1.2 'Outfit', sans-serif; letter-spacing: -.02em; }
.auth-sub { margin: 10px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.auth-sub strong { color: var(--text); }

.auth-form { display: grid; gap: 18px; }
.auth-field { display: grid; gap: 8px; }
.auth-label-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.auth-label { font-size: 13px; font-weight: 600; color: #c9d5ee; }
.auth-link-sm { font-size: 12.5px; font-weight: 600; color: var(--accent); transition: opacity .2s; }
.auth-link-sm:hover { opacity: .8; text-decoration: underline; text-underline-offset: 3px; }
.auth-control { position: relative; }
.auth-control > .auth-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; transition: color .2s; }
.auth-input {
    width: 100%; height: 54px; padding: 0 16px 0 46px;
    border-radius: 15px; border: 1px solid var(--line-strong); background: var(--field);
    color: var(--text); font: 500 15px/1 'Plus Jakarta Sans', sans-serif;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.auth-input.has-toggle { padding-right: 52px; }
.auth-input::placeholder { color: #5b6b8c; }
.auth-input:hover { border-color: rgba(148, 178, 255, .36); }
.auth-input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); background: rgba(6, 13, 30, .9); }
.auth-control:focus-within > .auth-icon { color: var(--accent); }
.auth-input:disabled { opacity: .5; cursor: not-allowed; }
.auth-input:-webkit-autofill { -webkit-text-fill-color: var(--text); -webkit-box-shadow: 0 0 0 1000px #0a1428 inset; caret-color: var(--text); }
.auth-toggle {
    position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 11px;
    background: transparent; color: var(--faint); cursor: pointer; transition: color .2s, background .2s;
}
.auth-toggle:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.auth-toggle .auth-icon:last-child { display: none; }
.auth-toggle.is-on .auth-icon:first-child { display: none; }
.auth-toggle.is-on .auth-icon:last-child { display: block; }

.auth-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; height: 54px; padding: 0 22px; border: 0; border-radius: 15px; cursor: pointer;
    font: 700 15px/1 'Plus Jakarta Sans', sans-serif; letter-spacing: .01em; color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 14px 30px -12px var(--accent-ring), inset 0 1px 0 rgba(255, 255, 255, .25);
    transition: transform .2s, box-shadow .2s, filter .2s, opacity .2s;
    overflow: hidden;
}
.auth-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.07); box-shadow: 0 18px 36px -12px var(--accent-ring), inset 0 1px 0 rgba(255, 255, 255, .25); }
.auth-btn:active:not(:disabled) { transform: translateY(0); }
.auth-btn:focus-visible { outline: 0; box-shadow: 0 0 0 4px var(--accent-soft); }
.auth-btn:disabled { cursor: not-allowed; opacity: .55; filter: grayscale(.25); }
.auth-btn .auth-icon { transition: transform .2s; }
.auth-btn:hover:not(:disabled) .auth-icon { transform: translateX(3px); }
.auth-btn-ghost {
    background: rgba(255, 255, 255, .03); color: var(--text); border: 1px solid var(--line-strong); box-shadow: none;
}
.auth-btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .06); box-shadow: none; filter: none; }
.auth-btn-ghost:hover:not(:disabled) .auth-icon { transform: rotate(-30deg); }
form.is-loading .auth-btn[type="submit"] { color: transparent; pointer-events: none; }
form.is-loading .auth-btn[type="submit"]::after {
    content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: auth-spin .7s linear infinite;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-alert {
    display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; padding: 13px 15px;
    border-radius: 14px; border: 1px solid; font-size: 13.5px; line-height: 1.55;
}
.auth-alert .auth-icon { margin-top: 1px; }
.auth-alert-error { color: #fecaca; background: rgba(239, 68, 68, .1); border-color: rgba(248, 113, 113, .3); }
.auth-alert-success { color: #a7f3d0; background: rgba(16, 185, 129, .1); border-color: rgba(52, 211, 153, .3); }
.auth-alert-info { color: #c7d2fe; background: rgba(99, 102, 241, .1); border-color: rgba(129, 140, 248, .28); }
.auth-alert-warning { color: #fde68a; background: rgba(245, 158, 11, .1); border-color: rgba(251, 191, 36, .3); }

.auth-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 0; color: var(--faint); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.auth-foot { margin: 18px 0 0; text-align: center; color: var(--muted); font-size: 13px; }
.auth-foot a { color: var(--accent); font-weight: 700; }
.auth-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
.auth-back { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 600; transition: color .2s; }
.auth-back:hover { color: var(--text); }
.auth-back .auth-icon { width: 16px; height: 16px; }

/* Checklist / steps */
.auth-rules { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.auth-rules li { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 12.5px; transition: color .2s; }
.auth-rules li::before { content: ''; width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid currentColor; }
.auth-rules li.is-ok { color: #6ee7b7; }
.auth-rules li.is-ok::before { border-color: #34d399; background: #34d399 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23052e1f' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-9'/%3E%3C/svg%3E") center/11px no-repeat; }
.auth-meter { height: 6px; border-radius: 6px; background: rgba(148, 178, 255, .12); overflow: hidden; }
.auth-meter span { display: block; height: 100%; width: 0; border-radius: 6px; background: #ef4444; transition: width .3s, background .3s; }

.auth-steps { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 12px; }
.auth-steps li { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.auth-steps b {
    display: grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px; border-radius: 9px;
    background: var(--accent-soft); color: var(--accent); font-size: 12.5px;
}
.auth-recipient {
    display: flex; align-items: center; gap: 12px; margin-bottom: 20px; padding: 14px 16px; border-radius: 16px;
    border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .03);
}
.auth-recipient .auth-feature-icon { flex-shrink: 0; }
.auth-recipient small { display: block; color: var(--faint); font-size: 11.5px; }
.auth-recipient strong { display: block; margin-top: 2px; font-size: 14.5px; word-break: break-all; }
.auth-countdown { font-variant-numeric: tabular-nums; }
.auth-hint { margin: 12px 0 0; color: var(--faint); font-size: 12.5px; line-height: 1.6; text-align: center; }
.auth-hint a { color: var(--accent); font-weight: 600; }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 960px) {
    .auth-shell { grid-template-columns: 1fr; gap: 0; padding: 24px 16px 28px; max-width: 520px; }
    .auth-side { min-height: 0; padding: 0 4px 22px; align-items: center; }
    .auth-side-body, .auth-side-foot { display: none; }
    .auth-card { padding: 30px 22px 26px; border-radius: 24px; }
    .auth-title { font-size: 24px; }
}
@media (max-width: 380px) {
    .auth-rules { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .auth-orb, .auth-card { animation: none; }
    .auth-page * { transition: none !important; }
}

/* ── SweetAlert toast (login messages) ──────────────────────────────── */
.swal2-container .swal2-popup.auth-toast {
    width: min(440px, calc(100vw - 32px));
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--line-strong, rgba(148, 178, 255, .26));
    background: rgba(13, 22, 43, .96);
    color: #eef4ff;
    box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .8);
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}
.swal2-popup.auth-toast .swal2-title { color: #eef4ff; font-size: 13.5px; font-weight: 600; line-height: 1.5; margin: 0 4px; }
.swal2-popup.auth-toast .swal2-close { color: #93a3c4; }
.swal2-popup.auth-toast .swal2-close:hover { color: #fff; }
.swal2-popup.auth-toast .swal2-timer-progress-bar { background: var(--accent, #22d3ee); }

/* ── Official logo (replaces icon marks) ────────────────────────────── */
.auth-brand-logo {
    width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
    box-shadow: 0 0 0 2px var(--accent-ring), 0 10px 30px -8px var(--accent-ring);
}
.auth-logo {
    display: block; width: 56px; height: 56px; margin-bottom: 20px; border-radius: 50%; object-fit: cover;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .08), 0 0 0 5px var(--accent-ring), 0 16px 34px -12px var(--accent-ring);
}
@media (max-width: 960px) {
    /* The brand row above the card already shows the logo on small screens. */
    .auth-card .auth-logo { display: none; }
}

/* ── Desktop: login & password pages fit one screen (no vertical scroll) ── */
@media (min-width: 961px) {
    .auth-page { height: 100svh; overflow-y: auto; }
    .auth-shell { min-height: 0; height: 100svh; min-height: 560px; padding: clamp(12px, 3vh, 32px) 28px; }
    .auth-side { min-height: 0; height: 100%; max-height: 640px; padding: 0; }
    .auth-side-body { margin: clamp(12px, 3vh, 40px) 0; }
    .auth-eyebrow { padding: clamp(5px, .8vh, 7px) 12px; }
    .auth-side-title { margin: clamp(10px, 2.2vh, 22px) 0 clamp(8px, 1.6vh, 16px); font-size: clamp(30px, min(3.6vw, 6.2vh), 50px); }
    .auth-side-lead { font-size: clamp(13.5px, 2vh, 15px); line-height: 1.65; }
    .auth-features { margin-top: clamp(12px, 3vh, 32px); gap: clamp(6px, 1.2vh, 12px); }
    .auth-features li { padding: clamp(8px, 1.4vh, 14px) 16px; }
    .auth-feature-icon { width: clamp(32px, 4.8vh, 38px); height: clamp(32px, 4.8vh, 38px); }
    .auth-main { gap: clamp(8px, 1.6vh, 18px); }
    .auth-card { padding: clamp(20px, 3.6vh, 40px) clamp(26px, 2.6vw, 38px) clamp(18px, 3.2vh, 34px); }
    .auth-head { margin-bottom: clamp(12px, 2.4vh, 26px); }
    .auth-logo, .auth-badge { width: clamp(44px, 7vh, 56px); height: clamp(44px, 7vh, 56px); margin-bottom: clamp(10px, 2vh, 20px); }
    .auth-title { font-size: clamp(22px, 3.6vh, 28px); }
    .auth-sub { margin-top: clamp(4px, 1vh, 10px); font-size: clamp(13px, 1.9vh, 14px); }
    .auth-form { gap: clamp(12px, 2vh, 18px); }
    .auth-input, .auth-btn { height: clamp(44px, 6.6vh, 54px); }
    .auth-alert { margin-bottom: clamp(10px, 2vh, 20px); }
    .auth-divider { margin-top: clamp(12px, 2.4vh, 24px); }
    .auth-foot { margin-top: clamp(8px, 1.6vh, 18px); }
    .auth-steps { margin-bottom: clamp(12px, 2.2vh, 22px); gap: clamp(8px, 1.4vh, 12px); }
    .auth-recipient { margin-bottom: clamp(12px, 2vh, 20px); padding: clamp(10px, 1.6vh, 14px) 16px; }
}
/* Very short desktop screens: drop the decorative extras first */
@media (min-width: 961px) and (max-height: 660px) {
    .auth-features small, .auth-side-foot { display: none; }
}
