/* =========================================================================
   Vault Host — design system
   A safe-deposit / ledger metaphor: oxidized steel, brass fittings, paper
   ledger cards. No template defaults — see design notes in project README.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
    --ink: #0F1614;
    --panel: #16211D;
    --panel-alt: #1C2A24;
    --line: #2A362F;
    --line-soft: #223027;
    --brass: #B08D57;
    --brass-bright: #D4AF6A;
    --paper: #EDE6D6;
    --paper-dim: #93998F;
    --mint: #7FAE99;
    --rust: #C06A50;
    --radius: 3px;
    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'IBM Plex Sans', -apple-system, sans-serif;
    --font-mono: 'IBM Plex Mono', 'SFMono-Regular', monospace;
    --shadow-panel: 0 1px 0 rgba(237,230,214,0.03) inset, 0 12px 24px -16px rgba(0,0,0,0.6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
    margin: 0;
    background: var(--ink);
    background-image:
        radial-gradient(1200px 600px at 15% -10%, rgba(176,141,87,0.07), transparent),
        radial-gradient(900px 500px at 100% 0%, rgba(127,174,153,0.05), transparent);
    color: var(--paper);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brass-bright); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; color: var(--paper); margin: 0 0 0.4em; }
h1 { font-size: 2.4rem; letter-spacing: -0.01em; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; color: var(--paper-dim); }

::selection { background: var(--brass); color: var(--ink); }
:focus-visible { outline: 2px solid var(--brass-bright); outline-offset: 2px; }

.eyebrow {
    font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase;
    color: var(--brass); font-weight: 600;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* --------------------------------------------------------------- buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-family: var(--font-body); font-weight: 600; font-size: 14px;
    padding: 11px 20px; border-radius: var(--radius); border: 1px solid transparent;
    cursor: pointer; transition: transform .12s ease, border-color .12s ease, background .12s ease;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn-brass { background: var(--brass); color: #201709; border-color: var(--brass); }
.btn-brass:hover { background: var(--brass-bright); }
.btn-ghost { background: transparent; color: var(--paper); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brass); color: var(--brass-bright); }
.log-tab.active { border-color: var(--brass); color: var(--brass-bright); background: rgba(176,141,87,0.1); }
.btn-danger { background: transparent; color: var(--rust); border-color: rgba(192,106,80,0.5); }
.btn-danger:hover { background: rgba(192,106,80,0.1); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ----------------------------------------------------------------- nav */
.site-nav {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 0; border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 20px; color: var(--paper); font-weight: 600; }
.brand:hover { text-decoration: none; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: var(--paper-dim); font-size: 14px; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--brass-bright); text-decoration: none; }

/* ------------------------------------------------------------- app shell */
.app-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.app-sidebar {
    background: var(--panel); border-right: 1px solid var(--line-soft);
    padding: 24px 16px; display: flex; flex-direction: column; gap: 4px;
}
.app-sidebar .brand { padding: 0 8px 20px; }
.side-link {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius);
    color: var(--paper-dim); font-size: 14px; font-weight: 500;
}
.side-link:hover { background: var(--panel-alt); color: var(--paper); text-decoration: none; }
.side-link.active { background: var(--panel-alt); color: var(--brass-bright); box-shadow: inset 2px 0 0 var(--brass); }
.side-section-label { font-size: 10.5px; letter-spacing: 1.5px; text-transform: uppercase; color: #5C645D; margin: 18px 12px 6px; }
.app-main { padding: 32px 40px; max-width: 1040px; }
.app-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.balance-chip {
    display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono);
    background: var(--panel); border: 1px solid var(--line); padding: 8px 14px; border-radius: var(--radius);
    color: var(--brass-bright); font-size: 14px;
}

@media (max-width: 860px) {
    .app-shell { grid-template-columns: 1fr; }
    .app-sidebar { display: none; }
    .app-main { padding: 20px; }
}

/* ------------------------------------------------------------------ card */
.panel {
    background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--radius);
    padding: 24px; box-shadow: var(--shadow-panel);
}
.panel + .panel { margin-top: 20px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 760px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

.stat-card { padding: 20px 22px; }
.stat-card .value { font-family: var(--font-mono); font-size: 28px; color: var(--paper); display:block; margin-top: 6px; }
.stat-card .label { font-size: 12px; color: var(--paper-dim); text-transform: uppercase; letter-spacing: 1px; }

/* ------------------------------------------------------------------ form */
label { display: block; font-size: 13px; font-weight: 600; color: var(--paper); margin-bottom: 6px; }
input, select, textarea {
    width: 100%; background: var(--ink); border: 1px solid var(--line); color: var(--paper);
    padding: 11px 12px; border-radius: var(--radius); font-family: var(--font-body); font-size: 14px;
}
input:focus, select:focus, textarea:focus { border-color: var(--brass); outline: none; }
.field { margin-bottom: 18px; }
.field-hint { font-size: 12px; color: var(--paper-dim); margin-top: 6px; }
.field-error { font-size: 12px; color: var(--rust); margin-top: 6px; display: none; }
.otp-input { letter-spacing: 10px; font-family: var(--font-mono); font-size: 22px; text-align: center; }

.provider-option {
    display: flex; align-items: center; gap: 10px; cursor: pointer;
    background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 11px 14px; font-size: 14px; font-weight: 500; color: var(--paper); margin-bottom: 0;
}
.provider-option:has(input:checked) { border-color: var(--brass); }
.provider-option input[type="radio"] { width: auto; padding: 0; margin: 0; flex: 0 0 auto; }
.provider-option:has(input:disabled) { opacity: 0.45; cursor: not-allowed; }
.provider-option .field-hint { margin: 0; }

.form-card { max-width: 420px; margin: 0 auto; }
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px 20px; }

