:root {
    --auth-bg: #f8fafc;
    --auth-surface: #ffffff;
    --auth-accent: #e74c3c;
    --auth-text: #0f172a;
    --auth-muted: #64748b;
    --auth-border: #e2e8f0;
    --auth-blue: #2563eb;
    --auth-radius: 16px;
}

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

body.auth-page {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    color: var(--auth-text);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
}

.auth-page-inner {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    margin: auto;
    padding: 24px 16px;
    box-sizing: border-box;
}

.auth-bg-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, black, transparent);
}

.auth-shell {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

@media (max-width: 520px) {
    body.auth-page {
        padding: 16px 12px;
    }
}

.auth-brand {
    text-align: center;
    margin-bottom: 24px;
}
.auth-brand a {
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.04em;
    color: var(--auth-text);
    text-decoration: none;
}
/* a márkajel (a favikon fejjel) a felirat fölött */
.auth-brand .auth-brand-mark { display: block; width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 16px; box-shadow: 0 8px 24px rgba(2, 19, 49, 0.28); }
.auth-brand p {
    margin: 8px 0 0;
    font-size: 0.9rem;
    color: var(--auth-muted);
}

.auth-card {
    border: 1px solid var(--auth-border);
    border-radius: 20px;
    padding: 28px 24px 32px;
}
.auth-card--wide { max-width: 560px; margin: 0 auto; }
.auth-card--narrow { max-width: 420px; margin: 0 auto; }

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 24px;
    padding: 4px;
    border-radius: 12px;
}
.auth-tab {
    border: none;
    background: transparent;
    padding: 10px 12px;
    border-radius: 10px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--auth-muted);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.auth-tab.is-active {
    background: #fff;
    color: var(--auth-text);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.auth-panel { display: none; }
.auth-panel.is-active { display: block; }

.auth-field { margin-bottom: 16px; }
.auth-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--auth-text);
}
.auth-field input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    font: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-field-hint {
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--auth-muted);
}

.auth-captcha-box {
    padding: 14px;
    background: #f8fafc;
    border: 1px dashed var(--auth-border);
    border-radius: 12px;
    margin-bottom: 16px;
}
.auth-captcha-box label { font-weight: 700; font-size: 0.85rem; }
.auth-captcha-q {
    font-size: 1.1rem;
    font-weight: 800;
    margin: 8px 0 10px;
    color: var(--auth-accent);
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}
.auth-btn--ghost {
    background: transparent;
    color: var(--auth-muted);
    border: 1px solid var(--auth-border);
    margin-top: 10px;
}

.auth-alert {
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.88rem;
    margin-bottom: 16px;
    line-height: 1.45;
}
.auth-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.auth-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.auth-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.auth-links {
    margin-top: 20px;
    text-align: center;
    font-size: 0.88rem;
}
.auth-links a {
    color: var(--auth-blue);
    font-weight: 600;
    text-decoration: none;
}
.auth-links a:hover { color: var(--auth-accent); text-decoration: underline; }

/* Jelszó emlékeztető szekciók */
.auth-reminder-page .auth-page-inner,
.auth-reminder-page .auth-shell { max-width: 640px; }

.auth-reminder-page .auth-page-inner {
    width: 100%;
}
.auth-section {
    margin-bottom: 20px;
    padding: 22px 20px;
    border: 1px solid var(--auth-border);
    border-radius: 16px;
    background: #fafbfc;
}
.auth-section:last-of-type { margin-bottom: 0; }
.auth-section h2 {
    margin: 0 0 6px;
    font-size: 1.05rem;
    font-weight: 800;
}
.auth-section > p {
    margin: 0 0 16px;
    font-size: 0.88rem;
    color: var(--auth-muted);
    line-height: 1.5;
}
.auth-section form { margin: 0; }

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 20px;
    color: var(--auth-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
}
.auth-back:hover { color: var(--auth-accent); }

/* Elfelejtett adatok (jelszo-emlekezteto) */
.auth-recovery-lead {
    margin: 0 0 20px;
    font-size: 0.92rem;
    color: var(--auth-muted);
    line-height: 1.55;
}

.auth-recovery-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.auth-recovery-form .auth-field {
    margin-bottom: 20px;
}

.auth-recovery-options {
    margin: 0 0 28px;
    padding: 18px 20px;
    border: 1px solid var(--auth-border);
    border-radius: 14px;
    background: #fafbfc;
}

