/* OpenNote.dev — Global Stylesheet */

/* ── Variables ─────────────────────────────────────────────────────────── */
:root,
:root[data-theme="light"] {
    --primary:       #6366f1;
    --primary-dark:  #4f46e5;
    --secondary:     #8b5cf6;
    --success:       #10b981;
    --danger:        #ef4444;
    --text:          #1f2937;
    --text-muted:    #6b7280;
    --bg:            linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-solid:      #f3f0ff;
    --navbar-bg:     rgba(255, 255, 255, 0.95);
    --card-bg:       #ffffff;
    --input-bg:      #f9fafb;
    --border:        #e5e7eb;
    --hover-bg:      rgba(99, 102, 241, 0.06);
    --modal-overlay: rgba(0, 0, 0, 0.5);
    --shadow:        0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg:     0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius:        12px;
    --footer-bg:     #ffffff;
}

:root[data-theme="dark"] {
    --primary:       #818cf8;
    --primary-dark:  #6366f1;
    --secondary:     #a78bfa;
    --success:       #34d399;
    --danger:        #f87171;
    --text:          #f1f5f9;
    --text-muted:    #cbd5e1;
    --bg:            linear-gradient(135deg, #1a2332 0%, #283548 50%, #3b3876 100%);
    --bg-solid:      #1a2332;
    --navbar-bg:     rgba(40, 53, 72, 0.95);
    --card-bg:       #283548;
    --input-bg:      rgba(26, 35, 50, 0.5);
    --border:        #3e5068;
    --hover-bg:      rgba(129, 140, 248, 0.1);
    --modal-overlay: rgba(0, 0, 0, 0.7);
    --shadow:        0 4px 6px -1px rgb(0 0 0 / 0.5);
    --shadow-lg:     0 10px 15px -3px rgb(0 0 0 / 0.7);
    --radius:        12px;
    --footer-bg:     #1e2d3d;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    transition: background 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
}

/* ── Layout ────────────────────────────────────────────────────────────── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.25rem;
    width: 100%;
}

.main-content {
    flex: 1;
    padding-top: 2rem;
    padding-bottom: 4rem;
}

/* ── Navbar ────────────────────────────────────────────────────────────── */
.navbar {
    background: var(--navbar-bg);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--primary);
    padding: 0.85rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
    transition: background 0.3s;
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo {
    height: 34px;
    width: auto;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.nav-link:hover {
    background: var(--hover-bg);
    color: var(--text);
}

.nav-link.active {
    color: var(--primary);
    background: var(--hover-bg);
    font-weight: 600;
}

.theme-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
    padding: 0.35rem;
    margin-left: 0.5rem;
    transition: transform 0.2s;
    flex-shrink: 0;
    color: #9ca3af;
    border-radius: 8px;
}
.theme-btn:hover { transform: scale(1.15); }

/* ── Breadcrumb ────────────────────────────────────────────────────────── */
.breadcrumb {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 1.5rem;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.95);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-sep {
    margin: 0 0.4rem;
    opacity: 0.5;
}

[data-theme="dark"] .breadcrumb {
    color: var(--text-muted);
}

[data-theme="dark"] .breadcrumb a {
    color: var(--primary);
}

/* ══════════════════════════════════════════════════════════════════════════
   HOME PAGE
   ══════════════════════════════════════════════════════════════════════ */

/* ── Hero ──────────────────────────────────────────────────────────────── */
.hero {
    text-align: center;
    padding: 3rem 0 2.5rem;
    color: #fff;
}

.hero-title {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #fff;
}

.hero-accent {
    background: linear-gradient(135deg, #c7d2fe 0%, #e9d5ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="dark"] .hero-accent {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ── Tools grid ────────────────────────────────────────────────────────── */
.tools-section {
    margin-bottom: 2rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.tool-card {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.35rem 1.5rem;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.tool-card--coming-soon {
    opacity: 0.55;
    cursor: default;
    border-style: dashed;
}

.tool-card--coming-soon:hover {
    transform: none;
    box-shadow: var(--shadow);
    border-color: var(--border);
}

.tool-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: color-mix(in srgb, var(--tool-color, var(--primary)) 12%, transparent);
    color: var(--tool-color, var(--primary));
}

.tool-icon--muted {
    background: var(--hover-bg);
    color: var(--text-muted);
}

.tool-body {
    flex: 1;
    min-width: 0;
}

.tool-name {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.tool-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.tool-arrow {
    font-size: 1.3rem;
    color: var(--primary);
    flex-shrink: 0;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.2s, transform 0.2s;
}

.tool-card:hover .tool-arrow {
    opacity: 1;
    transform: translateX(0);
}

.tool-card--coming-soon .tool-arrow { display: none; }


/* ══════════════════════════════════════════════════════════════════════════
   TOOL PAGES — SHARED
   ══════════════════════════════════════════════════════════════════════ */

/* ── Page header ───────────────────────────────────────────────────────── */
.page-header { margin-bottom: 2rem; }

.page-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: #fff;
}

.subtitle {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.95rem;
}

[data-theme="dark"] .page-header h2 {
    color: var(--text);
}

[data-theme="dark"] .subtitle {
    color: var(--text);
    opacity: 0.85;
}

code {
    background: var(--border);
    padding: 0.1em 0.35em;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* ══════════════════════════════════════════════════════════════════════════
   QR CODE GENERATOR
   ══════════════════════════════════════════════════════════════════════ */

/* ── Two-column layout ─────────────────────────────────────────────────── */
.qr-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.5rem;
    align-items: start;
}

.qr-main, .qr-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ── Card ──────────────────────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.card-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 0;
}

.step-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Field label ───────────────────────────────────────────────────────── */
.field-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.4rem;
}

/* ── Textarea ──────────────────────────────────────────────────────────── */
.url-textarea {
    width: 100%;
    min-height: 180px;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s;
}
.url-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* ── OR divider ────────────────────────────────────────────────────────── */
.or-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0.9rem 0;
}
.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── File drop zone ────────────────────────────────────────────────────── */
.file-drop-zone {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border: 1.5px dashed var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.file-drop-zone svg { flex-shrink: 0; opacity: 0.5; }
.file-drop-zone:hover,
.file-drop-zone.active {
    border-color: var(--primary);
    background: var(--hover-bg);
    color: var(--text);
}
.file-drop-zone.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.file-remove-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    border-radius: 50%;
    background: var(--border);
    color: var(--text);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}

.file-remove-btn:hover {
    background: var(--danger, #e74c3c);
    color: #fff;
}

/* ── Options grid ──────────────────────────────────────────────────────── */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.option-field {
    display: flex;
    flex-direction: column;
}

.field-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 0.35rem;
}

/* ── Inputs ────────────────────────────────────────────────────────────── */
.text-input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.9rem;
    transition: border-color 0.2s;
}
.text-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.text-input.mono { font-family: 'Courier New', Courier, monospace; }

