:root {
    --bg-0: #06080f;
    --bg-1: #0f1729;
    --card: rgba(10, 16, 30, 0.82);
    --line: rgba(123, 240, 255, 0.25);
    --text-main: #e9f2ff;
    --text-soft: #9fb4d8;
    --accent-cyan: #43f4ff;
    --accent-lime: #a6ff5f;
    --accent-orange: #ff9749;
    --danger: #ff5c80;
    --radius: 16px;
    --shadow: 0 20px 55px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: 'Exo 2', sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at 10% 0%, rgba(67, 244, 255, 0.17), transparent 38%),
        radial-gradient(circle at 95% 95%, rgba(255, 151, 73, 0.13), transparent 35%),
        linear-gradient(140deg, var(--bg-0), var(--bg-1));
    overflow-x: hidden;
}

.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: radial-gradient(circle at center, black 55%, transparent 100%);
}

.app-wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 18px 40px;
}

.hero {
    margin-bottom: 22px;
    animation: rise-in 0.6s ease;
}

.kicker {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
    color: var(--accent-lime);
    font-weight: 700;
}

h1 {
    margin: 6px 0;
    font-size: clamp(1.65rem, 4vw, 2.55rem);
    line-height: 1.15;
    text-wrap: balance;
}

.lead {
    margin: 0;
    color: var(--text-soft);
    max-width: 70ch;
}

.alert {
    background: rgba(255, 92, 128, 0.18);
    border: 1px solid rgba(255, 92, 128, 0.48);
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 16px;
}

.grid-layout {
    display: grid;
    gap: 16px;
    grid-template-columns: 1.05fr 0.95fr;
}

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(6px);
    animation: rise-in 0.65s ease;
}

.form-card {
    padding: 18px;
}

.preview-card {
    padding: 16px;
    position: relative;
}

h2 {
    margin: 4px 0 14px;
    font-size: 1.1rem;
}

.field-row {
    margin-bottom: 12px;
}

.field-row label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-soft);
    font-size: 0.9rem;
    font-weight: 600;
}

.two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

input,
select {
    width: 100%;
    border: 1px solid rgba(160, 205, 240, 0.32);
    background: rgba(6, 9, 18, 0.82);
    color: var(--text-main);
    border-radius: 11px;
    padding: 10px 12px;
    font: inherit;
    outline: none;
    transition: border-color 0.22s ease, box-shadow 0.22s ease;
}

input:focus,
select:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(67, 244, 255, 0.15);
}

.toggles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.toggles label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 0.92rem;
    padding: 10px;
    border: 1px solid rgba(160, 205, 240, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 14px;
}

.btn {
    border: none;
    border-radius: 11px;
    padding: 10px 12px;
    font: inherit;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(120deg, var(--accent-cyan), #27d1ff 55%, #1ea4ff);
    color: #042033;
    box-shadow: 0 8px 25px rgba(55, 202, 255, 0.45);
}

.btn-muted {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid rgba(160, 205, 240, 0.24);
}

.preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.status {
    font-size: 0.78rem;
    color: var(--accent-lime);
    border: 1px solid rgba(166, 255, 95, 0.38);
    background: rgba(166, 255, 95, 0.11);
    border-radius: 999px;
    padding: 4px 10px;
}

.indicators {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(160, 205, 240, 0.22);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-soft);
    font-size: 0.84rem;
}

.indicator b {
    color: var(--accent-cyan);
}

.code-window {
    margin: 0;
    min-height: 490px;
    max-height: 68vh;
    overflow: auto;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(160, 205, 240, 0.22);
    background:
        linear-gradient(180deg, rgba(1, 4, 12, 0.78), rgba(1, 4, 12, 0.95));
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.92rem;
    color: #c3ffd7;
    line-height: 1.45;
    white-space: pre-wrap;
}

.flash {
    animation: flash 0.45s ease;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes flash {
    0% {
        box-shadow: 0 0 0 rgba(67, 244, 255, 0);
    }
    40% {
        box-shadow: 0 0 0 4px rgba(67, 244, 255, 0.17);
    }
    100% {
        box-shadow: 0 0 0 rgba(67, 244, 255, 0);
    }
}

@media (max-width: 980px) {
    .grid-layout {
        grid-template-columns: 1fr;
    }

    .code-window {
        min-height: 340px;
    }
}

@media (max-width: 640px) {
    .two-cols,
    .toggles,
    .actions {
        grid-template-columns: 1fr;
    }

    .indicators {
        grid-template-columns: 1fr;
    }

    .app-wrap {
        padding: 18px 12px 24px;
    }
}