.auth-recovery-options legend {
    padding: 0 6px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--auth-text);
}

.auth-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 0;
    padding: 12px 0;
    cursor: pointer;
}

.auth-check + .auth-check {
    border-top: 1px solid var(--auth-border);
}

.auth-check input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--auth-blue);
    cursor: pointer;
}

.auth-check__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.4;
}

.auth-check__text strong {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--auth-text);
}

.auth-check__text small {
    font-size: 0.82rem;
    color: var(--auth-muted);
}

.auth-recovery-form .auth-btn--primary {
    margin-top: 4px;
    width: 100%;
}

html[data-theme="dark"] body.auth-page {
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(231, 76, 60, 0.15), transparent),
        var(--auth-bg);
    color: var(--auth-text);
}

html[data-theme="dark"] .auth-brand a {
    color: var(--auth-text);
}

html[data-theme="dark"] .auth-card {
    background: var(--auth-surface);
    border-color: var(--auth-border);
}

html[data-theme="dark"] .auth-tab.is-active {
    background: #334155;
    color: #f1f5f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] .auth-tab:not(.is-active) {
    color: var(--auth-muted);
}

html[data-theme="dark"] .auth-field label {
    color: var(--auth-text);
}

html[data-theme="dark"] .auth-field input {
    background: rgba(15, 23, 42, 0.45);
    border-color: var(--auth-border);
    color: var(--auth-text);
}

html[data-theme="dark"] .auth-field input::placeholder {
    color: #64748b;
}

html[data-theme="dark"] .auth-btn--ghost {
    color: var(--auth-muted);
    border-color: var(--auth-border);
}

html[data-theme="dark"] .auth-captcha-box,
html[data-theme="dark"] .auth-section,
html[data-theme="dark"] .auth-recovery-options {
    background: rgba(15, 23, 42, 0.45);
    border-color: var(--auth-border);
}

html[data-theme="dark"] .auth-error {
    background: rgba(127, 29, 29, 0.35);
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.45);
}

html[data-theme="dark"] .auth-success {
    background: rgba(22, 101, 52, 0.35);
    color: #bbf7d0;
    border-color: rgba(74, 222, 128, 0.35);
}

html[data-theme="dark"] .auth-info {
    background: rgba(30, 64, 175, 0.35);
    color: #bfdbfe;
    border-color: rgba(96, 165, 250, 0.35);
}

html[data-theme="dark"] .auth-links a {
    color: #7dd3fc;
}

html[data-theme="dark"] .auth-links a:hover {
    color: var(--auth-accent);
}

