/* =====================================================================
   Vou ao Dragão — Reiman

   Design system matched to Reiman's existing "Performance Evaluation" app
   (clientmockups/filipe-marketing) so the two feel like siblings: gold
   #F5C200 on slate #1e293b, Inter, rounded corners, soft shadows.

   The brief's R-20 names #262626 / #F8CF0B; we align to the delivered
   Reiman apps instead (#1e293b slate + #F5C200 gold) at the client's
   request, for brand consistency across their tools. The two palettes are
   close cousins — a slightly warmer gold, a slate rather than pure charcoal.

   MOBILE FIRST (R-15): phones get a fixed bottom tab bar with 48px targets;
   desktop gets inline nav. Nothing scrolls horizontally.

   No build step (brief §7): plain CSS, custom properties, no preprocessor.
   ===================================================================== */

:root {
    --bg:            #f5f6f8;
    --surface:       #ffffff;
    --surface-2:     #fafbfc;
    --surface-3:     #f1f3f6;

    --border:        #e5e7eb;
    --border-strong: #d4d7dd;
    --line:          #e5e7eb;

    --text:          #1e293b;   /* Reiman slate */
    --text-2:        #475569;
    --muted:         #94a3b8;

    --gold:          #F5C200;   /* Reiman gold */
    --gold-2:        #FFD42E;
    --gold-ink:      #1e293b;   /* text ON gold */
    --gold-link:     #9A7800;
    --gold-weak:     #fdf6da;

    --navy:          #0B1120;   /* the dark hero surface */
    --navy-2:        #0f1729;

    --good:          #16a34a;  --good-bg: #e7f6ec;  --good-line: #bfe6cb;
    --warn:          #d97706;  --warn-bg: #fdf3e3;  --warn-line: #f3dcae;
    --bad:           #dc2626;  --bad-bg:  #fdeaea;  --bad-line:  #f3c4c4;

    --shadow-sm: 0 1px 2px rgba(16,22,32,.04), 0 1px 3px rgba(16,22,32,.06);
    --shadow-md: 0 4px 12px rgba(16,22,32,.06), 0 2px 6px rgba(16,22,32,.05);
    --shadow-lg: 0 18px 48px rgba(16,22,32,.14);

    --tap: 48px;
    --radius: 12px;
    --radius-sm: 10px;
    --wrap: 720px;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Back-compat aliases. The templates carry inline style="color:var(--ink)"
       etc. from the first (charcoal/hazard) palette; these map the old names
       onto the current Reiman slate/gold system so every inline reference
       still resolves. New code should use the canonical names above. */
    --ink:      var(--text);
    --yellow:   var(--gold);
    --muted-2:  var(--muted);
    --danger:   var(--bad);
    --paper:    var(--surface);
    --grey:     var(--surface-3);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(var(--tap) + 26px + env(safe-area-inset-bottom, 0px));
}

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p  { margin: 0 0 .85rem; }
a  { color: var(--gold-link); }

.label {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--muted);
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }

/* ---------------------------------------------------------------------
   Top bar — light surface, dark wordmark, matching the perf-eval app
   --------------------------------------------------------------------- */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 20;
}
.topbar__in {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand__logo { height: 28px; width: auto; display: block; }
.brand__sub {
    font-size: .72rem;
    color: var(--muted);
    font-weight: 600;
    padding-left: 10px;
    border-left: 1px solid var(--border);
}
.topbar__spacer { margin-left: auto; }
.topbar__who { font-size: .8rem; color: var(--text-2); font-weight: 500; }

.topnav { display: none; }

/* ---------------------------------------------------------------------
   Bottom tab bar (phones)
   --------------------------------------------------------------------- */
.tabbar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 30;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-shadow: 0 -2px 12px rgba(16,22,32,.05);
}
.tabbar a {
    flex: 1;
    min-height: var(--tap);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 7px 2px;
    text-decoration: none;
    color: var(--muted);
    font-size: .63rem;
    font-weight: 600;
    letter-spacing: .02em;
    position: relative;
}
.tabbar a.is-active { color: var(--text); }
.tabbar a.is-active::before {
    content: '';
    position: absolute;
    top: 0; left: 22%; right: 22%;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--gold);
}
.tabbar svg { width: 22px; height: 22px; stroke-width: 1.9; }
.tabbar a .dot {
    position: absolute;
    top: 7px;
    margin-left: 20px;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--bad);
    border: 2px solid var(--surface);
}

