/* Genidom auth pages (login / register / forgot password) — white, centered, calm.
   Palette mirrors landing.css: dark ink on light surfaces, blue accents. */

:root {
    --au-ink: #0f172a;
    --au-ink-soft: #475569;
    --au-ink-mute: #64748b;
    --au-accent: #2563eb;
    --au-accent-deep: #1d4ed8;
    --au-accent-2: #0ea5e9;
    --au-line: rgba(15, 23, 42, 0.08);
    --au-line-strong: rgba(15, 23, 42, 0.16);
    --au-blue-50: #eff6ff;
    --au-blue-100: #dbeafe;
    --au-danger: #b91c1c;
    --au-danger-border: #fecaca;
    --au-danger-bg: #fef2f2;
}

body.auth {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    color: var(--au-ink);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* brand stripe across the very top */
body.auth::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--au-accent), var(--au-accent-2));
    z-index: 10;
}

/* ---- Top bar ---- */
.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.15rem clamp(1rem, 4vw, 2.5rem) 0.25rem;
}

.auth-brand img { display: block; height: 40px; width: auto; }

.auth-lang { display: inline-flex; gap: 0.45rem; color: var(--au-ink-soft); font-size: 0.9rem; }
.auth-lang a { color: inherit; text-decoration: none; font-weight: 500; }
.auth-lang a:hover { color: var(--au-ink); }
.auth-lang a.active { color: var(--au-accent); font-weight: 700; }

/* ---- Centered main ---- */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(0.75rem, 3vw, 2rem) 1rem 3rem;
}

.auth-panel {
    width: 100%;
    max-width: var(--au-width, 28rem);
    text-align: center;
}

.auth-figure { margin-bottom: 0.25rem; }
.auth-figure svg { width: min(320px, 86%); height: auto; }

.auth-title {
    font-size: clamp(1.55rem, 4vw, 1.9rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0.5rem 0 0.4rem;
}

.auth-sub {
    color: var(--au-ink-soft);
    font-size: 0.98rem;
    line-height: 1.55;
    max-width: 34rem;
    margin: 0 auto 1.6rem;
}

/* localized messages may carry inline links (e.g. "click here to log in") */
.auth-sub a { color: var(--au-accent); font-weight: 600; text-decoration: none; }
.auth-sub a:hover { color: var(--au-accent-deep); text-decoration: underline; }

/* ---- Card ---- */
.auth-card {
    background: #ffffff;
    border: 1px solid var(--au-line);
    border-radius: 1.25rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    padding: clamp(1.4rem, 4vw, 2rem);
    text-align: left;
}

/* ---- Form sections (register) ---- */
.auth-section-head {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    margin-bottom: 1.1rem;
}

.auth-section-icon {
    flex: 0 0 auto;
    width: 2.3rem;
    height: 2.3rem;
    display: grid;
    place-items: center;
    border-radius: 0.7rem;
    font-size: 1.1rem;
    color: var(--au-accent);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(14, 165, 233, 0.12));
}

.auth-section-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; margin: 0.1rem 0 0.2rem; }
.auth-section-desc { color: var(--au-ink-soft); font-size: 0.88rem; line-height: 1.5; margin: 0; }
.auth-card-divider { border: 0; border-top: 1px solid var(--au-line); margin: 1.6rem 0; opacity: 1; }

/* ---- Inputs ---- */
.auth-card .form-control {
    border-radius: 0.7rem;
    border-color: var(--au-line-strong);
    color: var(--au-ink);
}

.auth-card .form-control:focus {
    border-color: var(--au-accent);
    box-shadow: 0 0 0 0.22rem rgba(37, 99, 235, 0.13);
}

.auth-card .form-floating > label { color: var(--au-ink-mute); }
.auth-hint { color: var(--au-ink-mute); font-size: 0.82rem; margin: 0.35rem 0.25rem 0; }

.auth-card .form-check-input:checked { background-color: var(--au-accent); border-color: var(--au-accent); }
.auth-card .form-check-input:focus { border-color: var(--au-accent); box-shadow: 0 0 0 0.22rem rgba(37, 99, 235, 0.13); }
.auth-card .form-check-label { color: var(--au-ink-soft); font-size: 0.92rem; }

/* ---- Password visibility toggle ---- */
.auth-pass-wrap { position: relative; }
.auth-pass-wrap > .form-control { padding-right: 3.1rem; }

.auth-pass-toggle {
    position: absolute;
    top: 0.68rem;
    right: 0.6rem;
    width: 2.25rem;
    height: 2.25rem;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--au-ink-mute);
    font-size: 1.05rem;
    transition: color 0.15s ease, background 0.15s ease;
}

