/*
 * Typeform-style conversational auth.
 * One question per screen, big type, progress bar, smooth transitions.
 * Progressive enhancement: without JS every .tf-step is visible (a normal stacked form);
 * auth-flow.js adds .tf-ready to the form, which hides all but the active step.
 */

:root {
    --tf-accent: #0070F0;       /* Rejesho azure (brand) */
    --tf-accent-dark: #005AD6;
    --tf-ink: #0f1031;
    --tf-muted: #6b6c83;
    --tf-line: #d9dae6;
    --tf-bg: #f6f6fb;
}

.tf-body {
    margin: 0;
    background: var(--tf-bg);
    color: var(--tf-ink);
    font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.tf-wrap {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 20px 40px;
    box-sizing: border-box;
}

/* Progress bar pinned to the top of the viewport. */
.tf-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: transparent;
    z-index: 20;
}

.tf-progress-bar {
    height: 100%;
    width: 0;
    background: var(--tf-accent);
    transition: width .35s ease;
}

.tf-card {
    width: 100%;
    max-width: 620px;
}

/* Logo aligned to the top-left corner of the viewport. */
.tf-logo {
    position: fixed;
    top: 16px;
    left: 22px;
    max-height: 40px;
    z-index: 21;
}

.tf-alert {
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: .95rem;
}

.tf-alert-error { background: #fdecec; color: #b42318; }
.tf-alert-success { background: #e7f6ec; color: #1a7f37; }

/* Steps */
.tf-step { margin: 0; }

.tf-form.tf-ready .tf-step { display: none; }
.tf-form.tf-ready .tf-step.is-active {
    display: block;
    animation: tf-in .32s ease both;
}

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

.tf-q {
    font-size: clamp(1.5rem, 4.5vw, 2.25rem);
    font-weight: 600;
    line-height: 1.2;
    margin: 0 0 8px;
}

.tf-help {
    color: var(--tf-muted);
    font-size: 1rem;
    margin: 0 0 22px;
}

/* Big, clean inputs */
.tf-input {
    width: 100%;
    border: none;
    border-bottom: 2px solid var(--tf-line);
    background: transparent;
    font-size: clamp(1.25rem, 3.5vw, 1.6rem);
    padding: 8px 2px;
    color: var(--tf-ink);
    outline: none;
    transition: border-color .2s ease;
    box-sizing: border-box;
}

.tf-input::placeholder { color: #b9bacb; }
.tf-input:focus { border-bottom-color: var(--tf-accent); }
.tf-input.is-invalid { border-bottom-color: #b42318; }

.tf-field { margin-bottom: 10px; }
.tf-error { color: #b42318; font-size: .9rem; margin-top: 8px; min-height: 1em; }

/* intl-tel-input widget inside a step — let the library own the left padding so the
   flag / dial code never overlaps the typed number; just align it to the big input. */
.tf-step .iti { display: block; width: 100%; }
.tf-step .iti__flag-container { height: 100%; }
.tf-step .iti--separate-dial-code .iti__selected-flag { background: transparent; }
.tf-step .iti--separate-dial-code .iti__selected-dial-code {
    font-size: clamp(1.1rem, 3vw, 1.45rem);
    color: var(--tf-ink);
}

/* PIN / OTP code boxes */
.tf-code {
    display: flex;
    gap: 12px;
    margin: 6px 0 4px;
}

.tf-code-box {
    width: 56px;
    height: 64px;
    text-align: center;
    font-size: 1.75rem;
    font-weight: 600;
    border: 2px solid var(--tf-line);
    border-radius: 14px;
    background: #fff;
    color: var(--tf-ink);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.tf-code-box:focus {
    border-color: var(--tf-accent);
    box-shadow: 0 0 0 4px rgba(0, 112, 240, .14);
}

.tf-code.is-invalid .tf-code-box { border-color: #b42318; }

/* Actions */
.tf-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 28px;
}

.tf-btn {
    appearance: none;
    border: none;
    border-radius: 12px;
    background: var(--tf-accent);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 13px 26px;
    cursor: pointer;
    transition: background .15s ease, transform .05s ease;
}

.tf-btn:hover { background: var(--tf-accent-dark); }
.tf-btn:active { transform: translateY(1px); }
.tf-btn[disabled] { opacity: .5; cursor: not-allowed; }

.tf-btn-ghost {
    background: transparent;
    color: var(--tf-muted);
    padding: 13px 8px;
}
.tf-btn-ghost:hover { background: transparent; color: var(--tf-ink); }

.tf-enter-hint { color: var(--tf-muted); font-size: .85rem; }
.tf-enter-hint kbd {
    background: #fff;
    border: 1px solid var(--tf-line);
    border-radius: 6px;
    padding: 1px 6px;
    font-size: .8rem;
}

/* Back link + footer links */
.tf-foot {
    margin-top: 26px;
    font-size: .92rem;
    color: var(--tf-muted);
}
.tf-foot a { color: var(--tf-accent); text-decoration: none; }
.tf-foot a:hover { text-decoration: underline; }

/* Back button in the top-RIGHT corner (logo occupies top-left). */
.tf-back {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 21;
    background: #fff;
    border: 1px solid var(--tf-line);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--tf-ink);
}
.tf-back.is-visible { display: flex; }

/* Workspace slug field (owner signup) */
.tf-slug {
    display: flex;
    align-items: center;
    border-bottom: 2px solid var(--tf-line);
}
.tf-slug .tf-slug-host { color: var(--tf-muted); font-size: clamp(1rem, 3vw, 1.3rem); white-space: nowrap; }
.tf-slug .tf-input { border-bottom: none; }

@media (max-width: 480px) {
    .tf-code-box { width: 48px; height: 58px; font-size: 1.5rem; }
    .tf-code { gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    .tf-progress-bar { transition: none; }
    .tf-form.tf-ready .tf-step.is-active { animation: none; }
}