.select-input {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--card-bg);
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
    transition: border-color 0.2s;
}
.select-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* ── Color row ─────────────────────────────────────────────────────────── */
.color-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.color-picker {
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px;
    background: none;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}
.btn-primary:active { transform: none; box-shadow: none; }

.btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
}

.btn-full { width: 100%; padding: 0.9rem; font-size: 1rem; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Badge ─────────────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-left: 0.4rem;
}

/* ── Placeholder ───────────────────────────────────────────────────────── */
.placeholder-body {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.9rem;
}

/* ── Result items ──────────────────────────────────────────────────────── */
.result-item {
    border-bottom: 1px solid var(--border);
    padding: 0.65rem 0;
}
.result-item:last-child { border-bottom: none; }

.result-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.qr-thumb {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 6px;
    flex-shrink: 0;
}

.result-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.result-url {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.result-error { display: flex; flex-direction: column; gap: 0.2rem; }
.error-badge  { font-size: 0.75rem; color: var(--danger); }

/* ── Spinner overlay ───────────────────────────────────────────────────── */
.spinner-overlay {
    position: fixed;
    inset: 0;
    background: var(--modal-overlay);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spinner-box {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 2rem 2.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-lg);
}

.spinner-box p { color: var(--text-muted); font-size: 0.9rem; }

.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}

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


/* ══════════════════════════════════════════════════════════════════════════
   IMAGE METADATA INSPECTOR
   ══════════════════════════════════════════════════════════════════════ */

.meta-layout { max-width: 960px; margin: 0 auto; }

.file-drop-zone--large {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2.5rem;
}
.file-drop-zone--large svg { opacity: 0.35; }
.drop-formats {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* Summary card */
.meta-summary-card { padding: 1.5rem; }
.meta-summary {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}
.meta-preview-wrap {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}
.meta-preview-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.meta-file-info { flex: 1; min-width: 0; }
.meta-file-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    word-break: break-all;
}
.meta-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.meta-stat strong { color: var(--text); }

.meta-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Privacy banner */
.meta-privacy-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    padding: 0.85rem 1.25rem;
    margin-bottom: 1rem;
    color: var(--danger);
    font-size: 0.9rem;
}
.meta-privacy-banner svg { flex-shrink: 0; stroke: var(--danger); }
.meta-privacy-banner strong { display: block; }
.meta-privacy-banner span { opacity: 0.85; font-size: 0.83rem; }

/* Metadata table */
.meta-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.meta-table th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.meta-table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.meta-th-check { width: 50px; }
.meta-td-check { text-align: center; }
.meta-td-check input { cursor: pointer; width: 16px; height: 16px; }

.meta-row-privacy {
    background: rgba(239, 68, 68, 0.05);
}
:root[data-theme="dark"] .meta-row-privacy {
    background: rgba(239, 68, 68, 0.08);
}

.meta-field-name {
    font-weight: 500;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
}
.meta-field-value {
    color: var(--text-muted);
    word-break: break-all;
    max-width: 350px;
}

