:root {
    --bg: #0b1020;
    --panel: #121a2e;
    --panel-soft: #1a2540;
    --text: #e5edf9;
    --muted: #99a7bf;
    --accent: #14b8a6;
    --accent-strong: #0d9488;
    --border: #2a3756;
    --danger: #f87171;
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

:root[data-theme="light"] {
    --bg: #f4f6fb;
    --panel: #ffffff;
    --panel-soft: #eef2ff;
    --text: #1e293b;
    --muted: #64748b;
    --accent: #0f766e;
    --accent-strong: #115e59;
    --border: #dbe3ee;
    --danger: #b91c1c;
    --shadow: 0 20px 40px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at 10% -10%, rgba(20, 184, 166, 0.28) 0%, transparent 45%),
        radial-gradient(circle at 100% 0%, rgba(56, 189, 248, 0.22) 0%, transparent 40%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
}

.wrapper {
    width: min(1200px, 94vw);
    margin: 0 auto;
    padding: 2rem 0 2.5rem;
}

.hero {
    background: linear-gradient(135deg, #0f766e, #0b5f73);
    border-radius: 20px;
    padding: 1.5rem;
    color: #ffffff;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.hero h1 {
    margin: 0 0 0.45rem;
    font-size: clamp(1.4rem, 2.2vw, 2rem);
}

.hero-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    position: relative;
}

.hero-top h1 {
    width: 100%;
    text-align: center;
    margin: 0;
}

.hero p {
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
    text-align: center;
    max-width: 900px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(280px, 360px) 1fr;
    gap: 1rem;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
}

.card h2 {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    text-align: center;
}

.card p {
    margin: 0 0 0.75rem;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.45;
}

.select-card {
    position: relative;
    padding-bottom: 3.2rem;
}

.netlify-badge {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    display: inline-flex;
    line-height: 0;
}

.netlify-badge img {
    max-width: 100%;
    height: auto;
}

.file-label {
    display: inline-block;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

select {
    width: 100%;
    border: 1px solid var(--border);
    background: var(--panel-soft);
    border-radius: 12px;
    padding: 0.7rem;
    cursor: pointer;
    color: var(--text);
    font-size: 0.95rem;
}

select:focus-visible,
button:focus-visible,
.action-link:focus-visible {
    outline: 2px solid #38bdf8;
    outline-offset: 2px;
}

.file-meta {
    margin-top: 0.65rem;
    min-height: 1.2rem;
    color: var(--muted);
    font-size: 0.9rem;
    word-break: break-all;
    white-space: pre-line;
}

.actions {
    margin-top: 0.8rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

button,
.action-link {
    border: 0;
    border-radius: 10px;
    padding: 0.55rem 0.85rem;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

button:hover,
.action-link:hover {
    transform: translateY(-1px);
}

.btn-danger {
    background: #3a1820;
    color: var(--danger);
}

.btn-primary {
    background: var(--accent);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--accent-strong);
}

.btn-theme {
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.28);
    backdrop-filter: blur(4px);
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.action-link {
    background: #12363a;
    color: #7ce7d6;
    pointer-events: none;
    opacity: 0.5;
}

.action-link.active {
    pointer-events: auto;
    opacity: 1;
}

.pdf-frame {
    width: 100%;
    height: 68vh;
    min-height: 460px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #0f172a;
}

.empty {
    width: 100%;
    height: 68vh;
    min-height: 460px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    display: grid;
    place-items: center;
    color: var(--muted);
    background: linear-gradient(180deg, #111a2f, #0f172a);
    text-align: center;
    padding: 1rem;
}

.footer-note {
    margin-top: 1rem;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: center;
}

:root[data-theme="light"] .btn-danger {
    background: #fee2e2;
    color: var(--danger);
}

:root[data-theme="light"] .action-link {
    background: #d1fae5;
    color: #065f46;
}

:root[data-theme="light"] .pdf-frame {
    background: #ffffff;
}

:root[data-theme="light"] .empty {
    background: linear-gradient(180deg, #fafbff, #f6f8fc);
}

@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .hero-top {
        flex-direction: column;
        align-items: center;
    }

    .btn-theme {
        position: static;
        transform: none;
    }

    .pdf-frame,
    .empty {
        height: 60vh;
        min-height: 360px;
    }
}
