:root {
    --grad-from: #7c6fcd;
    --grad-to:   #5b8dee;
    --accent:    #a78bfa;
    --bg:        #0e0d14;
    --card:      #17151f;
    --card-border: #2a2738;
    --text:      #e2e0ed;
    --muted:     #6b6880;
    --border:    #2a2738;
    --input-bg:  #12101a;
    --radius:    18px;
    --shadow:    0 4px 32px rgba(0,0,0,0.45);
}

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

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

/* ── Header ─────────────────────────────────────────────────────────────── */

header {
    padding: 56px 24px 48px;
    text-align: center;
    position: relative;
}

header::after {
    content: '';
    display: block;
    width: 64px;
    height: 2px;
    margin: 28px auto 0;
    background: linear-gradient(90deg, var(--grad-from), var(--grad-to));
    border-radius: 2px;
    opacity: 0.6;
}

.header-eyebrow {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 16px;
}

header h1 {
    font-size: clamp(2rem, 7vw, 3rem);
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1.1;
    background: linear-gradient(130deg, #c4b5fd 0%, #818cf8 50%, #67e8f9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */

main {
    max-width: 620px;
    width: 100%;
    margin: 8px auto 40px;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    flex: 1;
}

/* ── Card ───────────────────────────────────────────────────────────────── */

.card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow);
    padding: 24px;
}

/* ── Form elements ──────────────────────────────────────────────────────── */

label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--muted);
    margin-bottom: 10px;
}

input[type="text"] {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-size: 0.97rem;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    font-family: inherit;
    color: var(--text);
    background: var(--input-bg);
}

input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(167,139,250,0.12);
}

input[type="text"]::placeholder { color: var(--muted); opacity: 0.6; }

button {
    display: block;
    width: 100%;
    padding: 13px;
    margin-top: 12px;
    border: none;
    border-radius: 12px;
    font-size: 0.97rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    font-family: inherit;
    background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
    color: white;
}

button:hover  { opacity: 0.88; }
button:active { transform: scale(0.99); }
button:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

/* ── Error ──────────────────────────────────────────────────────────────── */

.error-msg {
    margin-top: 12px;
    padding: 12px 14px;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: 10px;
    color: #f87171;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ── Result ─────────────────────────────────────────────────────────────── */

.result-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}

.result-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--accent);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-count {
    font-size: 0.82rem;
    color: var(--muted);
    white-space: nowrap;
}

textarea {
    width: 100%;
    height: 260px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    font-family: 'SF Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.84rem;
    resize: vertical;
    outline: none;
    background: var(--input-bg);
    line-height: 1.65;
    color: var(--text);
}

/* ── Options (checkboxes) ───────────────────────────────────────────────── */

.options {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.option-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    text-transform: none;
    letter-spacing: 0;
    margin-bottom: 0;
    padding: 8px 14px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: var(--input-bg);
    transition: border-color 0.15s, background 0.15s;
    user-select: none;
}

.option-label:has(input:checked) {
    border-color: var(--accent);
    background: rgba(167,139,250,0.08);
}

.option-label input[type="checkbox"] { display: none; }

.checkmark {
    width: 17px;
    height: 17px;
    border: 1.5px solid var(--border);
    border-radius: 5px;
    background: var(--input-bg);
    flex-shrink: 0;
    display: grid;
    place-items: center;
    transition: background 0.15s, border-color 0.15s;
}

.option-label:has(input:checked) .checkmark {
    background: var(--accent);
    border-color: var(--accent);
}

.checkmark::after {
    content: '';
    width: 4px;
    height: 8px;
    border: 2px solid white;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
    opacity: 0;
    transition: opacity 0.1s;
}

.option-label:has(input:checked) .checkmark::after { opacity: 1; }

/* ── Misc ───────────────────────────────────────────────────────────────── */

.hidden { display: none; }

.spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
    vertical-align: middle;
    margin-right: 7px;
}

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

/* ── Promo cards ────────────────────────────────────────────────────────── */

.promo-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
}

.promo-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    line-height: 1;
}

.promo-body { flex: 1; min-width: 0; }

.promo-title {
    font-weight: 700;
    font-size: 0.93rem;
    margin-bottom: 4px;
    color: var(--text);
}

.promo-text {
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.5;
}

.promo-text b { color: var(--text); }

.promo-btn {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
    transition: color 0.15s, border-color 0.15s;
}

.promo-btn:hover { color: var(--text); border-color: var(--muted); }

.promo-btn--partner {
    background: linear-gradient(135deg, var(--grad-from), var(--grad-to));
    color: white;
    border: none;
    transition: opacity 0.15s;
}

.promo-btn--partner:hover { color: white; border-color: transparent; opacity: 0.82; }

.promo-card--partner {
    display: none; /* flex; */
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    
}

.partner-logo-wide {
    display: block;
    width: 160px;
    height: auto;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.promo-btn--partner {
    background: linear-gradient(135deg, #3a4ee0, #4d5dff);
    margin-top: 14px;
    text-align: center;
    display: inline-block;
    width: 100%;
}

@media (max-width: 480px) {
    .promo-card { flex-wrap: wrap; }
    .promo-btn  { width: 100%; text-align: center; }
}

/* ── Footer ─────────────────────────────────────────────────────────────── */

footer {
    text-align: center;
    padding: 28px 16px;
    color: var(--muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--card-border);
}

footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }
footer span { margin: 0 6px; opacity: 0.35; }