/* ---------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}
.card--flat { padding: 0; overflow: hidden; }
.card__pad { padding: 18px; }

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 24px 0 12px;
}
.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ---------------------------------------------------------------------
   THE PENDING CONFIRMATION  (brief §5)

   Impossible to miss: the one dark, gold-accented surface in an otherwise
   light interface, carrying the largest type on the page. Re-themed to the
   perf-eval app's navy dark-mode rather than hazard tape, so it reads as
   premium and urgent rather than as a warning strip.
   --------------------------------------------------------------------- */
.claim {
    position: relative;
    background:
        radial-gradient(700px 300px at 90% -20%, rgba(245,194,0,.16), transparent 60%),
        linear-gradient(160deg, var(--navy-2), var(--navy));
    color: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    margin: 16px 0 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(245,194,0,.25);
}
.claim__body { padding: 20px 18px 22px; }
.claim__kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 12px;
}
.claim__kicker::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 0 rgba(245,194,0,.6);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(245,194,0,.5); }
    70%  { box-shadow: 0 0 0 8px rgba(245,194,0,0); }
    100% { box-shadow: 0 0 0 0 rgba(245,194,0,0); }
}
.claim__match { font-size: 1.4rem; font-weight: 800; letter-spacing: -.02em; margin: 0 0 3px; }
.claim__when  { color: #b6c0d0; font-size: .9rem; margin-bottom: 18px; }

.countdown {
    display: flex;
    align-items: baseline;
    gap: 5px;
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1;
    margin-bottom: 6px;
}
.countdown__n {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.03em;
}
.countdown__u {
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #8593a8;
    margin-right: 8px;
}
.claim__deadline { font-size: .82rem; color: #8593a8; margin-bottom: 18px; }
.claim__deadline strong { color: #fff; font-weight: 600; }
.claim.is-urgent .countdown__n { color: var(--gold); }

/* ---------------------------------------------------------------------
   Buttons — gradient gold, matching perf-eval. All >= 48px tall (R-15).
   --------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: var(--tap);
    padding: 12px 20px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--surface-3);
    color: var(--text);
    font-family: inherit;
    font-size: .95rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    width: 100%;
    -webkit-appearance: none;
    transition: transform .15s, filter .15s, background .15s;
}
.btn + .btn { margin-top: 8px; }
.btn:active { transform: translateY(1px); }

.btn--primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-2));
    color: var(--gold-ink);
    box-shadow: 0 4px 12px rgba(245,194,0,.3);
}
.btn--primary:hover { filter: brightness(1.04); transform: translateY(-1px); }
.btn--dark { background: linear-gradient(160deg, var(--navy-2), var(--navy)); color: #fff; }
.btn--ghost { background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); }
.btn--ghost:hover { background: var(--surface-3); }
.btn--ghost-light { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.25); color: #fff; }
.btn--ghost-light:hover { background: rgba(255,255,255,.16); }
.btn--danger { background: transparent; border: 1px solid var(--bad); color: var(--bad); }
.btn--sm { min-height: 38px; padding: 7px 13px; font-size: .82rem; width: auto; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-row { display: flex; flex-direction: column; gap: 8px; }
.btn-row .btn + .btn { margin-top: 0; }

/* ---------------------------------------------------------------------
   Match list
   --------------------------------------------------------------------- */
.match {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 15px 16px;
    margin-bottom: 10px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .15s, transform .15s;
}
.match:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.match:active { background: var(--surface-3); }
.match__top { display: flex; align-items: flex-start; gap: 14px; }
.match__date {
    flex: 0 0 48px;
    text-align: center;
    background: var(--surface-3);
    border-radius: var(--radius-sm);
    padding: 8px 4px;
    line-height: 1.1;
}
.match__day  { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; }
.match__mon  { font-size: .6rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.match__main { flex: 1; min-width: 0; }
.match__opp  { font-weight: 700; font-size: 1.02rem; }
.match__meta { font-size: .8rem; color: var(--muted); }

/* ---------------------------------------------------------------------
   Status pills
   --------------------------------------------------------------------- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .02em;
    padding: 4px 9px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--surface-3);
    color: var(--text-2);
    white-space: nowrap;
}
.pill--in    { background: var(--gold-weak); color: var(--gold-link); border-color: #f0e3a8; }
.pill--you   { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: var(--gold-ink); border-color: transparent; }
.pill--ok    { background: var(--good-bg); color: var(--good); border-color: var(--good-line); }
.pill--bad   { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.pill--warn  { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }

/* ---------------------------------------------------------------------
   Queue position
   --------------------------------------------------------------------- */
.pos {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface-3);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-top: 12px;
}
.pos__n {
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    color: var(--gold-link);
}
.pos__of { font-size: .7rem; color: var(--muted); font-weight: 700; }
.pos__why { font-size: .8rem; color: var(--text-2); line-height: 1.45; }

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.field { margin-bottom: 15px; }
.field > .label { display: block; margin-bottom: 6px; }

input[type=text], input[type=email], input[type=password],
input[type=datetime-local], input[type=date], input[type=number],
select, textarea {
    width: 100%;
    min-height: var(--tap);
    padding: 12px 13px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-family: inherit;
    font-size: 16px;   /* 16px stops iOS Safari zooming on focus */
    color: var(--text);
    -webkit-appearance: none;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(245,194,0,.2);
}
.hint { font-size: .78rem; color: var(--muted); margin-top: 6px; }

/* ---------------------------------------------------------------------
   Flash messages
   --------------------------------------------------------------------- */
.flash {
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin: 14px 0;
    font-size: .9rem;
    border: 1px solid;
}
.flash--ok    { background: var(--good-bg); border-color: var(--good-line); color: var(--good); }
.flash--erro  { background: var(--bad-bg);  border-color: var(--bad-line);  color: var(--bad); }
.flash--aviso { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }

.empty {
    text-align: center;
    padding: 36px 16px;
    color: var(--muted);
    font-size: .9rem;
}

/* ---------------------------------------------------------------------
   Auth screens
   --------------------------------------------------------------------- */
.auth { max-width: 400px; margin: 0 auto; padding: 40px 16px; }
.auth__brand { text-align: center; margin-bottom: 26px; }
.auth__logo { height: 34px; width: auto; display: block; margin: 0 auto 14px; }
.auth__sub {
    font-size: .74rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--muted);
    font-weight: 700;
}
body.is-auth { padding-bottom: 0; }
.is-auth .card { box-shadow: var(--shadow-lg); border-radius: 16px; padding: 28px 26px; }

/* ---------------------------------------------------------------------
   Regulation prose
   --------------------------------------------------------------------- */
.prose { font-size: .95rem; color: var(--text-2); }
.prose h2 { font-size: 1.25rem; margin-top: 0; color: var(--text); }
.prose h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .06em;
            color: var(--muted); margin-top: 22px; }
.prose ol, .prose ul { padding-left: 1.15rem; margin: 0 0 .85rem; }
.prose li { margin-bottom: .35rem; }
.prose strong { font-weight: 700; color: var(--text); }

/* ---------------------------------------------------------------------
   Stacked rows (R-15: no horizontal-scroll tables on phones)
   --------------------------------------------------------------------- */
.rows { display: block; }
.row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: 0; }
.row__rank {
    flex: 0 0 26px;
    font-weight: 800;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}
