:root {
    --bg: #f7f9fc;
    --bg-elevated: #ffffff;
    --surface: #ffffff;
    --surface-2: #f1f4f9;
    --surface-hover: #e6ebf3;
    --border: rgba(15, 23, 42, 0.09);
    --border-strong: rgba(15, 23, 42, 0.18);
    --text: #0f172a;
    --text-secondary: #47536b;
    --text-muted: #6b7690;
    --accent: #4f46e5;
    --accent-light: #4338ca;
    --accent-glow: rgba(79, 70, 229, 0.25);
    --accent-subtle: rgba(79, 70, 229, 0.08);
    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.1);
    --warning: #b45309;
    --warning-bg: rgba(180, 83, 9, 0.1);
    --danger: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.1);
    --radius: 14px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.14);
    --font: 'DM Sans', system-ui, sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

/* Background effects */
.bg-gradient {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% -20%, rgba(99, 102, 241, 0.18), transparent),
        radial-gradient(ellipse 60% 40% at 100% 50%, rgba(139, 92, 246, 0.08), transparent),
        radial-gradient(ellipse 50% 30% at 0% 80%, rgba(59, 130, 246, 0.06), transparent);
    pointer-events: none;
    z-index: 0;
}

.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    z-index: 0;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, black, transparent);
}

.app-container {
    position: relative;
    z-index: 1;
    max-width: 920px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-title { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em; }
.logo-sub { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }

.header-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: var(--transition);
}

.status-pill[data-status="ready"] .status-dot { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-pill[data-status="processing"] .status-dot { background: var(--accent); animation: pulse 1.5s infinite; }
.status-pill[data-status="complete"] .status-dot { background: var(--success); }
.status-pill[data-status="error"] .status-dot { background: var(--danger); }

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

/* Step wizard */
.step-wizard {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    padding: 0.75rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    opacity: 0.4;
    transition: var(--transition);
}

.wizard-step.active { opacity: 1; }
.wizard-step.done { opacity: 0.75; }
.wizard-step.done .wizard-icon { background: var(--success-bg); color: var(--success); border-color: rgba(52, 211, 153, 0.3); }

.wizard-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: var(--transition);
}

.wizard-step.active .wizard-icon {
    background: var(--accent-subtle);
    border-color: rgba(99, 102, 241, 0.4);
    color: var(--accent-light);
    box-shadow: 0 0 20px var(--accent-glow);
}

.wizard-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.wizard-step.active .wizard-label { color: var(--text); }

.wizard-connector {
    flex: 1;
    height: 2px;
    min-width: 24px;
    max-width: 48px;
    background: var(--border);
    margin: 0 0.25rem;
    margin-bottom: 1.25rem;
    border-radius: 1px;
}

/* Main content */
.main-content { flex: 1; }

.step-section {
    display: none;
    animation: slideUp 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-section.active { display: block; }

.step-section.active.leaving {
    animation: fadeOutStep 0.15s ease forwards;
}

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

@keyframes fadeOutStep {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

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

.section-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.4rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Upload mode toggle */
.upload-mode-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: fit-content;
}

.mode-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border: none;
    border-radius: calc(var(--radius) - 4px);
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.mode-btn:hover { color: var(--text-secondary); }
.mode-btn.active {
    background: var(--accent-subtle);
    color: var(--accent-light);
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    cursor: pointer;
    margin-bottom: 1.5rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.dropzone::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, var(--accent-subtle), transparent 70%);
    opacity: 0;
    transition: var(--transition);
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.05);
}

.dropzone:hover::before, .dropzone.dragover::before { opacity: 1; }

.dropzone-inner { position: relative; z-index: 1; }

.dropzone-icon-wrap {
    width: 72px;
    height: 72px;
    margin: 0 auto 1.25rem;
    border-radius: 18px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.dropzone:hover .dropzone-icon-wrap, .dropzone.dragover .dropzone-icon-wrap {
    background: var(--accent-subtle);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-2px);
}

