@import url('https://fonts.googleapis.com/css2?family=Syne:wght@600;700&family=DM+Sans:wght@400;500;600&display=swap');

/* ── Variables ─────────────────────────────────────────────────────────── */
#tsf-root {
    --accent:         #00d4ff;
    --accent2:        #b794f4;
    --text:           #ffffff;
    --subtext:        rgba(255,255,255,.85);
    --muted:          rgba(255,255,255,.5);
    --field-bg:       rgba(255,255,255,.12);
    --field-bd:       rgba(255,255,255,.25);
    --field-hover-bd: rgba(0,212,255,.7);
    --radius:         14px;
}

/* ── Outer container ───────────────────────────────────────────────────── */
#tsf-root {
    display: block;
    width: 100%;
    padding: 32px;
    background: linear-gradient(140deg, #1a2340 0%, #2d1f5e 50%, #1a3040 100%);
    border-radius: 24px;
    overflow: visible;
    font-family: 'DM Sans', sans-serif;
    box-sizing: border-box;
}

/* ── Glass card — full width ───────────────────────────────────────────── */
#tsf-root .tsf-glass {
    display: block;
    width: 100%;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.22);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 20px;
    padding: 28px 32px 24px;
    box-sizing: border-box;
    box-shadow:
        0 4px 6px rgba(0,0,0,.1),
        0 20px 60px rgba(0,0,0,.35),
        inset 0 1px 0 rgba(255,255,255,.2);
    position: relative;
    z-index: 1;
}

/* ── Header ────────────────────────────────────────────────────────────── */
#tsf-root .tsf-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Syne', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: .04em;
    margin-bottom: 24px;
    white-space: nowrap;
}
#tsf-root .tsf-header svg {
    color: var(--accent);
    flex-shrink: 0;
}

/* ── Row form ──────────────────────────────────────────────────────────── */
#tsf-root .tsf-form {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
    position: relative;
    z-index: 10;             /* sits above page content so dropdowns clear it */
}

/* ── Column (label + select) ───────────────────────────────────────────── */
#tsf-root .tsf-col {
    flex: 1 1 0;             /* equal stretch across full row */
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    z-index: 10;
}

#tsf-root .tsf-col label {
    font-size: .88rem;       /* bigger label */
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--subtext);
    padding-left: 2px;
    white-space: nowrap;
}

#tsf-root .tsf-col select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--field-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='rgba(255,255,255,.6)' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px 8px;
    border: 1.5px solid var(--field-bd);
    border-radius: var(--radius);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    padding: 12px 36px 12px 14px;
    cursor: pointer;
    line-height: 1.4;
    position: relative;
    z-index: 10;
    transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
}

#tsf-root .tsf-col select option {
    background: #1e1b4b;
    color: #f0f4ff;
    font-size: 1rem;
}

#tsf-root .tsf-col select:not(:disabled):hover {
    border-color: var(--field-hover-bd);
    background-color: rgba(255,255,255,.16);
}

#tsf-root .tsf-col select:not(:disabled):focus {
    border-color: var(--accent);
    background-color: rgba(0,212,255,.08);
    box-shadow: 0 0 0 3px rgba(0,212,255,.2);
    outline: none;
    z-index: 100;            /* open dropdown floats above everything */
}

#tsf-root .tsf-col select:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* ── Separator ( / and R ) ─────────────────────────────────────────────── */
#tsf-root .tsf-sep {
    flex-shrink: 0;
    font-family: 'Syne', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent2);
    padding-bottom: 12px;
    align-self: flex-end;
    user-select: none;
    opacity: .85;
    line-height: 1;
}

/* ── Submit button ─────────────────────────────────────────────────────── */
#tsf-root button[type="submit"] {
    flex-shrink: 0;
    align-self: flex-end;
    padding: 12px 22px;
    background: linear-gradient(135deg, #7c3aed, #2563eb);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: 'Syne', sans-serif;
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .04em;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(124,58,237,.45);
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
    line-height: 1.4;
}

#tsf-root button[type="submit"]:disabled {
    opacity: .35;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

#tsf-root button[type="submit"]:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(124,58,237,.6);
}

#tsf-root button[type="submit"]:not(:disabled):active {
    transform: translateY(0);
}

/* ── Hint text ─────────────────────────────────────────────────────────── */
#tsf-root .tsf-hint {
    margin: 18px 0 0;
    font-size: .85rem;
    color: var(--muted);
    text-align: center;
    transition: color .3s ease;
    min-height: 1.2em;
}

/* ── Loading state ─────────────────────────────────────────────────────── */
@keyframes tsf-pulse {
    0%, 100% { opacity: .4; }
    50%       { opacity: .75; }
}
#tsf-root .tsf-col select.tsf-loading {
    animation: tsf-pulse 1.2s ease-in-out infinite;
    pointer-events: none;
}

/* ── Mobile — single column stack ──────────────────────────────────────── */
@media (max-width: 600px) {
    #tsf-root {
        padding: 24px 16px;
    }
    #tsf-root .tsf-glass {
        padding: 24px 20px 22px;
    }
    #tsf-root .tsf-form {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }
    #tsf-root .tsf-col {
        width: 100%;
        flex: none;
    }
    #tsf-root .tsf-col select {
        padding: 14px 36px 14px 14px;
        font-size: 1.05rem;
    }
    #tsf-root .tsf-col label {
        font-size: .92rem;
    }
    #tsf-root .tsf-sep {
        display: none;
    }
    #tsf-root button[type="submit"] {
        width: 100%;
        padding: 15px;
        font-size: 1rem;
        margin-top: 2px;
        justify-content: center;
        text-align: center;
    }
}