/* ============================================================
   graVITas 2026 — Shared Auth Pages Stylesheet
   Used by: login.html, register.html, forgotPassword.html
   ============================================================ */

:root {
    --gv-header-h: 54px;
    --gv-footer-h: 40px;
}

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

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Fixed Header ── */
.gv-header {
    position: fixed; top: 0; left: 0; right: 0; height: var(--gv-header-h);
    background: #003566; display: flex; align-items: center;
    justify-content: space-between; padding: 0 20px;
    z-index: 1000; border-bottom: 1px solid rgba(255,255,255,0.07);
}
.gv-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.gv-brand-logo { width: 34px; height: 34px; background: #fff; border-radius: 7px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gv-brand-logo img { width: 26px; height: 26px; object-fit: contain; }
.gv-brand-name { font-size: 15px; font-weight: 700; color: #fff; letter-spacing: 0.01em; }
.gv-brand-name span { color: #facc15; }
.gv-header-center {
    position: absolute; left: 50%; transform: translateX(-50%);
    font-size: 13.5px; font-weight: 600; color: rgba(255,255,255,0.88);
    white-space: nowrap; letter-spacing: 0.03em; text-transform: uppercase;
    max-width: 45vw; overflow: hidden; text-overflow: ellipsis;
}
.gv-header-right { font-size: 11.5px; color: rgba(255,255,255,0.4); flex-shrink: 0; }

/* ── Fixed Footer ── */
.gv-footer {
    position: fixed; bottom: 0; left: 0; right: 0; height: var(--gv-footer-h);
    background: #003566; display: flex; align-items: center;
    justify-content: center; z-index: 1000;
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 0 12px; text-align: center;
}
.gv-footer p { font-size: 12px; color: rgba(255,255,255,0.45); margin: 0; }
.gv-footer p span { color: rgba(255,255,255,0.65); }

/* ── Page wrapper (fills space between fixed header & footer) ──
   - min-height (not height) so tall content is never force-cropped.
   - padding-top/bottom exactly matches header/footer height, so the
     card is guaranteed to start below the header and end above the
     footer — no overlap on any page.
   - `align-items: center` then `align-items: safe center` is a
     progressive enhancement: browsers that understand `safe` will
     vertically center the card whenever it fits, and automatically
     fall back to top-alignment (scrollable, non-clipping) the moment
     the card is taller than the available space — which is exactly
     what fixes the "register card hidden behind header/footer" bug,
     for both the short login/forgot-password cards AND the tall
     registration card, with one shared rule.
   - `100dvh` (where supported) keeps mobile browsers' collapsing
     address bar from causing a jump/clip on load.
*/
.gv-page-signin,
.gv-page {
    min-height: 100vh;
    background: #f0f4f8;
    display: flex;
    justify-content: center;
    align-items: center;
    align-items: safe center;
    overflow-y: auto;
    padding: calc(var(--gv-header-h) + 24px) 16px calc(var(--gv-footer-h) + 16px);
}
@supports (height: 100dvh) {
    .gv-page-signin,
    .gv-page {
        min-height: 100dvh;
    }
}

/* ── Card ── */
.gv-card { width: 100%; max-width: 460px; background: #fff; border: 1px solid #dde3ec; border-radius: 14px; overflow: hidden; flex-shrink: 0; margin: 0 auto; }
.gv-card.wide { max-width: 1000px; width: 100%; margin-top: 20px; margin-bottom: 20px; }

.gv-card-top { background: #003566; padding: 10px 20px !important; display: flex; align-items: center; gap: 14px; }
.gv-card-top-icon { width: 40px; height: 40px; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.15); border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 19px; color: #facc15; flex-shrink: 0; }
.gv-card-top h3 { font-size: 15px; font-weight: 700; color: #fff; margin: 0 0 3px; }
.gv-card-top p { font-size: 12px; color: rgba(255,255,255,0.5); margin: 0; }
.gv-card-body { padding: 24px 26px; }

/* ── Alerts ── */
.gv-alert { display: flex; align-items: center; gap: 10px; border-radius: 8px; padding: 11px 14px; margin-bottom: 18px; font-size: 13px; font-weight: 500; }
.gv-alert.danger  { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.gv-alert.success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.gv-alert i { font-size: 16px; flex-shrink: 0; }

/* ── Fields ── */
.gv-field { margin-bottom: 12px; }
.gv-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 6px; }
.gv-label i { font-size: 14px; color: #94a3b8; }
.gv-label .req { color: #ef4444; }

.gv-input-wrap { position: relative; }
.gv-input-wrap input,
.gv-input-wrap select,
.gv-input-wrap textarea {
    width: 100%; padding: 9px 13px; font-size: 13.5px;
    border: 1px solid #e2e8f0; border-radius: 8px;
    background: #fff; color: #1e293b;
    transition: border-color .15s, box-shadow .15s;
    appearance: none;
}
.gv-input-wrap input:hover, .gv-input-wrap select:hover { border-color: #cbd5e1; }
.gv-input-wrap input:focus, .gv-input-wrap select:focus {
    outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.gv-input-wrap input.is-invalid, .gv-input-wrap select.is-invalid { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.1); }
.gv-input-wrap input[type="password"] { padding-right: 42px; }

/* Select arrow */
.gv-input-wrap select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}

.gv-err { display: none; align-items: center; gap: 5px; font-size: 11.5px; color: #dc2626; margin-top: 5px; }
.gv-err i { font-size: 13px; }

/* Eye toggle */
.gv-eye { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: #94a3b8; font-size: 17px; padding: 2px; line-height: 1; transition: color .12s; }
.gv-eye:hover { color: #475569; }

/* ── CAPTCHA ── */
.captcha-box { border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.captcha-display { background: #f8fafc; padding: 0 14px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e2e8f0; flex-wrap: wrap; }
.captcha-code { font-size: 22px; font-weight: 700; letter-spacing: 8px; color: #1e293b; font-family: 'Courier New', monospace; user-select: none; text-decoration: line-through; text-decoration-color: rgba(0,0,0,0.18); }
.captcha-refresh { background: none; border: none; cursor: pointer; color: #64748b; font-size: 18px; padding: 5px; border-radius: 6px; line-height: 1; transition: background .12s, color .12s; }
.captcha-refresh:hover { background: #e2e8f0; color: #0d1b3e; }
.captcha-input { display: block; width: 100%; padding: 10px 13px; font-size: 13.5px; border: none; background: #fff; color: #1e293b; transition: box-shadow .15s; }
.captcha-input:focus { outline: none; box-shadow: 0 0 0 2px #2563eb inset; }
.captcha-input::placeholder { color: #94a3b8; }

/* ── Physically-challenged / wheelchair toggle block ── */
.pc-toggle { display: none; margin-top: 14px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 14px 16px; }
.pc-toggle.visible { display: block; }
.pc-toggle-label { font-size: 12.5px; font-weight: 600; color: #475569; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.pc-toggle-label i { color: #94a3b8; }
.radio-group { display: flex; gap: 16px; flex-wrap: wrap; }
.radio-item { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.radio-item input[type="radio"] { width: 16px; height: 16px; accent-color: #0d1b3e; cursor: pointer; }
.radio-item label { font-size: 13px; color: #334155; cursor: pointer; margin: 0; }

/* ── Section divider ── */
.section-divider { display: flex; align-items: center; gap: 10px; margin: 20px 0 16px; }
.section-divider span { font-size: 11px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.07em; white-space: nowrap; }
.section-divider::before, .section-divider::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }

/* ── Buttons ── */
.gv-btn { width: 100%; padding: 5px; background: #003566; color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px; transition: background .15s; }
.gv-btn:hover  { background: #1a3a6b; }
.gv-btn:active { transform: scale(.98); }
.gv-btn i { font-size: 17px; }
.gv-btn-outline { background: transparent; color: #0d1b3e; border: 1.5px solid #0d1b3e; }
.gv-btn-outline:hover { background: #f1f5f9; }

/* ── Links row ── */
.gv-links { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid #f1f5f9; flex-wrap: wrap; gap: 8px; }
.gv-link { font-size: 12.5px; color: #2563eb; text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: color .12s; background: none; border: none; padding: 0; }
.gv-link:hover { color: #1d4ed8; text-decoration: underline; }
.gv-link i { font-size: 14px; }

/* ── Card strip (footer note inside card) ── */
.gv-card-strip {
    padding: 12px 26px;
    text-align: center;
    background: #f8fafc;
}

/* ── Registration grid ── */
.reg-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 25px; }

/* ============================================================
   RESPONSIVE BREAKPOINTS
   Mobile:        ≤ 575.98px
   Tablet/small laptop: 576px – 991.98px
   Laptop:        992px – 1199.98px
   Desktop:       1200px – 1399.98px
   Large desktop: ≥ 1400px
   ============================================================ */

/* ── Tablet / small laptop: 3-col grid → 2-col, avoids the squeeze ── */
@media (min-width: 576px) and (max-width: 991.98px) {
    .reg-grid { grid-template-columns: 1fr 1fr; }
    .gv-card.wide { max-width: 92vw; }
}

/* ── Laptop: keep 3 columns but constrain wide card so it doesn't
   run edge-to-edge on 13"-14" screens ── */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .gv-card.wide { max-width: 900px; }
}

/* ── Desktop ── */
@media (min-width: 1200px) and (max-width: 1399.98px) {
    .gv-card.wide { max-width: 1000px; }
}

/* ── Large desktop ── */
@media (min-width: 1400px) {
    .gv-card.wide { max-width: 1080px; }
}

/* ── Mobile ── */
@media (max-width: 575.98px) {
    .reg-grid { grid-template-columns: 1fr; }
    .gv-header-right { display: none; }
    .gv-header-center { font-size: 11.5px; max-width: 55vw; }

    .gv-page,
    .gv-page-signin {
        padding: calc(var(--gv-header-h) + 12px) 12px calc(var(--gv-footer-h) + 12px);
    }

    .gv-card,
    .gv-card.wide {
        max-width: 100%;
        margin-top: 0;
        margin-bottom: 0;
    }

    .gv-card-body { padding: 18px 16px; }
    .gv-card-top { padding: 10px 16px; }

    .captcha-display { flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px 14px; }
    .radio-group { gap: 10px; }
}

/* ── Extra-small phones ── */
@media (max-width: 380px) {
    .gv-card-top h1 { font-size: 15px; }
    .gv-card-top-icon { width: 34px; height: 34px; font-size: 16px; }
}

/* ── Short viewports (landscape phones, short laptop browser windows) ──
   Height-based, independent of width: compact the card's internal
   spacing so it's more likely to fit without needing to scroll past
   the fixed header/footer. */
@media (max-height: 700px) {
    .gv-page,
    .gv-page-signin {
        padding: calc(var(--gv-header-h) + 10px) 16px calc(var(--gv-footer-h) + 10px);
    }
    .gv-card-top { padding: 10px 22px; }
    .gv-card-top-icon { width: 32px; height: 32px; font-size: 16px; }
    .gv-card-top h1 { font-size: 15px; margin-bottom: 1px; }
    .gv-card-top p { display: none; }
    .gv-card-body { padding: 14px 22px; }
    .gv-field { margin-bottom: 10px; }
    .gv-alert { padding: 8px 12px; margin-bottom: 12px; }
    .captcha-display { padding: 6px 12px; }
    .gv-links { margin-top: 10px; padding-top: 10px; }
}
