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

:root {
    --bg: #08110d;
    --bg-soft: #0f1f17;
    --panel: #ffffff;
    --panel-soft: #f5f7f6;
    --text: #122018;
    --text-soft: #4a5a51;
    --border: rgba(8, 17, 13, 0.1);
    --brand: #1fb35a;
    --brand-dark: #11813d;
    --brand-ink: #0d5b2d;
    --warning: #b42318;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(31, 179, 90, 0.18), transparent 28%),
        linear-gradient(140deg, #09110d 0%, #0f1f17 45%, #07100b 100%);
    color: #f7faf8;
    padding: 24px;
}

body.page-legal {
    background:
        radial-gradient(circle at top left, rgba(31, 179, 90, 0.16), transparent 28%),
        linear-gradient(140deg, #09110d 0%, #14241b 45%, #08110d 100%);
}

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

button,
a {
    transition: all 0.2s ease;
}

.page-shell {
    max-width: 1180px;
    margin: 0 auto;
}

.site-header {
    margin-bottom: 32px;
}

.brand-row {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 28px;
    align-items: center;
    margin-bottom: 28px;
}

.logo {
    width: 100%;
    max-width: 220px;
    filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.28));
}

.brand-copy h1 {
    font-size: clamp(2.5rem, 5vw, 4.4rem);
    line-height: 1.05;
    margin-bottom: 16px;
    letter-spacing: -0.04em;
}

.eyebrow,
.card-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.78rem;
    font-weight: 700;
    color: #7de6a8;
    margin-bottom: 14px;
}

.subtitle {
    max-width: 820px;
    color: rgba(247, 250, 248, 0.9);
    font-size: 1.14rem;
    line-height: 1.65;
}

.hero-actions,
.cta-actions,
.results-actions,
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.hero-actions {
    margin-top: 24px;
}

.primary-link,
.secondary-link,
.submit-btn,
.new-analysis-btn,
.ghost-btn,
.file-label {
    border-radius: 999px;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    text-decoration: none;
}

.primary-link,
.submit-btn,
.new-analysis-btn,
.file-label {
    background: linear-gradient(135deg, var(--brand) 0%, #39d375 100%);
    color: #04110a;
    box-shadow: 0 14px 32px rgba(31, 179, 90, 0.28);
}

.primary-link,
.secondary-link,
.file-label {
    padding: 15px 22px;
}

.submit-btn {
    padding: 16px 28px;
    font-size: 1rem;
}

.secondary-link,
.ghost-btn {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #f7faf8;
}

.ghost-btn,
.new-analysis-btn {
    padding: 12px 18px;
    font-size: 0.96rem;
}

.primary-link:hover,
.secondary-link:hover,
.submit-btn:hover:not(:disabled),
.new-analysis-btn:hover,
.ghost-btn:hover,
.file-label:hover {
    transform: translateY(-1px);
}

.submit-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.hero-grid,
.info-grid {
    display: grid;
    gap: 18px;
}

.hero-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-card,
.info-card,
.upload-card,
.loading-card,
.results-card,
.trust-item,
.legal-card {
    background: rgba(255, 255, 255, 0.96);
    color: var(--text);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.hero-card,
.info-card,
.trust-item {
    padding: 24px;
}

.hero-card h2,
.info-card h2,
.upload-card h2,
.loading-card h2,
.results-card h2,
.legal-card h1,
.legal-card h2,
.cta-panel h3,
.result-section h3 {
    color: var(--text);
}

.hero-card p,
.info-card li,
.trust-item span,
.upload-description,
.loading-text,
.result-body p,
.result-body li,
.cta-panel p,
.site-footer p,
.legal-card p,
.legal-card li {
    color: var(--text-soft);
    line-height: 1.7;
}

.hero-card h2,
.info-card h2,
.upload-card h2,
.loading-card h2,
.results-card h2 {
    margin-bottom: 10px;
}

.accent-card {
    background: linear-gradient(160deg, #103320 0%, #0b2216 100%);
    color: #edf7f0;
}

.accent-card h2,
.accent-card p,
.accent-card a {
    color: #edf7f0;
}

.trust-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 30px 0;
}

.trust-item strong {
    display: block;
    color: var(--text);
    margin-bottom: 6px;
    font-size: 1.03rem;
}

.analyzer-shell {
    margin: 10px 0 30px;
}

.upload-card,
.loading-card,
.results-card,
.legal-card {
    padding: 34px;
}

.upload-card,
.loading-card {
    text-align: center;
}

.upload-icon {
    width: 88px;
    height: 88px;
    border-radius: 24px;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(31, 179, 90, 0.1);
    color: var(--brand-dark);
}

.upload-bullets,
.info-card ul,
.result-body ul,
.legal-card ul {
    padding-left: 20px;
}

.upload-bullets {
    display: inline-block;
    text-align: left;
    margin: 18px auto 22px;
}

.file-input {
    display: none;
}

.file-info {
    align-items: center;
    justify-content: space-between;
    background: var(--panel-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin: 18px 0 12px;
}

.file-details {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--brand-ink);
    min-width: 0;
}

#fileName {
    word-break: break-word;
}

.remove-file {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: #f04438;
    color: white;
    font-size: 1.45rem;
    cursor: pointer;
}

.status-message {
    min-height: 22px;
    margin-top: 12px;
    font-size: 0.96rem;
    font-weight: 600;
}

.status-message[data-tone="success"] {
    color: var(--brand-ink);
}

.status-message[data-tone="error"] {
    color: var(--warning);
}

.drag-active {
    outline: 2px dashed rgba(31, 179, 90, 0.7);
    outline-offset: 6px;
}

.loader {
    width: 110px;
    height: 110px;
    margin: 0 auto 22px;
    position: relative;
}

.spinner,
.pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
}