.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; margin-bottom: 18px; border: 1px solid; }
.alert-error { background: rgba(192,106,80,0.08); border-color: rgba(192,106,80,0.4); color: #E2A896; }
.alert-success { background: rgba(127,174,153,0.08); border-color: rgba(127,174,153,0.4); color: var(--mint); }

/* --------------------------------------------------------------- badges */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.4px; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-active, .badge-running, .badge-approved, .badge-resolved { color: var(--mint); background: rgba(127,174,153,0.12); }
.badge-pending, .badge-queued, .badge-building, .badge-open { color: var(--brass-bright); background: rgba(176,141,87,0.14); }
.badge-suspended, .badge-crashed, .badge-rejected, .badge-banned { color: var(--rust); background: rgba(192,106,80,0.12); }
.badge-deleted, .badge-dismissed, .badge-closed { color: var(--paper-dim); background: rgba(147,153,143,0.1); }

/* --------------------------------------------------------------- tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--paper-dim); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); }
td { padding: 13px 12px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
tr:last-child td { border-bottom: none; }
.mono { font-family: var(--font-mono); }

/* --------------------------------------------------------- ledger stub --
   Signature element: a deposit-slip / ledger stub row with a perforated
   left edge, used for coin transactions and deposit history. */
.ledger-stub {
    position: relative; display: flex; align-items: center; justify-content: space-between;
    background: var(--panel-alt); border: 1px solid var(--line-soft); border-radius: var(--radius);
    padding: 14px 18px 14px 26px; margin-bottom: 10px;
}
.ledger-stub::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 10px;
    background-image: radial-gradient(circle, var(--ink) 2px, transparent 2.2px);
    background-size: 10px 12px; background-position: 0 4px; background-repeat: repeat-y;
    border-right: 1px dashed var(--line);
}
.ledger-stub .amount { font-family: var(--font-mono); font-size: 15px; }
.ledger-stub .amount.credit { color: var(--mint); }
.ledger-stub .amount.debit { color: var(--rust); }
.ledger-stub .meta { font-size: 12px; color: var(--paper-dim); margin-top: 2px; }

/* --------------------------------------------------------- vault dial ---
   Signature element: a rotary combination-lock dial. Used as a brand mark,
   hero motif, and (rotating) loading indicator. Pure CSS/SVG, no imagery. */
.vault-dial { display: inline-block; position: relative; }
.vault-dial svg { display: block; }
.vault-dial .dial-ring { stroke: var(--brass); }
.vault-dial .dial-notch { stroke: var(--paper-dim); }
.vault-dial.spin svg { animation: dial-turn 2.4s cubic-bezier(.7,0,.3,1) infinite; }
@keyframes dial-turn { 0% { transform: rotate(0deg); } 45% { transform: rotate(230deg); } 55% { transform: rotate(230deg); } 100% { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- hero */
.hero { padding: 96px 0 64px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { font-size: clamp(2.4rem, 4vw, 3.6rem); line-height: 1.05; }
.hero .lede { font-size: 17px; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; margin-top: 28px; }

.divider-brass { height: 1px; background: linear-gradient(90deg, var(--brass), transparent); margin: 24px 0; }

footer.site-footer { border-top: 1px solid var(--line-soft); padding: 32px 0; color: var(--paper-dim); font-size: 13px; }

.section { padding: 64px 0; }
.section-head { max-width: 620px; margin: 0 0 40px; }

.pill-row { display: flex; gap: 10px; flex-wrap: wrap; }
.pill { border: 1px solid var(--line); border-radius: 20px; padding: 6px 14px; font-size: 12.5px; color: var(--paper-dim); }

.empty-state { text-align: center; padding: 48px 20px; color: var(--paper-dim); }
.empty-state h3 { color: var(--paper); }

.modal-backdrop { position: fixed; inset: 0; background: rgba(6,10,8,0.72); display: none; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); max-width: 460px; width: 100%; padding: 26px; }