.auth-pass-toggle:hover,
.auth-pass-toggle:focus-visible { color: var(--au-accent); background: var(--au-blue-50); }

/* ---- Remember-me / forgot-password row ---- */
.auth-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ---- Primary button ---- */
.btn-auth {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 0;
    border-radius: 999px;
    padding: 0.78rem 1.6rem;
    font-weight: 600;
    font-size: 1rem;
    color: #ffffff;
    background: var(--au-accent);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.3);
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
}

.btn-auth:hover {
    background: var(--au-accent-deep);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.36);
}

.btn-auth:focus-visible { outline: 3px solid rgba(37, 99, 235, 0.35); outline-offset: 2px; }
.btn-auth .bi { font-size: 1.05rem; transition: transform 0.15s ease; }
.btn-auth:hover .bi { transform: translateX(3px); }
.btn-auth-inline { width: auto; padding-inline: 2.1rem; }

/* ---- Links ---- */
.auth-link { color: var(--au-accent); font-weight: 600; text-decoration: none; }
.auth-link:hover { color: var(--au-accent-deep); text-decoration: underline; }
.auth-link-sm { font-size: 0.9rem; }
.auth-link-muted { color: var(--au-ink-mute); text-decoration: none; }
.auth-link-muted:hover { color: var(--au-accent); text-decoration: underline; }

.auth-alt { margin: 1.4rem 0 0; color: var(--au-ink-soft); font-size: 0.95rem; }
.auth-alt-sm { margin-top: 0.55rem; font-size: 0.85rem; }

/* ---- Validation ---- */
.auth-validation { display: none; }

.auth-validation.validation-summary-errors {
    display: block;
    background: var(--au-danger-bg);
    border: 1px solid var(--au-danger-border);
    color: var(--au-danger);
    border-radius: 0.75rem;
    padding: 0.7rem 0.95rem;
    margin-bottom: 1rem;
    font-size: 0.92rem;
}

.auth-validation ul { margin: 0; padding: 0; list-style: none; }

.auth-card .field-validation-error {
    display: block;
    color: var(--au-danger);
    font-size: 0.84rem;
    margin: 0.3rem 0.25rem 0;
}

.auth-card .input-validation-error { border-color: #dc2626; }
.auth-card .input-validation-error:focus { border-color: #dc2626; box-shadow: 0 0 0 0.22rem rgba(220, 38, 38, 0.12); }

/* ---- Footer ---- */
.auth-footer {
    padding: 1.1rem 1rem 1.4rem;
    text-align: center;
    color: var(--au-ink-mute);
    font-size: 0.85rem;
}

/* ---- Entrance animation (staggered) ---- */
@keyframes auth-up {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

.auth-stagger > * { opacity: 0; animation: auth-up 0.55s cubic-bezier(0.22, 0.7, 0.3, 1) forwards; }
.auth-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.auth-stagger > *:nth-child(2) { animation-delay: 0.13s; }
.auth-stagger > *:nth-child(3) { animation-delay: 0.21s; }
.auth-stagger > *:nth-child(4) { animation-delay: 0.29s; }
.auth-stagger > *:nth-child(5) { animation-delay: 0.37s; }
.auth-stagger > *:nth-child(6) { animation-delay: 0.45s; }

/* ---- Illustration effects ----
   .ill-draw requires pathLength="1" on the element (solid strokes only —
   the dasharray trick would override a dashed stroke pattern). */
@keyframes ill-draw { to { stroke-dashoffset: 0; } }

.ill-draw {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: ill-draw 1.1s ease-out forwards;
    animation-delay: var(--d, 0s);
}

@keyframes ill-fade { to { opacity: 1; } }
.ill-fade { opacity: 0; animation: ill-fade 0.7s ease forwards; animation-delay: var(--d, 0.45s); }

@keyframes ill-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.ill-float { animation: ill-float 3.8s ease-in-out infinite; }

@keyframes ill-sway {
    0%, 100% { transform: rotate(1.5deg); }
    50% { transform: rotate(-1.5deg); }
}

.ill-sway { animation: ill-sway 4.5s ease-in-out infinite; transform-box: view-box; }

@media (prefers-reduced-motion: reduce) {
    .auth-stagger > *, .ill-fade { animation: none; opacity: 1; }
    .ill-draw { animation: none; stroke-dashoffset: 0; }
    .ill-float, .ill-sway { animation: none; }
    .btn-auth, .btn-auth .bi, .auth-pass-toggle { transition: none; }
    .btn-auth:hover { transform: none; }
    .btn-auth:hover .bi { transform: none; }
}

@media (max-width: 575.98px) {
    .auth-card { border-radius: 1rem; }
    .auth-figure svg { width: 80%; }
}
