/* ==========================================================================
   O'so Distributor Portal — taproom-dark theme
   Palette: roasted malt blacks, pour-gold amber, copper, cream, hop green
   Type: Bebas Neue (display) + Inter (body)
   ========================================================================== */

:root {
    --malt-black: #1a1512;
    --malt-deep: #211a15;
    --malt-card: #2a221b;
    --malt-line: #3b3128;
    --pour-gold: #e9a126;
    --pour-gold-hi: #f5b942;
    --copper: #c0703a;
    --cream: #f4ebd9;
    --cream-dim: #c9bda6;
    --hop-green: #8a9256;
    --danger: #d96a4a;

    --font-display: "Bebas Neue", "Oswald", sans-serif;
    --font-body: "Inter", "Segoe UI", sans-serif;

    --radius: 10px;
}

html, body {
    background: var(--malt-black);
    color: var(--cream);
    font-family: var(--font-body);
    min-height: 100vh;
}

.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1;
    width: min(1180px, 100% - 3rem);
    margin-inline: auto;
    padding: 2.25rem 0 3.5rem;
}

h1, h2, h3, .display {
    font-family: var(--font-display);
    letter-spacing: 0.03em;
    color: var(--cream);
}

a { color: var(--pour-gold-hi); }
a:hover { color: var(--pour-gold); }

::selection { background: var(--pour-gold); color: var(--malt-black); }

h1:focus { outline: none; }

/* --------------------------------------------------------------------------
   Top bar + signature "pour line"
   -------------------------------------------------------------------------- */
.topbar {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 0.85rem 2rem;
    background: linear-gradient(180deg, #14100d 0%, var(--malt-deep) 100%);
    position: sticky;
    top: 0;
    z-index: 100;
}

.pour-line {
    height: 4px;
    background: linear-gradient(90deg,
        var(--copper) 0%,
        var(--pour-gold) 30%,
        var(--pour-gold-hi) 50%,
        var(--pour-gold) 70%,
        var(--copper) 100%);
    box-shadow: 0 1px 12px rgba(233, 161, 38, 0.45);
    position: sticky;
    top: 64px;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    flex-shrink: 0;
}

.brand-logo {
    display: block;
    height: 36px;
    width: auto;
    /* subtle glow so the cream ink sits comfortably on the malt background */
    filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.4));
}

.brand-mark {
    font-family: var(--font-display);
    font-size: 2rem;
    line-height: 1;
    color: var(--pour-gold);
    letter-spacing: 0.05em;
}

.brand-sub {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.28em;
    color: var(--cream-dim);
    border-left: 1px solid var(--malt-line);
    padding-left: 0.85rem;
    white-space: nowrap;
}

.main-nav {
    display: flex;
    gap: 0.25rem;
    flex: 1;
}

.nav-item {
    font-size: 0.82rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--cream-dim);
    text-decoration: none;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    transition: color 0.15s ease, background 0.15s ease;
}

.nav-item:hover { color: var(--cream); background: rgba(244, 235, 217, 0.06); }

.nav-item.active {
    color: var(--malt-black);
    background: var(--pour-gold);
}

.auth-area {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.auth-user {
    font-size: 0.8rem;
    color: var(--cream-dim);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn { border-radius: 999px; font-weight: 600; letter-spacing: 0.02em; }

.btn-amber {
    background: var(--pour-gold);
    border: 1px solid var(--pour-gold);
    color: var(--malt-black);
}
.btn-amber:hover, .btn-amber:focus {
    background: var(--pour-gold-hi);
    border-color: var(--pour-gold-hi);
    color: var(--malt-black);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--malt-line);
    color: var(--cream);
}
.btn-ghost:hover { border-color: var(--pour-gold); color: var(--pour-gold-hi); }

.btn-outline-danger { border-radius: 999px; }

/* --------------------------------------------------------------------------
   Hero (dashboard)
   -------------------------------------------------------------------------- */
.hero {
    padding: 3rem 2.5rem;
    border-radius: var(--radius);
    background:
        radial-gradient(1200px 400px at 15% -20%, rgba(233, 161, 38, 0.18), transparent 60%),
        linear-gradient(160deg, var(--malt-deep), var(--malt-card));
    border: 1px solid var(--malt-line);
    margin-bottom: 2rem;
}

.hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.72rem;
    color: var(--pour-gold);
    margin-bottom: 0.75rem;
}

.hero h1 {
    font-size: clamp(2.6rem, 6vw, 4.2rem);
    margin-bottom: 0.5rem;
}

.hero p { color: var(--cream-dim); max-width: 56ch; margin-bottom: 1.5rem; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }

.stat-card {
    background: var(--malt-card);
    border: 1px solid var(--malt-line);
    border-radius: var(--radius);
    padding: 1.1rem 1.3rem;
}

.stat-card .stat-value {
    font-family: var(--font-display);
    font-size: 2.4rem;
    color: var(--pour-gold-hi);
    line-height: 1;
}

