/* ============================================================
   train/login.php — sign-in + landing page
   Dotted page; every component floats on a borderless frosted-glass
   block that softens the dots behind its text.
   Story blocks on the left, sign-in block on the right (first on phones).
   Loaded only by login.php, so it does not touch train.css.
   ============================================================ */
:root {
    --brand-red:     #d1320d;
    --brand-red-d:   #922309;
    --brand-blue:    #005786;
    --blue-soft:     #99bccf;
    --blue-tint:     #e6eef3;
    --red-tint:      #faebe7;
    --ink:           #0f172a;
    --ink-soft:      #475569;
    --grey:          #676767;
    --page:          #f6f7f9;

    --glass:         rgba(255,255,255,.34);
    --glass-strong:  rgba(255,255,255,.55);
    --glass-field:   rgba(255,255,255,.92);
    --glass-blur:    blur(1.6px) saturate(130%);
    --glass-shadow:  0 10px 30px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.03);

    --font-display:  'Abril Fatface', Georgia, serif;
    --font-body:     'Lato', Arial, Helvetica, sans-serif;

    --r-block: 22px; --r-inner: 14px; --r-field: 10px;
    color-scheme: light;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px; line-height: 1.55; color: var(--ink);
    -webkit-font-smoothing: antialiased;

    /* ---- Signature dotted background (unchanged) ---- */
    background-color: var(--page);
    background-image:
        radial-gradient(var(--brand-red) 0.8px, transparent 0.8px),
        radial-gradient(var(--brand-blue) 0.8px, transparent 0.8px);
    background-position: 0 0, 8px 8px;
    background-size: 16px 16px;
}
a { color: var(--brand-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid rgba(0,87,134,.35); outline-offset: 2px; }

/* ---------- The glass block: no border, blurred dots behind ---------- */
.glass {
    background: var(--glass);
    -webkit-backdrop-filter: var(--glass-blur);
    backdrop-filter: var(--glass-blur);
    border: 0;
    border-radius: var(--r-block);
    box-shadow: var(--glass-shadow);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .glass { background: rgba(255,255,255,.8); }
}

/* ---------- Layout ---------- */
.wrap {
    width: 100%; max-width: 1240px; margin: 0 auto;
    padding: 28px 28px 20px;
    display: grid; grid-template-columns: minmax(0,1fr) 420px; gap: 28px;
    align-items: start;
}
.story { display: grid; gap: 16px; min-width: 0; }

/* Block 1: brand + headline */
.hero { padding: 26px 30px 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--brand-blue); margin-bottom: 22px; }
.brand:hover { text-decoration: none; }
.brand svg { width: 42px; height: 42px; flex: none; }
.brand b { display: block; font-size: 19px; font-weight: 900; line-height: 1.1; letter-spacing: -.2px; }
.brand b i { font-style: normal; color: var(--brand-red); }
.brand small { display: block; font-size: 13px; font-weight: 700; color: var(--grey); }
.hero h1 {
    font-family: var(--font-display); font-weight: 400;
    font-size: clamp(34px, 3.8vw, 48px); line-height: 1.08; letter-spacing: -.3px;
    margin: 0 0 12px; text-wrap: balance;
}
.hero h1 .hl { color: var(--brand-blue); }
.hero h1 .hl-red { color: var(--brand-red); }
.hero p { margin: 0; font-size: 17px; color: var(--ink-soft); max-width: 58ch; }

/* Block 2: batch lifecycle */
.route { padding: 18px 26px 12px; }
.block-label {
    margin: 0 0 6px; font-size: 12px; font-weight: 900; letter-spacing: 1.2px;
    text-transform: uppercase; color: var(--grey);
}
.route svg { width: 100%; max-width: 540px; height: auto; display: block; overflow: visible; }
.route .track { fill: none; stroke: var(--blue-soft); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; opacity: .4; }
.route .line  { fill: none; stroke: var(--brand-blue); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
                stroke-dasharray: 1200; stroke-dashoffset: 0; animation: draw 2.2s .3s ease-out backwards; }
