/* Free trial — /trial/ (templates/user_accounts/trial/signup.html).
   Built on the app shell's tokens (static/css/app-shell.css), so light and
   dark follow the theme. Choices are native checkboxes / radios laid over
   each chip (invisible, full size), so a tap lands on the real control and
   keyboard focus shows on the chip. Phone rules at the end. */

.ft { max-width: 44rem; margin: 0 auto; padding: var(--space-2) 0 var(--space-6); }
.ft-card {
    padding: var(--space-6);
    background: var(--surface-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

/* Header: the offer, the four stops and a thin progress bar. */
.ft-head { margin-bottom: var(--space-5); }
.ft-offer { display: flex; align-items: center; gap: var(--space-3); }
.ft-offer-icon {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: var(--radius-lg);
    color: var(--color-brand-primary); background: var(--color-brand-soft);
}
.ft-offer div > b { display: block; font-size: var(--font-md); font-weight: var(--font-weight-bold); color: var(--text-primary); }
.ft-offer div > span { display: block; font-size: var(--font-sm); color: var(--text-muted); }
.ft-offer-icon i { font-size: 17px; }

.ft-steps { display: flex; gap: var(--space-2); margin: var(--space-5) 0 var(--space-2); padding: 0; list-style: none; }
.ft-steps li {
    flex: 1 1 0; display: flex; align-items: center; gap: 6px; min-width: 0;
    font-size: var(--font-xs); font-weight: var(--font-weight-semibold); color: var(--text-muted);
    white-space: nowrap;
}
.ft-steps li > span {
    flex: none; display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 999px;
    font-size: var(--font-xs); font-weight: var(--font-weight-bold);
    color: var(--text-muted); background: var(--surface-sunken); border: 1px solid var(--border-color);
}
.ft-steps li > span i { font-size: 9px; }
.ft-steps li.is-current { color: var(--text-primary); }
.ft-steps li.is-current > span { color: #fff; background: var(--brand-primary); border-color: var(--brand-primary); }
.ft-steps li.is-done > span { color: var(--positive-ink); background: var(--accent-soft); border-color: transparent; }
html.dark .ft-steps li.is-current > span { color: #0b1120; }
.ft-bar { height: 4px; overflow: hidden; border-radius: 999px; background: var(--surface-sunken); }
.ft-bar > span {
    display: block; width: 25%; height: 100%; border-radius: inherit;
    background: var(--brand-primary);
    transition: width .25s ease;
}

/* One question at a time. */
.ft-step { animation: ft-in .18s ease-out; }
@keyframes ft-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ft-kicker { margin: 0 0 4px; font-size: var(--font-xs); font-weight: var(--font-weight-bold); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.ft-q { margin: 0 0 var(--space-4); font-size: var(--font-xl); font-weight: var(--font-weight-bold); line-height: 1.25; letter-spacing: -.01em; color: var(--text-primary); }
.ft-q:focus { outline: none; }
.ft-hint { margin: calc(-1 * var(--space-3)) 0 var(--space-4); font-size: var(--font-base); color: var(--text-muted); }
.ft-sub { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: var(--space-4) 0 var(--space-2); font-size: var(--font-base); font-weight: var(--font-weight-semibold); color: var(--text-primary); }
.ft-sub:first-of-type { margin-top: 0; }
.ft-sub span { font-size: var(--font-xs); font-weight: var(--font-weight-medium); color: var(--text-muted); }
.ft-sub b { color: var(--accent); }

/* Chips. */
.ft-chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.ft-chip { position: relative; display: inline-flex; }
.ft-chip input {
    position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%;
    margin: 0; opacity: 0; cursor: pointer;
}
.ft-chip span {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 40px; padding: 0 14px;
    border: 1px solid var(--border-color); border-radius: 999px;
    font-size: var(--font-ui); font-weight: var(--font-weight-medium); color: var(--text-secondary);
    background: var(--surface-primary);
    transition: background-color .12s ease, border-color .12s ease, color .12s ease, transform .12s ease;
}
.ft-chip span i { font-size: 12px; color: var(--text-muted); }
.ft-chip:hover span { border-color: var(--border-strong); color: var(--text-primary); }
.ft-chip input:checked + span {
    color: var(--nav-active-text); background: var(--nav-active-bg); border-color: var(--accent-ring);
    box-shadow: inset 0 0 0 1px var(--accent-ring); font-weight: var(--font-weight-semibold);
}
.ft-chip input:checked + span i { color: var(--nav-active-text); }
.ft-chip input:checked + span::after {
    content: '\f00c'; content: '\f00c' / '';          /* a tick, silent for screen readers */
    font: var(--fa-font-solid); font-size: 10px; margin-left: 2px;
}
.ft-chip input:active + span { transform: scale(.97); }
.ft-chip input:focus-visible + span { outline: 2px solid var(--focus-color); outline-offset: 2px; }
.ft-chip input:disabled { cursor: not-allowed; }
.ft-chip input:disabled + span { opacity: .45; }

/* Experience: tiles, three across. */
.ft-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ft-tile, .ft-tile span { display: flex; width: 100%; }
.ft-tile span {
    flex-direction: column; justify-content: center; gap: 6px;
    min-height: 76px; padding: var(--space-3); border-radius: var(--radius-lg);
    text-align: center; font-weight: var(--font-weight-semibold);
}
.ft-tile span i { font-size: 18px; }
.ft-tile input:checked + span::after { display: none; }

/* Navigation between questions. */
.ft-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-5); }
.ft-nav--end { justify-content: flex-start; margin-top: var(--space-3); }

.ft-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 10px 18px; border-radius: var(--radius-md);
    border: 1px solid transparent; font: inherit; font-size: var(--font-base); font-weight: var(--font-weight-semibold);
    cursor: pointer; white-space: nowrap; text-decoration: none;
    transition: background-color .12s ease, border-color .12s ease, opacity .12s ease;
}
.ft-btn:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 2px; }
.ft-btn:disabled { cursor: not-allowed; opacity: .5; }
.ft-btn.is-busy { cursor: progress; }
.ft-btn.is-busy::after {
    content: ''; width: 14px; height: 14px; border-radius: 999px;
    border: 2px solid currentColor; border-right-color: transparent; animation: ft-spin .7s linear infinite;
}
@keyframes ft-spin { to { transform: rotate(360deg); } }
.ft-primary { color: var(--color-on-brand); background: var(--color-brand-button); }
.ft-primary:not(:disabled):hover { background: var(--brand-primary-hover); }
.ft-secondary { color: var(--text-primary); background: var(--surface-primary); border-color: var(--border-strong); }
.ft-secondary:not(:disabled):hover { background: var(--surface-hover); }
.ft-ghost { height: 38px; padding: 0 10px; color: var(--text-muted); background: none; }
.ft-ghost:hover { color: var(--text-primary); background: var(--surface-hover); }
.ft-link { padding: 0; border: 0; background: none; font: inherit; font-size: var(--font-sm); font-weight: var(--font-weight-semibold); color: var(--accent); cursor: pointer; }
.ft-link:disabled { color: var(--text-muted); cursor: default; }
.ft-link:focus-visible { outline: 2px solid var(--focus-color); outline-offset: 2px; border-radius: 4px; }

/* Verify: email or mobile. */
.ft-switch { display: inline-flex; gap: 4px; margin-bottom: var(--space-4); padding: 4px; border-radius: var(--radius-lg); background: var(--surface-sunken); }
.ft-switch label { position: relative; display: inline-flex; }
.ft-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.ft-switch span {
    display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px;
    border-radius: var(--radius-md); font-size: var(--font-ui); font-weight: var(--font-weight-semibold); color: var(--text-muted);
}
.ft-switch input:checked + span { color: var(--text-primary); background: var(--surface-primary); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border-color); }
.ft-switch input:focus-visible + span { outline: 2px solid var(--focus-color); outline-offset: 1px; }

