/* CrashDoc — Clean, professional, reassuring */
:root {
    --bg: #0f1117;
    --card-bg: #1a1d27;
    --text: #e4e4e7;
    --text-muted: #9ca3af;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border: #2d3040;
    --mono-font: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

header {
    text-align: center;
    padding: 3rem 1rem 1rem;
}

.header-row {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#header-auth {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.sign-out-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}
.sign-out-btn:hover { color: var(--text); border-color: var(--text-muted); }

.copy-path-btn {
    background: rgba(0, 188, 242, 0.1);
    border: 1px solid rgba(0, 188, 242, 0.3);
    color: #00bcf2;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    vertical-align: middle;
}
.copy-path-btn:hover { background: rgba(0, 188, 242, 0.2); }

.header-sign-in-btn {
    background: transparent;
    border: 1px solid #00bcf2;
    color: #00bcf2;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.header-sign-in-btn:hover {
    background: rgba(0, 188, 242, 0.1);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.tagline {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

main {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

/* Drop Zone */
#drop-zone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

#drop-zone:hover, #drop-zone.drag-over {
    border-color: var(--accent);
    background: rgba(59, 130, 246, 0.05);
}

.drop-icon { font-size: 3rem; margin-bottom: 1rem; }

#drop-zone h2 { font-size: 1.3rem; margin-bottom: 0.5rem; }

.file-label {
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
}

.hint {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.hint code {
    background: rgba(59, 130, 246, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--mono-font);
    font-size: 0.8rem;
}

.hint a { color: var(--accent); }

/* Progress */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    margin: 1rem 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s;
}

#progress-status { color: var(--text-muted); font-size: 0.9rem; }

/* Results */
.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.result-item h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.mono {
    font-family: var(--mono-font);
    font-size: 1.1rem;
    color: var(--accent);
}

.label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
}

.badge.low { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge.medium { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.badge.high { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

.diagnosis-box, .fix-box {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.diagnosis-box h3, .fix-box h3 {
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.fix-box ol {
    padding-left: 1.25rem;
}

.fix-box li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.details-toggle {
    text-align: center;
    margin: 1rem 0;
}

.details-toggle button {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
}

.details-toggle button:hover {
    border-color: var(--accent);
    color: var(--text);
}

#technical-details pre {
    background: #0d0f14;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    font-family: var(--mono-font);
    font-size: 0.8rem;
    overflow-x: auto;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

/* FAQ */
.faq { margin-top: 1.5rem; }
.faq h3 { font-size: 0.95rem; margin-top: 1rem; margin-bottom: 0.25rem; }
.faq p { color: var(--text-muted); font-size: 0.9rem; }

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Confidence Section */
.confidence-box {
    background: linear-gradient(135deg, rgba(0, 188, 242, 0.08), rgba(59, 130, 246, 0.08));
    border: 1px solid rgba(0, 188, 242, 0.25);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    text-align: center;
}

.confidence-box h3 { margin-bottom: 0.5rem; }
.confidence-box > p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 0.75rem; }

.confidence-btn {
    background: linear-gradient(135deg, #00bcf2, #3b82f6);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.01em;
}
.confidence-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.confidence-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.confidence-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.opt-in-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.75rem;
    cursor: pointer;
}

.opt-in-label input[type="checkbox"] {
    accent-color: #00bcf2;
    width: 14px;
    height: 14px;
}

.confidence-fill {
    background: linear-gradient(90deg, #00bcf2, #3b82f6);
}

/* Upsell Carousel */
.upsell-carousel {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    min-height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upsell-text {
    color: var(--text);
    font-size: 0.9rem;
    text-align: center;
    transition: opacity 0.4s ease;
}

.upsell-text.fade-out { opacity: 0; }
.upsell-text.fade-in { opacity: 1; }

/* Confidence Results */
.confidence-results-box {
    background: var(--card-bg);
    border: 1px solid rgba(0, 188, 242, 0.3);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1rem;
    text-align: center;
}

.confidence-gauge-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}

.confidence-gauge {
    width: 140px;
    height: 140px;
    margin-bottom: 1rem;
}

.gauge-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 8;
}

.gauge-fill {
    fill: none;
    stroke: #00bcf2;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 326.7;
    stroke-dashoffset: 326.7;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 1.5s ease, stroke 0.5s ease;
}

.gauge-fill.high { stroke: var(--success); }
.gauge-fill.medium { stroke: var(--warning); }
.gauge-fill.low { stroke: var(--danger); }

.gauge-pct {
    fill: var(--text);
    font-size: 28px;
    font-weight: 700;
    font-family: -apple-system, system-ui, sans-serif;
}

.gauge-label {
    fill: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.confidence-recommendation {
    color: var(--text);
    font-size: 1rem;
    max-width: 500px;
    line-height: 1.5;
}

/* Upsell Details */
.confidence-teaser {
    color: var(--warning);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    font-style: italic;
}

.premium-details-list {
    list-style: none;
    text-align: left;
    max-width: 400px;
    margin: 0 auto 1.25rem;
}

.premium-details-list li {
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 0.4rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.premium-details-list li::before {
    content: '✦';
    position: absolute;
    left: 0;
    color: #00bcf2;
}

.unlock-btn {
    background: linear-gradient(135deg, #00bcf2, #0078d4);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.02em;
}
.unlock-btn:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 20px rgba(0, 188, 242, 0.3); }

.high-confidence-msg {
    color: var(--success);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.subtle-link {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: underline;
    transition: color 0.2s;
}
.subtle-link:hover { color: #00bcf2; }

/* Driver Version Box */
.driver-version-box {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.driver-version-box h3 { margin-bottom: 0.75rem; color: var(--accent); }
.driver-version-info .dv-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border);
}
.dv-row:last-child { border-bottom: none; }
.dv-label { color: var(--text-muted); }
.dv-value { font-family: var(--mono-font); }
.dv-outdated { color: var(--danger); font-weight: 600; }
.dv-current { color: var(--success); }
.dv-changelog { margin-top: 0.75rem; padding: 0.75rem; background: rgba(0,0,0,0.2); border-radius: 8px; }
.dv-changelog h4 { font-size: 0.85rem; color: var(--warning); margin-bottom: 0.5rem; }
.dv-changelog li { font-size: 0.85rem; margin-left: 1.2rem; margin-bottom: 0.25rem; color: var(--text-muted); }

/* Seriousness Box */
.seriousness-box {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.seriousness-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.seriousness-item h4 { margin-bottom: 0.5rem; }
.seriousness-item p { color: var(--text-muted); font-size: 0.95rem; }

/* Fix steps enhanced */
.fix-box ol li {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}
.fix-box ol li .fix-url {
    display: block;
    font-size: 0.85rem;
    color: var(--accent);
    margin-top: 0.2rem;
}
.fix-box ol li .fix-note {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.2rem;
}
.fix-box ol li .fix-changelog {
    display: block;
    font-size: 0.85rem;
    color: var(--success);
    margin-top: 0.2rem;
}

/* Auth Modal */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.auth-modal {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2rem;
    width: 380px;
    max-width: 90vw;
    position: relative;
    text-align: center;
}

.auth-modal h2 { margin-bottom: 0.5rem; font-size: 1.3rem; }
.auth-modal > p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

.auth-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.auth-google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 12px;
    background: white;
    color: #333;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.auth-google-btn:hover { background: #f0f0f0; }

.auth-microsoft-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 12px;
    background: #2f2f2f;
    color: #fff;
    border: 1px solid #555;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.5rem;
}
.auth-microsoft-btn:hover { background: #404040; }

.auth-divider {
    display: flex;
    align-items: center;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.auth-divider span { padding: 0 0.75rem; }

#auth-email-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#auth-email-form input {
    padding: 10px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.9rem;
}
#auth-email-form input:focus { outline: none; border-color: #00bcf2; }

.auth-email-btn {
    padding: 10px;
    background: #00bcf2;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}
.auth-email-btn:hover { background: #00a6d6; }

.auth-toggle { margin-top: 1rem; font-size: 0.85rem; color: var(--text-muted); }
.auth-toggle a { color: #00bcf2; }

.auth-error { color: var(--danger); font-size: 0.85rem; margin-top: 0.5rem; }

/* Responsive */
@media (max-width: 600px) {
    .seriousness-grid { grid-template-columns: 1fr; }
    .result-grid { grid-template-columns: 1fr; }
    header h1 { font-size: 2rem; }
    .card { padding: 1.25rem; }
}