/* ===== Mentőatlasz paletta (mint a főoldalon): éjkék tinta, azúr kiemelés, piros pont a logón ===== */
html:root {
    --auth-bg: #eef3f9;
    --auth-surface: #ffffff;
    --auth-accent: #1b6ea8;
    --auth-text: #0d1a2d;
    --auth-muted: #566a85;
    --auth-border: #c5d3e6;
    --auth-blue: #1b6ea8;
}
html[data-theme="dark"]:root {
    --auth-bg: #0d1a2d;
    --auth-surface: #12233c;
    --auth-accent: #6bbbe8;
    --auth-text: #e4edf9;
    --auth-muted: #93a9c6;
    --auth-border: #2a4570;
    --auth-blue: #6bbbe8;
}
body.auth-page {
    background:
        radial-gradient(ellipse 80% 50% at 50% -20%, color-mix(in srgb, var(--auth-accent) 16%, transparent), transparent),
        radial-gradient(ellipse 60% 40% at 100% 90%, color-mix(in srgb, var(--auth-accent) 9%, transparent), transparent),
        var(--auth-bg);
}
html:not([data-theme="dark"]) .auth-bg-grid {
    background-image:
        linear-gradient(color-mix(in srgb, var(--auth-accent) 14%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--auth-accent) 14%, transparent) 1px, transparent 1px);
}
html[data-theme="dark"] .auth-bg-grid {
    background-image:
        linear-gradient(color-mix(in srgb, var(--auth-accent) 12%, transparent) 1px, transparent 1px),
        linear-gradient(90deg, color-mix(in srgb, var(--auth-accent) 12%, transparent) 1px, transparent 1px);
}
.auth-brand .dot { color: #d60102; }
html[data-theme="dark"] .auth-brand .dot { color: #ff4a4a; }
.auth-field input:focus { border-color: color-mix(in srgb, var(--auth-accent) 55%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--auth-accent) 16%, transparent); }
.auth-btn--primary { background: color-mix(in srgb, var(--auth-accent) 62%, #08202a); color: #fff; }
.auth-btn--primary:hover { background: var(--auth-accent); }
html[data-theme="dark"] .auth-btn--primary { background: color-mix(in srgb, var(--auth-accent) 38%, #0a1416); color: #e6f5f3; }
html[data-theme="dark"] .auth-btn--primary:hover { background: color-mix(in srgb, var(--auth-accent) 55%, #0a1416); color: #fff; }
.auth-card { background: color-mix(in srgb, var(--auth-surface) 86%, transparent); -webkit-backdrop-filter: blur(14px) saturate(1.5); backdrop-filter: blur(14px) saturate(1.5); box-shadow: inset 0 1px 1px rgba(255,255,255,.8), 0 16px 48px color-mix(in srgb, var(--auth-accent) 12%, transparent); }
html[data-theme="dark"] .auth-card { box-shadow: inset 0 1px 1px rgba(160,240,230,.14), 0 16px 48px rgba(0,0,0,.4); }

/* Bejelentkezés ↔ Regisztráció váltó: csúszó jelölő (mint a leckék részeinél) */
.auth-tabs { position: relative; background: color-mix(in srgb, var(--auth-accent) 8%, transparent); isolation: isolate; }
html[data-theme="dark"] .auth-tabs { background: color-mix(in srgb, var(--auth-accent) 10%, transparent); }
.auth-tab-ind {
    position: absolute; z-index: 0; top: 0; left: 0; width: 0; height: 0; border-radius: 10px; pointer-events: none; opacity: 0;
    background: var(--auth-surface); box-shadow: 0 2px 10px color-mix(in srgb, var(--auth-accent) 18%, transparent), inset 0 0 0 1px color-mix(in srgb, var(--auth-accent) 28%, transparent);
}
.auth-tabs.ind-ready .auth-tab-ind { opacity: 1; }
.auth-tabs.ind-anim .auth-tab-ind { transition: left .38s cubic-bezier(.34, 1.25, .5, 1), width .38s cubic-bezier(.34, 1.25, .5, 1), top .2s ease, height .2s ease; }
.auth-tabs .auth-tab { position: relative; z-index: 1; }
.auth-tabs .auth-tab.is-active, html[data-theme="dark"] .auth-tabs .auth-tab.is-active { background: transparent; box-shadow: none; color: var(--auth-accent); }
html[data-theme="dark"] .auth-tabs .auth-tab:not(.is-active) { color: var(--auth-muted); }
.auth-tabs .auth-tab:not(.is-active):hover { color: var(--auth-text); }
.auth-panel.is-active { animation: auth-panel-in .34s cubic-bezier(.22, .8, .25, 1); }
@keyframes auth-panel-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .auth-tabs.ind-anim .auth-tab-ind, .auth-panel.is-active { animation: none; transition: none; } }

/* Nyilvános bemutatkozó szöveg a bejelentkezési oldalon (a keresők és az érdeklődők számára) */
.auth-brand h1.auth-tagline { margin: 8px 0 0; font-size: 0.9rem; line-height: 1.4; color: var(--auth-muted); letter-spacing: 0; }
.auth-about { margin-top: 22px; padding: 18px 20px; border: 1px solid var(--auth-border); border-radius: 16px; background: color-mix(in srgb, var(--auth-surface) 70%, transparent); color: var(--auth-muted); font-size: 0.86rem; line-height: 1.6; }
.auth-about h2 { margin: 0 0 8px; font-size: 0.98rem; color: var(--auth-text); }
.auth-about p { margin: 0 0 10px; }
.auth-about ul { margin: 0 0 10px; padding-left: 1.1em; }
.auth-about li { margin: 0 0 4px; }
.auth-about strong { color: var(--auth-text); }

/* Bejelentkezés ↔ Regisztráció váltás: a kártya felülről igazodik, így a fülek nem mozdulnak el; a magasság lágyan változik */
body.auth-login .auth-page-inner { align-items: flex-start; padding-top: clamp(24px, 9vh, 88px); }
.auth-panels.is-animating { overflow: hidden; transition: height .32s cubic-bezier(.22, .8, .25, 1); }
@media (prefers-reduced-motion: reduce) { .auth-panels.is-animating { transition: none; } }

/* iPhone Safari: a rögzített rács ne érjen véget éles határral alul */
.auth-bg-grid { bottom: -40vh; }
