/* =================================================================
   Sign in, sign up and account recovery (templates/auth_base.html).
   Builds on style.css: the island on a pale sky on the left (the hub's
   sky), the form on white on the right; the panel folds away on phones.
   ================================================================= */

body.auth-page { background: var(--paper); }

.auth { display: grid; grid-template-columns: minmax(380px, 46%) 1fr; min-height: 100svh; }

/* The art panel */
.auth__art {
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    height: 100svh;
    padding: 28px clamp(28px, 3.4vw, 48px) clamp(28px, 5vh, 48px);
    overflow: hidden;
    background:
        radial-gradient(70% 55% at 50% 42%, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 70%),
        linear-gradient(180deg, #EAF5FA 0%, #C3E3F0 55%, #95CDE2 100%);
    color: var(--ink);
    isolation: isolate;
}
.auth__art .brand__mark { height: 50px; }
.auth__art .brand__word { font-size: 24px; }
.auth__scene { position: relative; flex: 1; min-height: 240px; }
.auth__isle { position: absolute; left: 50%; top: 50%; width: min(70%, 360px); translate: -50% -55%; animation: authBob 7s var(--ease-io) infinite; filter: drop-shadow(0 30px 36px rgba(14, 50, 72, 0.28)); }
.auth__far { position: absolute; right: 8%; top: 14%; width: 18%; opacity: 0.55; filter: blur(1.5px) saturate(0.8); animation: authBob 9s var(--ease-io) infinite reverse; }
.auth__shadow { position: absolute; left: 50%; top: 78%; width: 40%; height: 5%; border-radius: 50%; translate: -50% 0; background: radial-gradient(closest-side, rgba(14, 50, 72, 0.3), transparent); animation: authShade 7s var(--ease-io) infinite; }
@keyframes authBob { 50% { transform: translateY(-14px); } }
@keyframes authShade { 50% { transform: scale(0.88); opacity: 0.7; } }
.auth__pitch { max-width: 440px; }
.auth__headline { margin: 0; font: 700 clamp(26px, 2.4vw, 34px)/1.12 var(--font-display); letter-spacing: -0.03em; text-wrap: balance; }
.auth__pitch ul { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; color: #3D5266; font-size: 15px; }
.auth__pitch li { display: flex; gap: 12px; align-items: baseline; }
.auth__pitch li i { color: var(--ok); font-size: 13px; }
.auth__pitch b { color: var(--ink); font-weight: 600; }

/* The form panel */
.auth__panel { display: flex; flex-direction: column; min-height: 100svh; padding: 22px clamp(24px, 4vw, 56px) 40px; }
.auth__top { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.auth__brand-small { display: none; margin-right: auto; }
.auth__back { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; color: var(--mute); font-size: 14px; font-weight: 500; text-decoration: none; transition: color 0.2s; }
.auth__back i { font-size: 12px; transition: transform 0.35s var(--ease); }
.auth__back:hover { color: var(--ink); }
.auth__back:hover i { transform: translateX(-3px); }
.auth__body { width: min(420px, 100%); margin: auto; padding: clamp(32px, 6vh, 56px) 0; animation: authIn 0.9s var(--ease) both; }
@keyframes authIn { from { opacity: 0; transform: translateY(14px); } }
.auth__body .flash-messages { width: 100%; }
/* Sign in | Join a class (partials/auth_tabs.html) */
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 28px; padding: 4px; border-radius: 12px; background: var(--canvas); box-shadow: inset 0 0 0 1px var(--line); }
.auth-tabs__tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; border-radius: 9px; color: var(--mute); font-size: 14.5px; font-weight: 600; text-decoration: none; transition: color 0.2s, background-color 0.2s, box-shadow 0.2s; }
.auth-tabs__tab i { font-size: 13px; }
.auth-tabs__tab:hover { color: var(--ink); }
.auth-tabs__tab.is-active { background: var(--paper); color: var(--ink); box-shadow: 0 1px 2px rgba(14, 26, 38, 0.08), 0 0 0 1px var(--line); }
.auth-tabs__tab.is-active i { color: var(--brand); }
.auth-tabs__tab:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Joining a class (templates/join_class.html) */
.join-form { margin-top: 24px; }
.join-code-chip { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 6px 6px 6px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); color: var(--mute); font-size: 13px; }
.join-code-chip code { color: var(--ink); font: 600 14px/1 var(--font-mono); letter-spacing: 0.06em; }
.join-code-chip a { padding: 5px 9px; border-radius: 7px; color: var(--brand); font-weight: 600; text-decoration: none; }
.join-code-chip a:hover { background: var(--paper); }
.join-code-input { font-family: var(--font-mono) !important; font-size: 18px !important; letter-spacing: 0.12em; text-transform: uppercase; }
.join-code-input::placeholder { letter-spacing: 0.12em; }
.form-hint { margin: 0; color: var(--mute); font-size: 13px; line-height: 1.5; }
.form-hint a { color: var(--brand); font-weight: 600; }
.join-form__legal { text-align: center; }
.auth-class-note { display: flex; gap: 10px; align-items: baseline; margin: 18px 0 0; padding: 11px 14px; border-radius: 11px; background: var(--canvas); color: var(--mute); font-size: 14px; line-height: 1.5; }
.auth-class-note i { color: var(--brand); font-size: 13px; }
.auth-class-note a { color: var(--brand); font-weight: 600; text-decoration: none; }
.auth-class-note a:hover { text-decoration: underline; }

