/* ============================================================
   BitProof 2.0 — Design System
   Dark theme · Bitcoin orange accent · Monospace trust
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,700&family=JetBrains+Mono:wght@400;500;600&display=swap');

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Core palette */
    --bg:              #0c0c0e;
    --bg-raised:       #141418;
    --bg-surface:      #1a1a20;
    --bg-hover:        #22222a;

    --border:          #2a2a35;
    --border-focus:    #3a3a48;

    --text:            #e8e6e3;
    --text-muted:      #8a8a96;
    --text-dim:        #5a5a66;

    /* Accent — Bitcoin orange */
    --accent:          #f7931a;
    --accent-hover:    #ff9f2e;
    --accent-dim:      rgba(247, 147, 26, 0.12);
    --accent-glow:     rgba(247, 147, 26, 0.25);

    /* Semantic */
    --success:         #34d399;
    --success-dim:     rgba(52, 211, 153, 0.12);
    --warning:         #fbbf24;
    --warning-dim:     rgba(251, 191, 36, 0.12);
    --error:           #f87171;
    --error-dim:       rgba(248, 113, 113, 0.12);

    /* Type */
    --font-body:       'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:       'JetBrains Mono', 'Courier New', monospace;

    /* Spacing & radius */
    --radius-sm:       6px;
    --radius:          10px;
    --radius-lg:       16px;
    --radius-xl:       20px;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Layout
   ============================================================ */

.page {
    max-width: 760px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem 4rem;
}

/* ============================================================
   Header
   ============================================================ */

.site-header {
    text-align: center;
    margin-bottom: 3rem;
}

.site-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text);
}

.site-header h1 .accent {
    color: var(--accent);
}

.site-header .tagline {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 0.4rem;
    font-weight: 400;
}

.page-switch {
    margin: 0 auto 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.25rem;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

.page-switch a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 600;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    transition: all 0.15s ease;
}

.page-switch a:hover {
    color: var(--text);
    background: var(--bg-hover);
}

.page-switch a.active {
    color: #000;
    background: var(--accent);
}

/* ============================================================
   Card (main content area)
   ============================================================ */

.card {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
}

@media (max-width: 600px) {
    .card { padding: 1.75rem 1.25rem; }
}

/* ============================================================
   States (show/hide sections)
   ============================================================ */

.state { display: none; }
.state.active {
    display: block;
    animation: fadeUp 0.25s ease-out;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Drop zone
   ============================================================ */

.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 3.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: var(--bg-surface);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.drop-zone .icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.7;
}

.drop-zone .label {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.3rem;
}

.drop-zone .hint {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.drop-zone .privacy {
    font-size: 0.8rem;
    color: var(--success);
    margin-top: 1rem;
    font-weight: 500;
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: 0 0 20px var(--accent-glow);
}
.btn-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg-surface);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--bg-hover);
    border-color: var(--border-focus);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    padding: 0.5rem 1rem;
}
.btn-ghost:hover {
    color: var(--text);
}

.btn-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}
.btn-group .btn { flex: 1; }

@media (max-width: 500px) {
    .btn-group { flex-direction: column; }
}

/* ============================================================
   Inputs
   ============================================================ */

.input {
    width: 100%;
    padding: 0.85rem 1rem;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.input:focus {
    border-color: var(--accent);
}

.input::placeholder {
    color: var(--text-dim);
}

.input-row {
    display: flex;
    gap: 0.75rem;
}

.input-row .input { flex: 1; }

@media (max-width: 500px) {
    .input-row { flex-direction: column; }
}

/* ============================================================
   Spinner / processing
   ============================================================ */

.processing {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.processing p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ============================================================
   Result / info display
   ============================================================ */

.result-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.25rem;
}

.result-icon.success { background: var(--success-dim); color: var(--success); }
.result-icon.error   { background: var(--error-dim);   color: var(--error); }
.result-icon.pending { background: var(--warning-dim);  color: var(--warning); }

.result-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.info-grid {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.info-item label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.3rem;
}

.info-item span {
    font-size: 0.9rem;
    word-break: break-all;
}

.hash {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    background: var(--bg-surface);
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    display: inline-block;
}

/* ============================================================
   Message boxes
   ============================================================ */

.msg {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.88rem;
    line-height: 1.6;
    margin: 1rem 0;
}

.msg a { color: inherit; text-decoration: underline; }

.msg-warning {
    background: var(--warning-dim);
    border: 1px solid rgba(251, 191, 36, 0.25);
    color: #fde68a;
}

.msg-success {
    background: var(--success-dim);
    border: 1px solid rgba(52, 211, 153, 0.25);
    color: #a7f3d0;
}

.msg-error {
    background: var(--error-dim);
    border: 1px solid rgba(248, 113, 113, 0.25);
    color: #fca5a5;
}

.msg-pending {
    background: var(--warning-dim);
    border: 1px solid rgba(251, 191, 36, 0.25);
    color: #fde68a;
}

/* ============================================================
   Tabs
   ============================================================ */

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    gap: 0;
}

.tab {
    flex: 1;
    padding: 0.7rem 1rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.tab:hover { color: var(--text); }
.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* ============================================================
   Mode switch (file vs archive on verify page)
   ============================================================ */

.mode-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
}