.ft-verify { margin-bottom: var(--space-4); }
.ft-label { display: block; margin-bottom: 6px; font-size: var(--font-sm); font-weight: var(--font-weight-semibold); color: var(--text-secondary); }
.ft-row { display: flex; gap: var(--space-2); }
.ft-row input, .ft-otp {
    min-width: 0; flex: 1 1 auto; height: 42px; padding: 0 12px;
    border: 1px solid var(--border-strong); border-radius: var(--radius-md);
    font: inherit; font-size: var(--font-base); color: var(--text-primary); background: var(--surface-primary);
}
.ft-row input[readonly] { color: var(--text-muted); background: var(--surface-sunken); }
.ft-row input:focus, .ft-otp:focus { outline: 2px solid var(--accent-ring); border-color: var(--focus-color); }
.ft-note { margin: 6px 0 0; font-size: var(--font-sm); color: var(--text-muted); }
.ft-code { margin-top: var(--space-4); }
.ft-otp {
    display: block; width: 100%; max-width: 15rem; height: 52px; margin-bottom: 8px;
    font-family: var(--font-mono); font-size: 24px; font-weight: var(--font-weight-bold);
    letter-spacing: .5em; text-align: center; text-indent: .5em;
}
.ft-otp.is-wrong { border-color: var(--negative); animation: ft-shake .3s ease; }
@keyframes ft-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