.auth__title { margin: 0; font-size: clamp(28px, 2.6vw, 34px); line-height: 1.1; letter-spacing: -0.03em; }
.auth__subtitle { margin: 8px 0 0; color: var(--mute); font-size: 15.5px; line-height: 1.55; }

.social-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 28px; }
.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 46px;
    border: 1px solid var(--line-2);
    border-radius: 11px;
    background: var(--paper);
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.2s, background-color 0.2s, transform 0.4s var(--ease);
}
.social-btn:hover { border-color: #B6C1CB; background: #FAFBFC; }
.social-btn:active { transform: scale(0.98); }
.social-btn i { font-size: 16px; }

.or-divider { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: var(--mute); font-size: 13px; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.auth-form { display: grid; gap: 16px; }
.form-group { display: grid; gap: 6px; min-width: 0; }
.form-group label { color: var(--ink); font-size: 14px; font-weight: 600; }
.form-group__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.form-group__aside { color: var(--brand); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.form-group__aside:hover { color: var(--brand-hover); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.form-input,
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line-2);
    border-radius: 11px;
    background: var(--paper);
    color: var(--ink);
    font: 400 15.5px/1.2 var(--font-main);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:hover, .auth-form input:hover { border-color: #B6C1CB; }
.form-input:focus, .auth-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(10, 111, 163, 0.14); }
.form-input::placeholder, .auth-form input::placeholder { color: #8C98A4; }

.recaptcha-wrap { display: flex; justify-content: flex-start; min-height: 78px; }
.auth-submit { margin-top: 4px; }
.auth-submit:disabled, .auth-submit[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; box-shadow: none; }

.auth__links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; margin-top: 22px; font-size: 14.5px; }
.auth__links a { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); font-weight: 600; text-decoration: none; }
.auth__links a:hover { color: var(--brand-hover); }
.auth__links a i { font-size: 12px; }

/* What a new password needs (static/js/password-rules.js ticks them while typing) */
.password-rules { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--canvas); color: var(--mute); font-size: 13.5px; }
.password-rules__title { margin: 0 0 6px; color: var(--ink); font-weight: 600; }
.password-rules ul { display: grid; gap: 5px; margin: 0; padding: 0; list-style: none; }
.password-rules li { display: flex; align-items: center; gap: 9px; transition: color 0.2s; }
.password-rules li::before {
    content: "";
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: 1.5px solid #B6C1CB;
    border-radius: 50%;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    transition: background-color 0.2s, border-color 0.2s;
}
.password-rules li.is-ok { color: var(--ok); }
.password-rules li.is-ok::before { content: "✓"; border-color: var(--ok); background: var(--ok); }
.password-rules li.is-bad { color: var(--danger); }
.password-rules li.is-bad::before { content: "✕"; border-color: var(--danger); background: var(--danger); }
.password-rules__note { margin: 8px 0 0; font-size: 12.5px; line-height: 1.5; }

/* Phones and narrow windows: the art panel folds away, the logo moves above the form */
@media (max-width: 900px) {
    .auth { grid-template-columns: 1fr; }
    .auth__art { display: none; }
    .auth__brand-small { display: inline-flex; }
    .auth__back { display: none; }
    .auth__body { margin: 0 auto; padding-top: clamp(28px, 6vh, 48px); }
}
@media (max-width: 480px) {
    .auth-tabs__tab { font-size: 14px; }
    .auth-tabs__tab i { display: none; }
    .field-row { grid-template-columns: 1fr; }
    .social-buttons { grid-template-columns: 1fr; }
    .recaptcha-wrap { transform: scale(0.94); transform-origin: left top; }
}