.dropzone-icon { color: var(--text-muted); transition: var(--transition); }
.dropzone:hover .dropzone-icon { color: var(--accent-light); }

.dropzone-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.dropzone-sub {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.link-btn {
    background: none;
    border: none;
    color: var(--accent-light);
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.link-btn:hover { color: var(--accent); }

.dropzone-hint {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.file-type-chips {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.chip {
    font-family: var(--mono);
    font-size: 0.7rem;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

/* File list */
.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.folder-summary {
    background: var(--surface);
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid var(--border);
    animation: slideUp 0.3s ease;
}

.folder-summary-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--accent-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.folder-summary strong { font-size: 0.95rem; display: block; }
.folder-summary p { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.1rem; }

.folder-summary .clear-btn {
    margin-left: auto;
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.folder-summary .clear-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
    background: var(--danger-bg);
}

.file-item {
    background: var(--surface);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid var(--border);
    animation: slideUp 0.25s ease;
}

.file-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--accent-light);
    flex-shrink: 0;
}

.file-item-name {
    flex: 1;
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item .remove-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.file-item .remove-btn:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

/* Buttons */
.action-bar {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding-top: 0.5rem;
}

.action-bar.center { justify-content: center; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn-lg { padding: 0.8rem 1.5rem; font-size: 0.95rem; border-radius: var(--radius); }

.btn-primary {
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    color: white;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

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

.btn-secondary:hover { background: var(--surface-hover); }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: var(--surface);
}

/* Progress */
.progress-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 2rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.75rem;
}

.progress-label {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--mono);
    color: var(--accent-light);
}

.progress-phase {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.progress-bar {
    height: 8px;
    background: var(--surface-2);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), #a78bfa);
    border-radius: 99px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.phase-steps {
    display: flex;
    gap: 0.5rem;
}

.phase-step {
    flex: 1;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.4rem 0.25rem;
    border-radius: 6px;
    color: var(--text-muted);
    background: var(--surface-2);
    transition: var(--transition);
}

.phase-step.active {
    color: var(--accent-light);
    background: var(--accent-subtle);
}

.phase-step.done {
    color: var(--success);
    background: var(--success-bg);
}

/* Documents grid */
.docs-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.docs-header h2 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.doc-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--mono);
}

.documents-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 420px;
    overflow-y: auto;
    padding-right: 4px;
}

.documents-grid::-webkit-scrollbar { width: 4px; }
.documents-grid::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.doc-card {
    background: var(--surface);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.875rem;
    transition: var(--transition);
    animation: slideUp 0.3s ease backwards;
}

.doc-card:hover { border-color: var(--border-strong); background: var(--surface-2); }

.doc-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
}

.doc-card-icon.pdf { background: rgba(220, 38, 38, 0.1); color: var(--danger); }
.doc-card-icon.txt { background: rgba(5, 150, 105, 0.1); color: var(--success); }
.doc-card-icon.docx { background: rgba(37, 99, 235, 0.1); color: #2563eb; }

.doc-info { flex: 1; min-width: 0; }

.doc-info h3 {
    font-size: 0.875rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.doc-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.2rem;
}

.doc-type-badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: var(--accent-subtle);
    color: var(--accent-light);
    font-weight: 500;
}

.doc-status {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.doc-status.extracted { color: var(--success); }
.doc-status.failed { color: var(--danger); }
.doc-status.pending { color: var(--warning); }

.doc-card select {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.75rem;
    outline: none;
    max-width: 180px;
    cursor: pointer;
    transition: var(--transition);
}

.doc-card select:focus { border-color: var(--accent); }
.doc-card select:disabled { opacity: 0.5; cursor: not-allowed; }

/* Review stats */
.review-stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    max-width: 280px;
}

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

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--mono);
    color: var(--accent-light);
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Review step section grouping */
.review-block {
    margin-bottom: 1.5rem;
}

.review-block .documents-grid,
.review-block .fields-list {
    margin-bottom: 0;
}

.review-divider {
    height: 1px;
    background: var(--border);
    margin: 0 0 1.5rem;
}

