/*
 * Base elements and reusable components (buttons, cards, forms, badges,
 * tables). Page layout lives in layout.css, motion in motion.css.
 * No inline styles anywhere: the CSP (style-src 'self') would drop them.
 */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--text-md);
    line-height: 1.6;
    color: var(--ink);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0 0 var(--space-3); line-height: 1.15; color: var(--ink); }
h1 { font-family: var(--font-serif); font-weight: 700; font-size: var(--text-2xl); letter-spacing: -.01em; }
h2 { font-family: var(--font-serif); font-weight: 700; font-size: var(--text-xl); }
h3 { font-size: var(--text-lg); font-weight: 650; }
p { margin: 0 0 var(--space-3); }
a { color: var(--navy-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { display: block; max-width: 100%; }
code, .mono { font-family: var(--font-mono); font-size: .92em; }

:focus-visible { outline: 3px solid var(--gold-400); outline-offset: 2px; border-radius: 4px; }

.kicker {
    display: inline-block;
    font-size: var(--text-xs);
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--navy-600);
    margin-bottom: var(--space-2);
}
.kicker.gold { color: var(--gold-500); }

.muted { color: var(--muted); }
.small { font-size: var(--text-sm); }

.icon { width: 20px; height: 20px; flex: none; }
.icon-sm { width: 16px; height: 16px; flex: none; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 11px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-pill);
    font: inherit;
    font-weight: 700;
    font-size: var(--text-sm);
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--gold-400); color: var(--navy-900); box-shadow: 0 6px 18px rgba(250, 204, 6, .28); }
.btn-primary:hover { background: var(--gold-500); }
.btn-dark { background: var(--navy-800); color: var(--white); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-block { width: 100%; justify-content: center; }

/* Cards */
.card {
    background: var(--white);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: var(--space-5);
}
.card-header { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.card-header h2 { font-size: var(--text-lg); margin: 0; }

/* Forms */
label { display: block; font-size: var(--text-sm); font-weight: 650; margin: var(--space-4) 0 var(--space-2); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=url], input[type=search], select, textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--white);
    font: inherit;
    color: var(--ink);
    transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-600); box-shadow: 0 0 0 4px rgba(31, 90, 139, .12); }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 750;
    letter-spacing: .04em;
    background: var(--surface);
    color: var(--ink-soft);
}
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-info { background: var(--info-bg); color: var(--info); }

/* Alerts */
.alert { padding: var(--space-3) var(--space-4); border-radius: var(--radius-sm); border-left: 3px solid; font-size: var(--text-sm); margin-bottom: var(--space-4); }
.alert-danger { background: var(--danger-bg); border-color: var(--danger); color: #7a1a14; }
.alert-ok { background: var(--ok-bg); border-color: var(--ok); color: #135c3c; }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.table th { text-align: left; font-size: var(--text-xs); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); }
.table td { padding: var(--space-3); border-bottom: 1px solid var(--line-soft); }
.table tr:last-child td { border-bottom: 0; }