/* Category badges */
.meta-cat-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.meta-cat-exif { background: rgba(99, 102, 241, 0.15); color: #6366f1; }
.meta-cat-gps { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.meta-cat-iptc { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.meta-cat-xmp { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.meta-cat-png { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.meta-cat-webp { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.meta-cat-svg { background: rgba(236, 72, 153, 0.15); color: #ec4899; }
.meta-cat-jpeg { background: rgba(107, 114, 128, 0.15); color: #6b7280; }

.meta-privacy-flag {
    color: var(--danger);
    font-size: 0.9rem;
    cursor: help;
}

.meta-select-all-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--text-muted);
    cursor: pointer;
}
.meta-select-all-label input { cursor: pointer; }

.meta-empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-danger:hover { opacity: 0.9; }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-success {
    background: var(--success);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-success:hover { opacity: 0.9; }

#meta-table-wrap { overflow-x: auto; }

@media (max-width: 600px) {
    .meta-summary { flex-direction: column; align-items: center; text-align: center; }
    .meta-preview-wrap { width: 90px; height: 90px; }
    .meta-stats { justify-content: center; }
    .meta-actions-row { justify-content: center; }
    .meta-field-value { max-width: 180px; }
}


/* ══════════════════════════════════════════════════════════════════════════
   LEGAL PAGES (Terms, Privacy)
   ══════════════════════════════════════════════════════════════════════ */

.legal-page {
    max-width: 780px;
    margin: 0 auto;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 3rem;
    box-shadow: var(--shadow);
}

.legal-page h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
}

.legal-updated {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.legal-section {
    margin-bottom: 1.75rem;
}

.legal-section h2 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.legal-section p {
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--text);
    opacity: 0.9;
}

.legal-section ul {
    margin: 0.5rem 0 0 1.5rem;
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--text);
    opacity: 0.9;
}

.legal-section a {
    color: var(--primary);
    text-decoration: none;
}
.legal-section a:hover {
    text-decoration: underline;
}


/* ══════════════════════════════════════════════════════════════════════════
   BOOKS PAGE
   ══════════════════════════════════════════════════════════════════════ */

.books-support-card {
    max-width: 700px;
    margin: 0 auto 2.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 2.5rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.books-support-card p {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--text);
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.books-support-card p:last-child { margin-bottom: 0; }

.books-support-card a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.books-support-card a:hover {
    text-decoration: underline;
}

.books-support-cta {
    font-weight: 600;
    opacity: 1 !important;
    margin-top: 0.5rem !important;
    color: var(--primary) !important;
}

/* Book grid */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.book-card {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.book-cover-wrap {
    width: 100%;
    overflow: hidden;
    background: var(--input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.book-cover {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}

.book-card:hover .book-cover {
    transform: scale(1.03);
}

.book-info {
    padding: 1.25rem 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.book-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    flex: 1;
    margin-bottom: 0.75rem;
}

.book-links {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.book-link-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

.book-link-label:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}



/* Publisher link */
.books-publisher {
    text-align: center;
    margin-bottom: 2rem;
}

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

.books-publisher a {
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 600;
}

.books-publisher a:hover {
    text-decoration: underline;
}

@media (max-width: 480px) {
    .books-support-card { padding: 1.25rem; }
    .books-grid { grid-template-columns: 1fr; }
}


/* ══════════════════════════════════════════════════════════════════════════
   404 ERROR PAGE
   ══════════════════════════════════════════════════════════════════════ */

.error-page {
    text-align: center;
    padding: 5rem 1rem;
}

.error-code {
    font-size: 6rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .error-code {
    color: var(--primary);
}

.error-message {
    font-size: 1.5rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .error-message {
    color: var(--text);
}

.error-detail {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .error-detail {
    color: var(--text-muted);
}

/* ══════════════════════════════════════════════════════════════════════════
   NOSCRIPT
   ══════════════════════════════════════════════════════════════════════ */

.noscript-banner {
    background: #fef3c7;
    color: #92400e;
    text-align: center;
    padding: 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    border-bottom: 2px solid #f59e0b;
}


/* ══════════════════════════════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════════════════════════ */

.footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.footer-links {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.7;
}

.footer-copy a {
    color: var(--primary);
    text-decoration: none;
}
.footer-copy a:hover {
    text-decoration: underline;
}


/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════ */

@media (max-width: 800px) {
    .qr-layout { grid-template-columns: 1fr; }
    .qr-sidebar { order: -1; }

    .hero-title { font-size: 2rem; }
    .tools-grid { grid-template-columns: 1fr; }

    .legal-page { padding: 1.5rem 1.25rem; }
}

@media (max-width: 480px) {
    .options-grid { grid-template-columns: 1fr; }
    .nav-links .nav-link { padding: 0.35rem 0.55rem; font-size: 0.82rem; }
    .hero-title { font-size: 1.6rem; }
    .hero-subtitle { font-size: 0.95rem; }
}