.route .node  { fill: #ffffff; stroke: var(--brand-blue); stroke-width: 3; }
.route .goal  { fill: var(--brand-red); stroke: #ffffff; stroke-width: 4; }
.route .ring  { fill: none; stroke: var(--brand-red); stroke-width: 2; opacity: .35; }
.route .lbl   { font-family: var(--font-body); font-size: 16px; font-weight: 900; fill: var(--ink); }
.route .sub   { font-family: var(--font-body); font-size: 13px; font-weight: 700; fill: var(--grey); }
@keyframes draw { from { stroke-dashoffset: 1200; } }
@media (prefers-reduced-motion: reduce) { .route .line { animation: none; } }
.route-steps { display: none; list-style: none; margin: 0; padding: 0; flex-wrap: wrap; gap: 6px; }
.route-steps li { font-size: 13px; font-weight: 900; padding: 5px 10px; border-radius: 999px; background: var(--glass-field); color: var(--brand-blue); }
.route-steps li:not(:last-child)::after { content: " →"; color: var(--grey); font-weight: 700; }
.route-steps li.goal { background: var(--brand-red); color: #ffffff; }

/* Block 3: modules */
.modules { padding: 18px 20px 20px; }
.modules .block-label { padding-left: 6px; }
.mod-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px; }
.mod { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: var(--r-inner); transition: background .2s; }
.mod:hover { background: var(--glass-strong); }
.mod .ic {
    flex: 0 0 34px; width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--blue-tint); color: var(--brand-blue);
}
.mod.red .ic { background: var(--red-tint); color: var(--brand-red); }
.mod b { display: block; font-size: 15px; font-weight: 900; }
.mod span { display: block; font-size: 13px; line-height: 1.4; color: var(--ink-soft); }

/* ---------- Right: sign-in block ---------- */
.auth { padding: 30px 30px 26px; background: var(--glass-strong); }
.auth-head { margin-bottom: 22px; padding-left: 14px; border-left: 4px solid var(--brand-red); }
.auth-head .kicker { font-size: 12px; font-weight: 900; letter-spacing: 1.2px; text-transform: uppercase; color: var(--brand-blue); }
.auth-head h2 { margin: 4px 0 4px; font-size: 28px; font-weight: 900; }
.auth-head p { margin: 0; font-size: 15px; color: var(--ink-soft); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.input {
    display: flex; align-items: center; gap: 10px; padding: 0 12px;
    background: var(--glass-field); border-radius: var(--r-field);
    box-shadow: inset 0 0 0 1px rgba(15,23,42,.08);
    transition: box-shadow .15s;
}
.input:focus-within { box-shadow: inset 0 0 0 1.5px var(--brand-blue), 0 0 0 3px rgba(0,87,134,.15); }
.input svg { flex: 0 0 18px; color: var(--grey); }
.input input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 16px; padding: 12px 0; color: var(--ink); }
.input input::placeholder { color: #94a3b8; }
.reveal { border: 0; background: transparent; font: inherit; font-size: 13px; font-weight: 700; color: var(--brand-blue); cursor: pointer; padding: 6px 4px; }
.forgot { display: flex; justify-content: flex-end; margin: -4px 0 18px; font-size: 14px; font-weight: 700; }
.btn-primary {
    width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    background: linear-gradient(90deg, #005786, #d1320d); color: #ffffff;
    padding: 13px 24px; border: 0; border-radius: 25px;
    font: inherit; font-size: 16px; font-weight: 700; cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,.18); transition: transform .2s, box-shadow .2s;
}
.btn-primary::after { content: "→"; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0,0,0,.22); }
.auth-alert { display: none; background: var(--red-tint); color: #b91c1c; padding: 10px 14px; border-radius: var(--r-field); font-size: 14px; margin-bottom: 14px; }
.auth-alert.show { display: block; }
.auth-alert.success { background: #e6f0eb; color: #046937; }
.btn-primary[disabled] { opacity: .75; cursor: progress; transform: none; }
.btn-primary .spin {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.45); border-top-color: #ffffff;
    animation: spin .7s linear infinite;
}
.btn-primary .spin[hidden] { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.roles { margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(15,23,42,.07); font-size: 13px; color: var(--ink-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-weight: 700; font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--blue-tint); color: var(--brand-blue); }

.side { display: grid; gap: 12px; position: sticky; top: 24px; }
.note { padding: 12px 18px; font-size: 13px; color: var(--ink-soft); border-radius: 16px; }
.note b { color: var(--ink); }

/* ---------- Footer ---------- */
.foot { max-width: 1240px; margin: 0 auto; padding: 4px 28px 24px; display: flex; justify-content: center; }
.foot .glass { padding: 6px 16px; border-radius: 999px; font-size: 13px; color: var(--grey); }

/* ---------- Responsive ---------- */
@media (max-width: 1023px) {
    .wrap { grid-template-columns: minmax(0,1fr); }
    .side { order: -1; position: static; max-width: 480px; width: 100%; margin: 0 auto; }
}
@media (max-width: 640px) {
    .wrap { padding: 16px 16px 12px; gap: 16px; }
    .story { gap: 12px; }
    .hero { padding: 22px 20px; }
    .auth { padding: 26px 20px 22px; }
    .route { padding: 16px 18px; }
    .route svg { display: none; }
    .route-steps { display: flex; }
    .mod-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .mod { flex-direction: column; gap: 8px; }
    .foot { padding: 0 16px 20px; }
}

/* ---------- Extra card pieces for forgot / reset / invite ---------- */
[hidden] { display: none !important; }
.hint { display: block; margin-top: 6px; font-size: 13px; color: var(--ink-soft); }
.input.otp input { letter-spacing: 8px; font-size: 20px; font-weight: 700; text-align: center; }
.card-link { margin: 18px 0 0; text-align: center; font-size: 14px; font-weight: 700; color: var(--grey); }