.mode-tab {
    flex: 1;
    padding: 0.9rem 1rem;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
}

.mode-tab:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.mode-tab:last-child  { border-radius: 0 var(--radius) var(--radius) 0; border-left: none; }

.mode-tab h3 {
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}
.mode-tab p {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
}

.mode-tab.active {
    background: var(--accent-dim);
    border-color: var(--accent);
}

/* ============================================================
   Upload boxes (verify page)
   ============================================================ */

.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.25rem 0;
}

@media (max-width: 500px) {
    .upload-grid { grid-template-columns: 1fr; }
}

.upload-box {
    background: var(--bg-surface);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-box:hover {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.upload-box.has-file {
    border-style: solid;
    border-color: var(--success);
    background: var(--success-dim);
}

.upload-box .icon { font-size: 2rem; margin-bottom: 0.5rem; }
.upload-box .name {
    margin-top: 0.5rem;
    font-size: 0.82rem;
    color: var(--success);
    word-break: break-all;
}

.upload-box.centered {
    max-width: 360px;
    margin: 0 auto;
}

/* ============================================================
   Preview (archive)
   ============================================================ */

.preview-frame {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 1rem 0;
}

.preview-body {
    min-height: 350px;
    max-height: 550px;
    overflow: auto;
    background: #111;
}

.preview-body img {
    max-width: 100%;
    display: block;
}

.preview-body iframe {
    width: 100%;
    height: 450px;
    border: none;
    background: white;
}

.preview-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 350px;
    color: var(--text-dim);
}

/* ============================================================
   Meta grid
   ============================================================ */

.meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-surface);
    border-radius: var(--radius);
    margin: 1rem 0;
}

.meta-item .label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.meta-item .value {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    word-break: break-all;
    margin-top: 0.15rem;
}

/* ============================================================
   Manifest display
   ============================================================ */

.manifest-toggle {
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    border: none;
    background: none;
    font-family: var(--font-body);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.manifest-toggle:hover { color: var(--text); }

.manifest-pre {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    overflow: auto;
    max-height: 250px;
    white-space: pre-wrap;
    word-break: break-all;
    margin-top: 0.75rem;
}

/* ============================================================
   Feature grid (archive page)
   ============================================================ */

.feature-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 1.75rem 0;
}

.feature-card {
    text-align: center;
    padding: 1.25rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.feature-card .icon { font-size: 1.8rem; margin-bottom: 0.5rem; }
.feature-card h3 { font-size: 0.9rem; margin-bottom: 0.25rem; }
.feature-card p { font-size: 0.8rem; color: var(--text-muted); margin: 0; }

/* ============================================================
   Steps (archive progress)
   ============================================================ */

.step-list {
    max-width: 360px;
    margin: 1.5rem auto 0;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.9rem;
}

.step-item .dot { width: 20px; text-align: center; }
.step-item.active { color: var(--text); }
.step-item.done   { color: var(--success); }

/* ============================================================
   How-it-works (modal)
   ============================================================ */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 1000;
}

.modal-overlay.open { display: flex; align-items: center; justify-content: center; }

.modal-box {
    background: var(--bg-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    max-width: 620px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}
.modal-close:hover { color: var(--text); }

.modal-box h2 { margin-bottom: 1.5rem; }

.how-step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.how-step .num {
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.how-step h3 { margin-bottom: 0.3rem; font-size: 1rem; }
.how-step p { color: var(--text-muted); font-size: 0.88rem; margin: 0; }

/* ============================================================
   Prose sections (whitepaper, FAQ)
   ============================================================ */

.prose { max-width: 720px; margin: 0 auto; }
.prose h2 {
    color: var(--accent);
    margin-top: 2.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
    font-size: 1.35rem;
}
.prose h3 { margin-top: 1.75rem; font-size: 1.1rem; }
.prose p { margin: 0.9rem 0; color: var(--text-muted); line-height: 1.8; }
.prose strong { color: var(--text); }
.prose ul, .prose ol { margin: 0.75rem 0; padding-left: 1.5rem; color: var(--text-muted); }
.prose li { margin: 0.4rem 0; }
.prose code {
    font-family: var(--font-mono);
    font-size: 0.85em;
    background: var(--bg-surface);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}
.prose pre {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    margin: 1rem 0;
}
.prose a { color: var(--accent); text-decoration: none; }
.prose a:hover { text-decoration: underline; }

/* FAQ accordion */
.faq-item {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 0.75rem 0;
    overflow: hidden;
}

.faq-q {
    width: 100%;
    padding: 1rem 1.25rem;
    background: none;
    border: none;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq-q::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.faq-item.open .faq-q::after {
    content: '−';
}

.faq-a {
    display: none;
    padding: 0 1.25rem 1rem;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.7;
}

.faq-item.open .faq-a { display: block; }

/* ============================================================
   Nav
   ============================================================ */

.site-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.site-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 0.15s;
}

.site-nav a:hover { color: var(--accent); }

/* ============================================================
   Footer
   ============================================================ */

.site-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-dim);
}

/* ============================================================
   Status badge
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.85rem;
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
}

.badge-pending {
    background: var(--warning-dim);
    color: var(--warning);
}

.badge-confirmed {
    background: var(--success-dim);
    color: var(--success);
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