.review-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: -0.25rem 0 0.85rem;
}

.instruments-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.instruments-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.instruments-table th,
.instruments-table td {
    border-bottom: 1px solid var(--border);
    padding: 0.55rem 0.65rem;
    text-align: left;
    vertical-align: top;
}

.instruments-table th {
    background: var(--surface-2);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
}

.instruments-table tbody tr:last-child td {
    border-bottom: none;
}

.instruments-table input {
    width: 100%;
    min-width: 5rem;
    background: var(--surface-2);
    border: 1px solid transparent;
    color: var(--text);
    padding: 0.35rem 0.45rem;
    border-radius: 4px;
    font: inherit;
}

.instruments-table input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
}

.instruments-table tr.row-saved input {
    border-color: rgba(52, 211, 153, 0.35);
}

.instruments-table .row-note {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    font-style: italic;
    color: var(--text-secondary);
}

/* Fields list */
.fields-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.field-row {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.85rem 1rem;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1rem;
    align-items: start;
    transition: var(--transition);
    animation: slideUp 0.3s ease backwards;
}

.field-row:hover { border-color: var(--border-strong); }

.field-row.saved {
    border-color: rgba(52, 211, 153, 0.3);
    background: rgba(52, 211, 153, 0.04);
}

.field-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding-top: 0.45rem;
}

.field-input-wrap { position: relative; }

.field-input-wrap input,
.field-input-wrap textarea {
    width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.875rem;
    outline: none;
    transition: var(--transition);
    resize: vertical;
    min-height: 38px;
}

.field-input-wrap textarea { min-height: 60px; line-height: 1.5; }

.field-input-wrap input:focus,
.field-input-wrap textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-subtle);
}

/* Complete step */
.complete-hero {
    text-align: center;
    padding: 2rem 0 2.5rem;
}

.success-ring {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--success-bg);
    border: 2px solid rgba(52, 211, 153, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: var(--success);
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.complete-hero h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.complete-hero p { color: var(--text-secondary); }

.download-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.download-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.1rem 1.25rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    cursor: pointer;
}

.download-card:hover {
    border-color: var(--border-strong);
    background: var(--surface-2);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.download-card.primary {
    border-color: rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.05));
}

.download-card.primary:hover {
    border-color: var(--accent);
    box-shadow: 0 8px 32px var(--accent-glow);
}

.download-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-light);
    flex-shrink: 0;
}

.download-card.primary .download-icon {
    background: var(--accent-subtle);
}

.download-info { flex: 1; }
.download-info strong { display: block; font-size: 0.95rem; margin-bottom: 0.15rem; }
.download-info span { font-size: 0.8rem; color: var(--text-muted); }

.download-arrow { color: var(--text-muted); flex-shrink: 0; transition: var(--transition); }
.download-card:hover .download-arrow { color: var(--accent-light); transform: translateY(2px); }

/* Toast */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--surface-2);
    color: var(--text);
    padding: 0.85rem 1.25rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-lg);
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
    z-index: 1000;
    font-size: 0.875rem;
    font-weight: 500;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--success-bg);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
}

.toast.error .toast-icon {
    background: var(--danger-bg);
    color: var(--danger);
}

/* Spinner for processing button */
.btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn.loading svg { animation: spin 1s linear infinite; }

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

/* Responsive */
@media (max-width: 640px) {
    .app-container { padding: 1rem 1rem 2rem; }

    .step-wizard { padding: 0.5rem; }
    .wizard-label { display: none; }
    .wizard-connector { min-width: 12px; margin-bottom: 0; }

    .section-header h1 { font-size: 1.4rem; }

    .dropzone { padding: 2rem 1.25rem; }

    .review-stats { grid-template-columns: 1fr; }

    .field-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .doc-card { flex-wrap: wrap; }
    .doc-card select { max-width: 100%; width: 100%; margin-top: 0.5rem; }

    .action-bar { justify-content: stretch; }
    .action-bar .btn { flex: 1; justify-content: center; }
}