.row__main { flex: 1; min-width: 0; }
.row__name { font-weight: 600; }
.row__why  { font-size: .76rem; color: var(--muted); line-height: 1.4; }
.row--top .row__rank { color: var(--gold-link); }
.row--top { background: linear-gradient(90deg, var(--gold-weak), transparent 70%); border-radius: var(--radius-sm); padding-left: 10px; margin-left: -10px; }

/* ---------------------------------------------------------------------
   Desktop
   --------------------------------------------------------------------- */
@media (min-width: 700px) {
    body { padding-bottom: 0; }
    .tabbar { display: none; }

    .topnav { display: flex; gap: 2px; margin-left: auto; }
    .topnav a {
        color: var(--text-2);
        text-decoration: none;
        font-size: .82rem;
        font-weight: 600;
        padding: 8px 12px;
        border-radius: var(--radius-sm);
    }
    .topnav a:hover { color: var(--text); background: var(--surface-3); }
    .topnav a.is-active { color: var(--gold-ink); background: var(--gold-weak); }

    .topbar__who { margin-left: 12px; }

    h1 { font-size: 1.75rem; }
    .btn { width: auto; }
    .btn + .btn { margin-top: 0; }
    .btn-row { flex-direction: row; }
    .claim__body { padding: 26px; }
    .countdown__n { font-size: 2.7rem; }
    .claim__match { font-size: 1.7rem; }
}

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

@media print {
    .topbar, .tabbar, .btn { display: none; }
    body { background: #fff; padding: 0; }
    .card { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
}
