/* ==========================================================
   IT Asset Portal — Navy / Gold visual language
   (matches the Bin Dhaen Capex Approval Form's design system)
   ========================================================== */

:root {
    --navy-950: #0a1628;
    --navy-900: #0e1d33;
    --navy-800: #142640;
    --navy-700: #1c3455;
    --navy-600: #2a4570;
    --gold-600: #b3903f;
    --gold-500: #c9a84c;
    --gold-400: #d9bf72;
    --gold-100: #f7f0dc;

    --ink: #1c2430;
    --ink-soft: #4a5568;
    --ink-faint: #8a94a3;

    --bg: #f5f6f8;
    --card-bg: #ffffff;
    --border: #e2e5ea;
    --border-soft: #edeff2;
    --locked-bg: #f0f1f4;

    --error: #b3402f;
    --success: #2f7a4f;

    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 7px;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

/* The `hidden` attribute must always win, even on elements whose own
   class sets `display: flex/grid/block` (e.g. the signature mode
   panels) - author CSS normally beats the browser's default
   `[hidden]{display:none}` UA rule regardless of specificity, which
   would otherwise leave every signature panel visible at once. */
[hidden] { display: none !important; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--navy-700); }

/* ---------- Brand mark ---------- */

.brand { display: flex; align-items: center; gap: 12px; }

.brand__mark {
    display: block;
    height: 40px;
    width: auto;
    flex-shrink: 0;
}

.brand__text { display: flex; flex-direction: column; }

.brand__group {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 17px;
    color: #f4f1ea;
    letter-spacing: 0.2px;
}

.brand__system {
    font-size: 11px;
    color: #93a1b8;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

/* ---------- Top bar ---------- */

.topbar {
    background: linear-gradient(135deg, var(--navy-950), var(--navy-800));
    border-bottom: 3px solid var(--gold-500);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 32px;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.topbar-nav a {
    color: var(--gold-400);
    text-decoration: none;
    font-weight: 600;
    font-size: 13.5px;
}

.topbar-nav a:hover { text-decoration: underline; }

.topbar-nav a.active {
    color: #f4f1ea;
    border-bottom: 2px solid var(--gold-400);
    padding-bottom: 2px;
}

.topbar-nav a.topbar-logout {
    color: #cbd3e0;
    font-weight: 600;
    padding: 7px 14px;
    border: 1.5px solid rgba(203, 211, 224, 0.35);
    border-radius: 999px;
    transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.topbar-nav a.topbar-logout:hover {
    text-decoration: none;
    color: #fff;
    border-color: var(--gold-400);
    background: rgba(201, 168, 76, 0.12);
}

/* ---------- Auth pages (login / verify) ---------- */

.login-body {
    background: linear-gradient(135deg, var(--navy-950), var(--navy-800));
    min-height: 100vh;
    margin: 0;
}

.login-main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
}

.auth-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(10, 22, 40, 0.35);
    padding: 40px 36px;
    width: 100%;
    max-width: 400px;
    margin: 0;
}

.auth-card .brand { margin-bottom: 28px; }
.auth-card .brand__group { color: var(--navy-950); }
.auth-card .brand__system { color: var(--ink-faint); }

.auth-card h1 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 24px;
    color: var(--navy-950);
    margin: 0 0 8px;
}

.auth-card > p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.auth-card strong { color: var(--navy-800); }

form { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }

label { font-size: 13px; font-weight: 600; color: var(--navy-800); }

.field { display: flex; flex-direction: column; gap: 7px; margin: 16px 0; }
.field label { margin: 0; }

.btn-text {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    font-family: var(--font-body);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--ink-faint);
    cursor: pointer;
    text-decoration: underline;
}

.btn-text:hover { color: var(--error); box-shadow: none; }

input, select {
    font-family: var(--font-body);
    font-size: 14.5px;
    color: var(--ink);
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 13px;
    width: 100%;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--gold-500);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.18);
}

select {
    appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%234a5568' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* ---------- Custom select (JS-enhanced; native <select> stays functional
   underneath for no-JS and for actual form submission) ---------- */

.custom-select {
    position: relative;
    width: 100%;
}

.custom-select__native {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    z-index: 1;
    /* Sits underneath .custom-select__trigger (z-index 2) so clicks reach
       the styled trigger, not this element - an absolutely positioned
       element paints above a static in-flow sibling regardless of DOM
       order, so without an explicit stacking order here this element
       silently intercepted every click on the trigger button beneath it.
       Still focusable/tabbable (not display:none), so keyboard and no-JS
       users get a real, working select. */
    cursor: pointer;
}

.custom-select__trigger {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 13px;
    font-family: var(--font-body);
    font-size: 14.5px;
    color: var(--ink);
    cursor: pointer;
    text-align: left;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.custom-select.is-open .custom-select__trigger,
.custom-select__native:focus + .custom-select__trigger {
    border-color: var(--gold-500);
    box-shadow: 0 0 0 3px rgba(201, 168, 76, 0.18);
}

.custom-select__chevron {
    flex-shrink: 0;
    width: 14px;
    height: 9px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%234a5568' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    transition: transform 0.15s ease;
}

.custom-select.is-open .custom-select__chevron { transform: rotate(180deg); }

.custom-select__list {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 20;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 28px rgba(10, 22, 40, 0.18);
    max-height: 240px;
    overflow-y: auto;
}

.custom-select__option {
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    color: var(--ink);
    cursor: pointer;
}

.custom-select__option:hover { background: var(--gold-100); }

.custom-select__option.is-selected {
    background: var(--navy-900);
    color: var(--gold-400);
    font-weight: 600;
}

#code {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 6px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

button, .btn {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--radius-sm);
    padding: 12px 24px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    background: linear-gradient(135deg, var(--navy-800), var(--navy-950));
    color: var(--gold-400);
    box-shadow: 0 2px 8px rgba(10, 22, 40, 0.25);
    transition: transform 0.1s ease, box-shadow 0.15s ease;
}

button:hover, .btn:hover { box-shadow: 0 4px 14px rgba(10, 22, 40, 0.32); }
button:active, .btn:active { transform: translateY(1px); }

.error {
    background: #fbe9e6;
    border: 1px solid var(--error);
    color: var(--error);
    font-size: 13px;
    font-weight: 500;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
}

.debug-hint {
    background: var(--gold-100);
    border: 1px solid var(--gold-500);
    color: var(--gold-600);
    font-size: 12.5px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    line-height: 1.5;
}

@media (max-width: 480px) {
    .auth-card { padding: 28px 22px; }
    .topbar { padding: 12px 16px; }
}
