:root {
    color-scheme: dark;
    --bg: #07111f;
    --bg-accent: #0d1b2f;
    --panel: rgba(10, 18, 32, 0.86);
    --panel-strong: rgba(14, 24, 42, 0.96);
    --border: rgba(148, 163, 184, 0.18);
    --text: #e5eefc;
    --muted: #8ea3c7;
    --accent: #63e6be;
    --accent-strong: #2dd4bf;
    --accent-soft: rgba(99, 230, 190, 0.16);
    --danger: #ff7b8a;
    --danger-bg: rgba(255, 123, 138, 0.14);
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.38);
    --radius-xl: 28px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
}

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

body {
    font-family: "Manrope", "Segoe UI", sans-serif;
    min-height: 100vh;
    padding: 32px 20px;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(45, 212, 191, 0.18), transparent 34%),
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.16), transparent 26%),
        linear-gradient(160deg, #050b14 0%, #091321 46%, #030711 100%);
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: auto;
    pointer-events: none;
    z-index: 0;
    border-radius: 999px;
    filter: blur(80px);
    opacity: 0.5;
}

body::before {
    width: 240px;
    height: 240px;
    top: 10%;
    left: -60px;
    background: rgba(45, 212, 191, 0.18);
}

body::after {
    width: 280px;
    height: 280px;
    right: -80px;
    bottom: 8%;
    background: rgba(59, 130, 246, 0.16);
}

.shell {
    position: relative;
    z-index: 1;
    max-width: 1120px;
    margin: 0 auto;
}

.container {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(10, 18, 32, 0.92) 0%, rgba(7, 13, 24, 0.98) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(22px);
}

.container::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 230, 190, 0.09), transparent 34%, rgba(96, 165, 250, 0.08));
    pointer-events: none;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 28px;
    padding: 32px;
    border-bottom: 1px solid var(--border);
}

.hero-copy {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid rgba(99, 230, 190, 0.22);
}

h1 {
    font-size: clamp(34px, 5vw, 54px);
    line-height: 0.96;
    letter-spacing: -0.04em;
    max-width: 10ch;
}

.hero-copy p {
    max-width: 60ch;
    color: var(--muted);
    line-height: 1.7;
    font-size: 15px;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-content: start;
}

.stat-card {
    padding: 18px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
}

.stat-card strong {
    display: block;
    font-size: 26px;
    margin-bottom: 8px;
}

.stat-card span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.content {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
    gap: 28px;
    padding: 32px;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 24px;
}

.panel h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.panel-intro {
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 24px;
    font-size: 14px;
}

.form-grid {
    display: grid;
    gap: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    font-weight: 700;
    color: #d6e2f6;
    letter-spacing: 0.01em;
}

.hint {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.field-error {
    display: none;
    color: #ffb4be;
    font-size: 12px;
    line-height: 1.5;
}

.field-error.visible {
    display: block;
}

.field-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.form-row .form-group label,
.form-row .form-group .field-label {
    display: block;
    min-height: 44px;
    line-height: 1.2;
}

.form-row .form-group .field-label {
    white-space: normal;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    height: 52px;
    padding: 14px 16px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(99, 230, 190, 0.26);
    background: linear-gradient(180deg, rgba(18, 30, 52, 0.96) 0%, rgba(10, 19, 34, 0.98) 100%);
    color: var(--text);
    font-size: 15px;
    line-height: 1.4;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 0 0 1px rgba(99, 230, 190, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
    appearance: none;
}

select {
    padding-right: 16px;
}

input::placeholder {
    color: #6f86ab;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: rgba(99, 230, 190, 0.65);
    box-shadow: 0 0 0 4px rgba(99, 230, 190, 0.12);
    transform: translateY(-1px);
}

.hidden {
    display: none;
}

button {
    width: 100%;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.01em;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.primary-btn,
.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 20px;
    border-radius: 999px;
    color: #04111d;
    background: linear-gradient(135deg, #63e6be 0%, #5eead4 54%, #7dd3fc 100%);
    box-shadow: 0 18px 40px rgba(45, 212, 191, 0.22);
}

.primary-btn:hover,
.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 44px rgba(45, 212, 191, 0.28);
}

.primary-btn:active,
.btn-download:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.side-stack {
    display: grid;
    gap: 18px;
    align-content: start;
}

.info-card {
    padding: 22px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: var(--panel-strong);
}

.info-card h3,
.result-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

.info-list {
    display: grid;
    gap: 12px;
}

.info-item {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(148, 163, 184, 0.08);
}

.info-item strong {
    display: block;
    font-size: 13px;
    margin-bottom: 6px;
    color: #f8fbff;
}

.info-item span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.loading,
.error,
.results {
    display: none;
    margin: 0 32px 32px;
}

.loading.visible,
.error.visible,
.results.visible {
    display: block;
}

.loading {
    padding: 18px 20px;
    border-radius: 18px;
    background: rgba(99, 230, 190, 0.1);
    border: 1px solid rgba(99, 230, 190, 0.2);
    color: #b8ffe7;
    font-weight: 700;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 10px;
    vertical-align: -3px;
    border-radius: 50%;
    border: 3px solid rgba(184, 255, 231, 0.24);
    border-top-color: #63e6be;
    animation: spin 1s linear infinite;
}

.error {
    padding: 18px 20px;
    border-radius: 18px;
    background: var(--danger-bg);
    border: 1px solid rgba(255, 123, 138, 0.25);
    color: #ffd3d9;
}

.results-grid {
    display: grid;
    gap: 18px;
}

.result-section {
    padding: 22px;
    border-radius: 22px;
    background: rgba(9, 17, 31, 0.92);
    border: 1px solid var(--border);
}

.result-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.result-item {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.12);
    font-family: "JetBrains Mono", "SFMono-Regular", monospace;
    font-size: 13px;
    color: #dbe8ff;
    overflow-wrap: anywhere;
}

.result-list {
    display: grid;
    gap: 10px;
}

.result-empty {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(148, 163, 184, 0.2);
}

.download-row {
    display: flex;
    gap: 12px;
}

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

@media (max-width: 960px) {
    .hero,
    .content {
        grid-template-columns: 1fr;
    }
}

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

    .hero,
    .content {
        padding: 22px;
    }

    .loading,
    .error,
    .results {
        margin: 0 22px 22px;
    }

    .form-row,
    .hero-stats,
    .result-meta {
        grid-template-columns: 1fr;
    }

    h1 {
        max-width: none;
    }
}