/* ── Reset & Variables ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* ── DIG Brand Kit Colors ─────────────────────────────────────────────── */
    /* Use these names when you want a specific brand color directly.          */
    /* Example: color: var(--color-dig-red);                                   */
    --color-deep-midnight:  #091528;
    --color-navy-surface:   #1b2f4e;
    --color-slate-grey:     #475569;
    --color-dig-red:        #c01b39;
    --color-safety-red:     #dc2526;
    --color-aerospace-red:  #e63311;
    --color-sky-blue:       #392f60;
    --color-white:          #ffffff;
    --color-black:          #000000;

    /* ── Additional Brand Colors ──────────────────────────────────────────── */
    --color-success-green: #1a6f3c;
    --color-warning-gold:  #c8952a;

    /* ── Semantic UI Colors (mapped to brand kit) ─────────────────────────── */
    /* Change the brand color here and it updates everywhere it's used.        */
    --primary:       var(--color-sky-blue);
    --primary-hover: #4a3d78;
    --accent:        var(--color-dig-red);
    --success:       var(--color-success-green);
    --warning:       var(--color-warning-gold);
    --bg:            #f2f5fa;
    --card:          var(--color-white);
    --border:        #d8dfe9;
    --text:          var(--color-navy-surface);
    --muted:         var(--color-slate-grey);
    --radius:        12px;
    --shadow:        0 1px 3px rgba(0,0,0,.07), 0 4px 14px rgba(0,0,0,.06);

    /* ── Gray Scale Utilities ─────────────────────────────────────────────── */
    --gray-50:  #f8f9fa;
    --gray-400: #9ba3ae;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── Site header (shared across all DiG apps) ────────────────────────────── */
.site-header {
    background: var(--primary);
    color: var(--color-white);
    padding: 0 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header .header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.header-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.header-dig-logo  { height: 28px; width: auto; }
.header-dig-name  { font-size: 1.1rem; font-weight: 800; color: var(--accent); letter-spacing: -.02em; }
.header-office    { font-size: .95rem; font-weight: 500; color: rgba(255,255,255,.9); }
.header-app-sep   { color: rgba(255,255,255,.4); font-size: 16px; margin: 0 4px 0 0; }
.header-logo      { font-size: 22px; }
.header-title     { font-size: 17px; font-weight: 600; letter-spacing: .01em; color: var(--color-white); }
.header-nav { display: flex; align-items: center; gap: 6px; }
.header-nav a {
    color: rgba(255,255,255,.8);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: var(--radius);
    font-size: 14px;
    transition: background .15s, color .15s;
}
.header-nav a:hover, .header-nav a.active {
    background: rgba(255,255,255,.15);
    color: var(--color-white);
}
.header-nav .nav-logout { color: rgba(255,255,255,.55); }
.header-nav .nav-logout:hover { color: #ff9999; background: rgba(255,0,0,.1); }
.header-nav .nav-user { color: rgba(255,255,255,.7); font-size: 13px; padding: 6px 10px; pointer-events: none; }

/* ── Legacy portal header ────────────────────────────────────────────────── */
header {
    background: var(--primary);
    padding: 0 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    display: flex;
    align-items: center;
    gap: .6rem;
}
.logo-img {
    height: 36px;
    width: auto;
}
.logo-dig {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -.02em;
}
.logo-text {
    font-size: 1rem;
    font-weight: 500;
    color: rgba(255,255,255,.9);
}
.header-user {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.user-name {
    color: rgba(255,255,255,.8);
    font-size: .9rem;
}
.btn-signout {
    color: var(--accent);
    text-decoration: none;
    font-size: .85rem;
    border: 1px solid var(--accent);
    padding: .3rem .75rem;
    border-radius: 6px;
    transition: background .15s, color .15s;
}
.btn-signout:hover {
    background: var(--accent);
    color: var(--primary);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
footer {
    text-align: center;
    padding: 1.25rem 1rem;
    font-size: .8rem;
    background: var(--color-dig-red);
    color: var(--color-white);
    margin-top: auto;
}
footer a {
    color: var(--color-white);
    text-decoration: underline;
}
footer a:hover {
    opacity: .8;
}

/* ── Login page ──────────────────────────────────────────────────────────── */
body.login-page {
    justify-content: center;
    align-items: center;
    gap: 0;
}
body.login-page footer {
    position: fixed;
    bottom: 0;
    width: 100%;
}
.login-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}
.login-logo h1 {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    margin-top: .5rem;
}
.login-logo p {
    color: var(--muted);
    font-size: .9rem;
    margin-top: .2rem;
}
.logo-img-lg {
    height: 64px;
    width: auto;
}
.login-error {
    background: #fef2f2;
    border: 1px solid var(--color-safety-red);
    color: var(--color-dig-red);
    border-radius: 7px;
    padding: .65rem 1rem;
    font-size: .875rem;
    width: 100%;
}
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    width: 100%;
    padding: .7rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--color-white);
    color: var(--color-deep-midnight);
    text-decoration: none;
    font-size: .95rem;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    transition: box-shadow .15s, background .15s;
}
.btn-google:hover {
    background: #f8faff;
    box-shadow: 0 2px 8px rgba(0,0,0,.13);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    header { padding: 0 1rem; }
    .user-name { display: none; }
}

/* ── Dark mode ───────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    :root {
        --bg:     var(--color-deep-midnight);
        --card:   var(--color-navy-surface);
        --border: rgba(255,255,255,.12);
        --text:   var(--color-white);
        --muted:  #94a3b8;
    }

    footer {
        background: var(--color-safety-red);
    }

    .login-box .login-logo h1 {
        color: var(--color-white);
    }

    .logo-img-lg {
        content: url('/shared/images/nDIGov_FConeline_dark.png');
    }

    .login-error {
        background: rgba(220,37,38,.15);
        border-color: var(--color-safety-red);
    }

    .btn-google {
        background: var(--color-white);
        color: var(--color-deep-midnight);
        border-color: rgba(255,255,255,.2);
    }
    .btn-google:hover {
        background: #f0f0f0;
    }
}