.ft-done {
    display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-3);
    padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg);
    border: 1px solid rgba(5, 150, 105, .35); background: rgba(5, 150, 105, .08);
}
.ft-done > i { flex: none; font-size: 22px; color: var(--positive-ink); }
.ft-done b { display: block; font-size: var(--font-base); color: var(--text-primary); word-break: break-all; }
.ft-done span { display: block; font-size: var(--font-sm); color: var(--text-muted); }
.ft-verify > .ft-done:first-child { margin-top: 0; }

.ft-start { width: 100%; height: 48px; font-size: var(--font-md); }
.ft-start:not(:disabled) { background: var(--color-brand-button); }

.ft-alert { margin: 0 0 var(--space-4); padding: 10px 14px; border-radius: var(--radius-md); font-size: var(--font-ui); border: 1px solid var(--border-color); color: var(--text-primary); background: var(--surface-secondary); }
.ft-alert.is-error { border-color: rgba(225, 29, 72, .35); background: rgba(225, 29, 72, .07); }
.ft-alert.is-warn { border-color: rgba(217, 119, 6, .4); background: rgba(217, 119, 6, .08); }
.ft-alert.is-ok { border-color: rgba(5, 150, 105, .35); background: rgba(5, 150, 105, .08); }

.ft-foot { margin: var(--space-4) 0 0; text-align: center; font-size: var(--font-sm); color: var(--text-muted); }
.ft-foot a { font-weight: var(--font-weight-semibold); color: var(--accent); text-decoration: none; }
.ft-foot a:hover { text-decoration: underline; }

/* Phones: full-width card, two tiles across, bigger taps, labels under the stops. */
@media (max-width: 767px) {
    .ft { padding-top: 0; }
    .ft-card { padding: var(--space-4); border-radius: var(--radius-lg); }
    .ft-q { font-size: var(--font-lg); }
    .ft-steps li { flex-direction: column; gap: 4px; font-size: var(--font-xs); }
    .ft-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ft-chip span { min-height: 44px; }
    .ft-nav .ft-primary { flex: 1 1 auto; }
    .ft-row { flex-direction: column; }
    .ft-row .ft-btn { width: 100%; }
    .ft-switch { display: flex; }
    .ft-switch label { flex: 1 1 0; }
    .ft-switch span { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .ft-step, .ft-otp.is-wrong { animation: none; }
    .ft-bar > span, .ft-chip span { transition: none; }
}

/* The visitor's account step: Google first, then email, then sign in. */
.ft-account { display: flex; flex-direction: column; gap: var(--space-2); }
.ft-account .ft-btn { width: 100%; min-height: 46px; white-space: normal; text-align: center; line-height: 1.4; }
.ft-google { color: var(--text-primary); background: var(--surface-primary); border-color: var(--border-strong); }
.ft-google:hover { background: var(--surface-hover); }
.ft-google svg { width: 18px; height: 18px; flex: none; }
.ft-center { margin-top: 0; }
.ft-note a { font-weight: var(--font-weight-semibold); color: var(--accent); text-decoration: none; }
.ft-note a:hover { text-decoration: underline; }
.ft-or { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-2) 0; font-size: var(--font-xs); color: var(--text-muted); }
.ft-or::before, .ft-or::after { content: ''; flex: 1; height: 1px; background: var(--border-color); }
.ft-rule { display: flex; align-items: center; gap: 8px; margin: var(--space-5) 0 0; font-size: var(--font-sm); color: var(--text-muted); }
.ft-rule i { color: var(--positive-ink); }
.ft-steps li.is-current > span i { font-size: 10px; }