.stat-card .stat-label {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.7rem;
    color: var(--cream-dim);
    margin-top: 0.35rem;
}

/* --------------------------------------------------------------------------
   Page headers, cards, panels
   -------------------------------------------------------------------------- */
.page-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-head h1 { font-size: 2.6rem; margin: 0; }

.page-head .page-sub { color: var(--cream-dim); font-size: 0.9rem; }

.panel {
    background: var(--malt-card);
    border: 1px solid var(--malt-line);
    border-radius: var(--radius);
    padding: 1.5rem;
}

/* ABV chip — little beer-label lozenge */
.abv-chip {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    color: var(--malt-black);
    background: var(--pour-gold);
    border-radius: 4px;
    padding: 0.05rem 0.5rem;
}

.badge-status {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.28rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--malt-line);
    color: var(--cream-dim);
}
.badge-status.draft { color: var(--cream-dim); }
.badge-status.submitted { color: var(--pour-gold-hi); border-color: var(--pour-gold); }
.badge-status.confirmed { color: var(--hop-green); border-color: var(--hop-green); }
.badge-status.shipped { color: var(--copper); border-color: var(--copper); }
.badge-status.delivered { color: var(--malt-black); background: var(--hop-green); border-color: var(--hop-green); }
.badge-status.cancelled { color: var(--danger); border-color: var(--danger); }

.text-muted-brand { color: var(--cream-dim); }

/* --------------------------------------------------------------------------
   QuickGrid + tables
   -------------------------------------------------------------------------- */
::deep table, table.quickgrid, .quickgrid > table, table {
    color: var(--cream);
}

.grid-wrap { overflow-x: auto; }

.grid-wrap table {
    width: 100%;
    border-collapse: collapse;
    background: var(--malt-card);
    border: 1px solid var(--malt-line);
    border-radius: var(--radius);
    overflow: hidden;
}

.grid-wrap thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--pour-gold);
    background: var(--malt-deep);
    padding: 0.8rem 1rem;
    border-bottom: 2px solid var(--pour-gold);
    white-space: nowrap;
}

.grid-wrap tbody td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--malt-line);
    font-size: 0.9rem;
    vertical-align: middle;
}

.grid-wrap tbody tr:hover { background: rgba(233, 161, 38, 0.06); }

.grid-wrap .col-options-button, .grid-wrap button.col-title {
    color: inherit;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-control, .form-select {
    background: var(--malt-deep);
    border: 1px solid var(--malt-line);
    color: var(--cream);
    border-radius: 8px;
}

.form-control:focus, .form-select:focus {
    background: var(--malt-deep);
    color: var(--cream);
    border-color: var(--pour-gold);
    box-shadow: 0 0 0 0.2rem rgba(233, 161, 38, 0.2);
}

.form-control::placeholder { color: #7a6f5c; }

.form-floating > label { color: #9a8f7b; }
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--pour-gold);
}
.form-floating > .form-control:focus ~ label::after,
.form-floating > .form-control:not(:placeholder-shown) ~ label::after {
    background: transparent;
}

.form-label { color: var(--cream-dim); font-size: 0.85rem; }

.form-check-input:checked { background-color: var(--pour-gold); border-color: var(--pour-gold); }

.validation-message, .text-danger { color: var(--danger) !important; }

/* --------------------------------------------------------------------------
   Auth pages
   -------------------------------------------------------------------------- */
.auth-shell {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

.auth-card {
    width: min(440px, 100%);
    background: var(--malt-card);
    border: 1px solid var(--malt-line);
    border-top: 4px solid var(--pour-gold);
    border-radius: var(--radius);
    padding: 2.25rem 2rem;
}

.auth-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.3em;
    font-size: 0.68rem;
    color: var(--pour-gold);
    margin-bottom: 0.5rem;
}

.auth-title { font-size: 2.4rem; margin-bottom: 0.25rem; }
.auth-sub { color: var(--cream-dim); font-size: 0.9rem; margin-bottom: 1.5rem; }
.auth-alt { margin-top: 1.25rem; font-size: 0.85rem; color: var(--cream-dim); }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1.25rem 2rem;
    border-top: 1px solid var(--malt-line);
    color: var(--cream-dim);
    font-size: 0.82rem;
}

.footer-tag {
    font-family: var(--font-display);
    letter-spacing: 0.12em;
    font-size: 1.05rem;
    color: var(--pour-gold);
}

/* --------------------------------------------------------------------------
   Blazor error UI
   -------------------------------------------------------------------------- */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    color: #333;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

/* --------------------------------------------------------------------------
   Small screens / reduced motion
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
    .topbar { flex-wrap: wrap; gap: 0.75rem; padding: 0.75rem 1rem; }
    .main-nav { order: 3; width: 100%; overflow-x: auto; }
    .pour-line { top: auto; position: static; }
    .site-main { width: calc(100% - 2rem); }
    .brand-logo { height: 28px; }
    .brand-sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
