/* GON application form widget (mounted by apply-form.js).
   All classes are ga-prefixed so the widget can sit inside any page.
   Brand token fallbacks are inlined so it also works on pages that
   don't define the :root custom properties. */

.ga {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    text-align: left;
    scroll-margin-top: 88px; /* clear the fixed nav when scrolled to */
    font-family: Helvetica, 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-1, #b8b8b8);
    font-size: 17px;
    line-height: 1.6;
}
.ga *, .ga *::before, .ga *::after { box-sizing: border-box; }

/* ===== Progress bar ===== */
.ga__bar {
    height: 4px;
    border-radius: 999px;
    background: var(--bg-3, rgba(255,255,255,0.06));
    overflow: hidden;
    margin-bottom: 16px;
}
.ga__fill {
    height: 100%;
    width: 0%;
    background: var(--teal, #27bba8);
    transition: width 0.35s ease;
}

/* ===== Back button row (height reserved so the layout never jumps) ===== */
.ga__head { min-height: 40px; margin-bottom: 8px; }
.ga__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 8px;
    color: var(--text-2, #8a8a8a);
    font-family: inherit;
    font-size: 13px;
    padding: 8px 12px;
    cursor: pointer;
    min-height: 40px;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.ga__back:hover {
    color: var(--text-0, #f2f2f2);
    border-color: var(--border-strong, rgba(255,255,255,0.16));
    background: var(--bg-2, rgba(255,255,255,0.03));
}
.ga__back svg { width: 14px; height: 14px; }
.ga__back[hidden] { display: none; }

/* ===== Screen ===== */
.ga__screen {
    min-height: 380px;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.ga__screen.is-leaving-up    { opacity: 0; transform: translateY(-18px); }
.ga__screen.is-leaving-down  { opacity: 0; transform: translateY(18px); }
.ga__screen.is-entering-up   { opacity: 0; transform: translateY(18px); transition: none; }
.ga__screen.is-entering-down { opacity: 0; transform: translateY(-18px); transition: none; }

.ga-title {
    font-size: clamp(1.35rem, 3.2vw, 1.8rem);
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -0.015em;
    text-transform: none;
    color: var(--text-0, #f2f2f2);
    margin: 0 0 16px;
}
.ga-sub {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-2, #8a8a8a);
    margin: -8px 0 16px;
}
.ga-body { margin-top: 24px; }

/* ===== Single-choice options ===== */
.ga-opts { display: flex; flex-direction: column; gap: 10px; }
.ga-opt {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 56px;
    text-align: left;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.45;
    color: var(--text-0, #f2f2f2);
    background: var(--bg-2, rgba(255,255,255,0.03));
    border: 1px solid var(--border-strong, rgba(255,255,255,0.16));
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.ga-opt:hover { border-color: var(--teal, #27bba8); background: var(--bg-3, rgba(255,255,255,0.06)); }
.ga-opt:focus-visible { outline: none; border-color: var(--teal, #27bba8); box-shadow: 0 0 0 3px rgba(39,187,168,0.18); }
.ga-opt.is-selected {
    border-color: var(--teal, #27bba8);
    background: var(--teal-light, rgba(39,187,168,0.08));
    box-shadow: 0 0 0 1px var(--teal, #27bba8);
}
.ga-opt__key {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    height: 26px;
    padding: 0 6px;
    border: 1px solid var(--border-strong, rgba(255,255,255,0.16));
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-2, #8a8a8a);
    background: var(--bg-1, #111111);
}
.ga-opt.is-selected .ga-opt__key { border-color: var(--teal, #27bba8); color: var(--teal-bright, #3dd4bf); }
.ga-opt__label { flex: 1; }
.ga-opt__label strong { display: block; color: var(--text-0, #f2f2f2); font-weight: 700; }
.ga-opt__label small { display: block; color: var(--text-2, #8a8a8a); font-size: 14px; }
.ga-opt__tick { flex-shrink: 0; width: 18px; height: 18px; color: var(--teal-bright, #3dd4bf); opacity: 0; transition: opacity 0.15s ease; }
.ga-opt.is-selected .ga-opt__tick { opacity: 1; }

/* ===== Multi-select icon cards ===== */
.ga-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
@media (min-width: 720px) { .ga-cards { grid-template-columns: repeat(4, 1fr); } }
.ga-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 108px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.35;
    font-weight: 600;
    text-align: center;
    color: var(--text-0, #f2f2f2);
    background: var(--bg-2, rgba(255,255,255,0.03));
    border: 1px solid var(--border-strong, rgba(255,255,255,0.16));
    border-radius: 12px;
    padding: 16px 10px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease;
}
.ga-card:hover { border-color: var(--teal, #27bba8); background: var(--bg-3, rgba(255,255,255,0.06)); }
.ga-card:focus-visible { outline: none; border-color: var(--teal, #27bba8); box-shadow: 0 0 0 3px rgba(39,187,168,0.18); }
.ga-card svg { width: 26px; height: 26px; color: var(--text-2, #8a8a8a); transition: color 0.2s ease; }
.ga-card.is-selected {
    border-color: var(--teal, #27bba8);
    background: var(--teal-light, rgba(39,187,168,0.08));
    box-shadow: 0 0 0 1px var(--teal, #27bba8);
}
.ga-card.is-selected svg { color: var(--teal-bright, #3dd4bf); }

/* ===== Text inputs ===== */
.ga-field { display: flex; flex-direction: column; margin-bottom: 24px; }
.ga-field:last-child { margin-bottom: 0; }
.ga-field label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-1, #b8b8b8);
    margin-bottom: 6px;
}
.ga-field input,
.ga-field select,
.ga-field textarea {
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-0, #f2f2f2);
    background: var(--bg-1, #111111);
    border: 1px solid var(--border-strong, rgba(255,255,255,0.16));
    border-radius: 10px;
    padding: 14px 16px;
    width: 100%;
    min-height: 52px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}
.ga-field input::placeholder,
.ga-field textarea::placeholder { color: var(--text-3, #5a5a5a); }
.ga-field input:focus,
.ga-field select:focus,
.ga-field textarea:focus {
    outline: none;
    border-color: var(--teal, #27bba8);
    box-shadow: 0 0 0 3px rgba(39,187,168,0.18);
}
.ga-field textarea { resize: vertical; min-height: 140px; }
.ga-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238a8a8a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}
.ga-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 600px) { .ga-row { grid-template-columns: 1fr 1fr; } }
.ga-phone { display: grid; grid-template-columns: 118px 1fr; gap: 8px; }

.ga-error {
    display: none;
    font-size: 14px;
    color: var(--danger, #ff5c5c);
    margin: 16px 0 0;
}
.ga-error.is-visible { display: block; }
.ga-field.has-error input,
.ga-field.has-error textarea { border-color: var(--danger, #ff5c5c); }

/* ===== Buttons ===== */
.ga-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
}
.ga-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--teal, #27bba8);
    color: #06201d;
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 14px 28px;
    min-height: 52px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.ga-next:hover { background: var(--teal-bright, #3dd4bf); transform: translateY(-1px); box-shadow: 0 10px 28px var(--teal-glow, rgba(39,187,168,0.35)); }
.ga-next:active { transform: translateY(0); }
.ga-next svg { width: 16px; height: 16px; }
.ga-next[hidden] { display: none; }
.ga-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: transparent;
    color: var(--text-0, #f2f2f2);
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 14px 28px;
    min-height: 52px;
    border: 1px solid var(--border-strong, rgba(255,255,255,0.16));
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.ga-ghost:hover { background: var(--bg-2, rgba(255,255,255,0.03)); border-color: var(--teal, #27bba8); color: var(--text-0, #f2f2f2); }
.ga-hint { font-size: 13px; color: var(--text-3, #5a5a5a); }
.ga-hint strong { color: var(--text-2, #8a8a8a); font-weight: 700; }

/* CTA buttons go full width on mobile */
@media (max-width: 600px) {
    .ga-hint { display: none; }
    .ga-actions { flex-direction: column; align-items: stretch; }
    .ga-next, .ga-ghost { width: 100%; }
}

/* ===== Completion screens ===== */
.ga-done { text-align: center; }
.ga-done p { max-width: 520px; margin: 0 auto 24px; }
.ga-spinner {
    width: 36px; height: 36px;
    margin: 32px auto 0;
    border: 3px solid var(--bg-3, rgba(255,255,255,0.06));
    border-top-color: var(--teal, #27bba8);
    border-radius: 999px;
    animation: ga-spin 0.8s linear infinite;
}
@keyframes ga-spin { to { transform: rotate(360deg); } }

.ga-cal { display: none; margin-top: 32px; }
.ga-cal.is-visible { display: block; }
.ga-cal iframe {
    width: 100%;
    border: 0;
    display: block;
    min-height: 720px;
    border-radius: 12px;
    background: var(--bg-1, #111111);
}
.ga.is-calendar { max-width: 860px; }

.ga-dq {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    margin-top: 32px;
}
@media (min-width: 600px) { .ga-dq { flex-direction: row; justify-content: center; align-items: center; } }

@media (prefers-reduced-motion: reduce) {
    .ga__screen { transition: none; }
    .ga__fill { transition: none; }
    .ga-spinner { animation-duration: 1.6s; }
}