.spinner {
    border: 4px solid rgba(31, 179, 90, 0.16);
    border-top-color: var(--brand);
    border-right-color: #39d375;
    animation: spin 1s linear infinite;
}

.pulse-ring {
    border: 4px solid rgba(31, 179, 90, 0.45);
    animation: pulse 2s ease-out infinite;
}

.progress-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}

.progress-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand);
    animation: bounce 1.2s infinite ease-in-out;
}

.progress-dots span:nth-child(2) { animation-delay: 0.2s; }
.progress-dots span:nth-child(3) { animation-delay: 0.4s; }

.results-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 22px;
}

.results-content {
    display: grid;
    gap: 16px;
}

.result-section {
    background: var(--panel-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
}

.result-error {
    border-color: rgba(180, 35, 24, 0.18);
    background: #fff5f4;
}

.result-section h3 {
    margin-bottom: 12px;
    font-size: 1.12rem;
}

.result-body p + p,
.result-body ul + p,
.result-body p + ul,
.legal-card p + ul,
.legal-card ul + p,
.legal-card p + h2,
.legal-card ul + h2 {
    margin-top: 12px;
}

.result-list {
    padding-left: 20px;
}

.result-list li + li {
    margin-top: 10px;
}

.operations-grid {
    display: grid;
    gap: 14px;
}

.operation-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
}

.operation-card h4 {
    margin-bottom: 10px;
    color: var(--text);
    font-size: 1.02rem;
}

.operation-card p + p {
    margin-top: 10px;
}

.speech-card .result-list li {
    font-style: italic;
}

.vehicle-card {
    background: linear-gradient(160deg, rgba(31, 179, 90, 0.08), rgba(31, 179, 90, 0.02));
}

.cta-panel {
    margin-top: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(31, 179, 90, 0.22);
    background: linear-gradient(160deg, rgba(31, 179, 90, 0.08), rgba(31, 179, 90, 0.02));
    padding: 24px;
}

.cta-panel h3 {
    margin-bottom: 10px;
}

.cta-note {
    display: inline-block;
    color: var(--text-soft);
    font-size: 0.95rem;
    max-width: 480px;
}

.info-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.site-footer {
    margin: 28px 0 18px;
    padding: 18px 0 8px;
    text-align: center;
}

.footer-links {
    justify-content: center;
    margin-top: 14px;
}

.footer-links a,
.site-footer p,
.site-footer strong {
    color: rgba(247, 250, 248, 0.88);
}

.footer-links a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.legal-shell {
    max-width: 920px;
    margin: 0 auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #f7faf8;
    text-decoration: none;
    margin-bottom: 18px;
}

.legal-card h1 {
    font-size: 2.3rem;
    margin-bottom: 10px;
}

.legal-card h2 {
    margin-top: 28px;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.last-updated {
    color: var(--text-soft);
    margin-bottom: 20px;
    font-style: italic;
}

.callout {
    border-left: 4px solid var(--brand);
    background: #effaf2;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 14px 16px;
    margin: 16px 0;
}

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

@keyframes pulse {
    0% { transform: scale(0.92); opacity: 0.55; }
    100% { transform: scale(1.26); opacity: 0; }
}

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0.4); opacity: 0.45; }
    40% { transform: scale(1); opacity: 1; }
}

@media (max-width: 980px) {
    .brand-row,
    .hero-grid,
    .trust-strip,
    .info-grid {
        grid-template-columns: 1fr;
    }

    .brand-row {
        gap: 20px;
    }

    .logo {
        max-width: 180px;
    }
}

@media (max-width: 720px) {
    body {
        padding: 16px;
    }

    .upload-card,
    .loading-card,
    .results-card,
    .legal-card,
    .hero-card,
    .info-card,
    .trust-item {
        padding: 22px;
    }

    .results-header {
        flex-direction: column;
        align-items: stretch;
    }

    .results-actions,
    .hero-actions,
    .cta-actions,
    .footer-links {
        flex-direction: column;
        align-items: stretch;
    }

    .primary-link,
    .secondary-link,
    .submit-btn,
    .new-analysis-btn,
    .ghost-btn,
    .file-label {
        width: 100%;
    }

    .legal-card h1 {
        font-size: 1.85rem;
    }
}
