/*
 * Rejesho auth — Stitch "Rejesho" Material-3 card skin for the typeform flow
 * (login + register). The tf-* markup contract and auth-flow.js behaviour are
 * unchanged; only the visual language is reskinned. Tokens live in tokens.css.
 *
 * 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.
 */

/* ---- page shell ---- */
.tf-body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--rj-bg);
    color: var(--rj-text);
    font-family: var(--rj-font);
    -webkit-font-smoothing: antialiased;
}

/* ---- header / footer chrome (rendered by layouts/auth.blade.php) ---- */
.auth-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px clamp(16px, 4vw, 40px);
    background: transparent;
}
.auth-brand img { height: 34px; width: auto; display: block; object-fit: contain; }
.auth-support { color: var(--rj-accent); font-weight: 600; text-decoration: none; font-size: .9rem; }
.auth-support:hover { color: #1A56DB; }

.auth-main {
    flex: 1 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    box-sizing: border-box;
}

.auth-footer {
    flex-shrink: 0;
    background: #ffffff;
    padding: 24px clamp(16px, 4vw, 40px);
}
.auth-footer__inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 14px 24px;
    align-items: center;
    justify-content: space-between;
}
.auth-footer__brand { color: var(--rj-text); font-weight: 600; font-size: .95rem; }
.auth-footer__copy { color: var(--rj-muted); font-size: .8rem; margin: 4px 0 0; }
.auth-footer__links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.auth-footer__links a {
    color: var(--rj-muted);
    font-family: var(--rj-font);
    font-size: .85rem;
    letter-spacing: 0;
    text-decoration: none;
    transition: color .15s ease;
}
.auth-footer__links a:hover { color: var(--rj-accent); }

/* ---- progress bar (pinned to the very top edge) ---- */
.tf-progress {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: transparent;
    z-index: 40;
}
.tf-progress-bar {
    height: 100%;
    width: 0;
    background: var(--rj-cta);
    transition: width .35s ease;
}

/* ---- back button (below the sticky header, top-right) ---- */
.tf-back {
    position: fixed;
    top: 70px;
    right: 18px;
    z-index: 35;
    background: var(--rj-surface);
    border: 1px solid var(--rj-border);
    border-radius: var(--rj-radius);
    width: 42px;
    height: 42px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--rj-text);
    box-shadow: 0 2px 8px rgba(0, 82, 255, .06);
}
.tf-back.is-visible { display: flex; }

/* ---- card ---- */
.tf-wrap { width: 100%; display: flex; justify-content: center; }
.tf-card {
    width: 100%;
    max-width: 480px;
    background: var(--rj-surface);
    border: 1px solid rgba(195, 197, 217, .5);
    border-radius: var(--rj-radius-lg);
    box-shadow: var(--rj-shadow);
    padding: clamp(24px, 5vw, 40px);
    box-sizing: border-box;
}

/* logo now lives in the layout header */
.tf-logo { display: none; }

/* ---- alerts ---- */
.tf-alert { border-radius: var(--rj-radius); padding: 12px 16px; margin-bottom: 20px; font-size: .95rem; }
.tf-alert-error { background: var(--rj-error-bg); color: #93000a; }
.tf-alert-success { background: var(--rj-success-bg); color: var(--rj-success); }

/* ---- 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(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tf-q {
    font-family: var(--rj-font);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 600;
    letter-spacing: -.01em;
    line-height: 1.2;
    margin: 0 0 8px;
    color: var(--rj-text);
}
.tf-help { color: var(--rj-muted); font-size: 1rem; margin: 0 0 24px; }

/* ---- inputs ---- */
.tf-input {
    width: 100%;
    box-sizing: border-box;
    height: 52px;
    padding: 12px 16px;
    background: var(--rj-input-bg);
    border: 1px solid var(--rj-border);
    border-radius: var(--rj-radius);
    font-family: var(--rj-font);
    font-size: 1rem;
    color: var(--rj-text);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.tf-input::placeholder { color: var(--rj-outline); }
.tf-input:focus { border-color: var(--rj-cta); box-shadow: var(--rj-focus-ring); }
.tf-input.is-invalid { border-color: var(--rj-error); }

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

/* intl-tel-input widget — fill the input, blend the dial-code prefix into the field. */
.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; border-radius: var(--rj-radius) 0 0 var(--rj-radius); }
.tf-step .iti--separate-dial-code .iti__selected-dial-code { font-size: 1rem; color: var(--rj-text); }

/* ---- PIN / OTP code boxes ---- */
.tf-code { display: flex; gap: 12px; margin: 6px 0 4px; }
.tf-code-box {
    width: 56px;
    height: 60px;
    text-align: center;
    font-size: 1.6rem;
    font-weight: 700;
    border: 1px solid var(--rj-border);
    border-radius: var(--rj-radius);
    background: var(--rj-input-bg);
    color: var(--rj-text);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.tf-code-box:focus { border-color: var(--rj-cta); box-shadow: var(--rj-focus-ring); }
.tf-code.is-invalid .tf-code-box { border-color: var(--rj-error); }

/* ---- workspace slug field ---- */
.tf-slug {
    display: flex;
    align-items: center;
    background: var(--rj-input-bg);
    border: 1px solid var(--rj-border);
    border-radius: var(--rj-radius);
    padding: 0 14px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.tf-slug:focus-within { border-color: var(--rj-cta); box-shadow: var(--rj-focus-ring); }
.tf-slug .tf-slug-host { color: var(--rj-muted); font-size: .95rem; white-space: nowrap; }
.tf-slug .tf-input { border: none; background: transparent; height: 50px; padding-left: 4px; }
.tf-slug .tf-input:focus { border: none; box-shadow: none; }

/* ---- actions / buttons ---- */
.tf-actions { display: flex; align-items: center; gap: 16px; margin-top: 28px; }
.tf-btn {
    appearance: none;
    border: none;
    border-radius: var(--rj-radius);
    background: var(--rj-cta);
    color: var(--rj-on-cta);
    font-family: var(--rj-font);
    font-size: 1rem;
    font-weight: 700;
    height: 48px;
    padding: 0 26px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .15s ease, transform .05s ease, opacity .15s ease;
}
.tf-btn:hover { background: var(--rj-cta-hover); }
.tf-btn:active { transform: scale(.98); }
.tf-btn[disabled] { opacity: .5; cursor: not-allowed; }
.tf-btn-ghost { background: transparent; color: var(--rj-muted); box-shadow: none; }
.tf-btn-ghost:hover { background: var(--rj-container); color: var(--rj-text); }

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

/* ---- footer links inside the card ---- */
.tf-foot {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(195, 197, 217, .4);
    font-size: .92rem;
    color: var(--rj-muted);
    text-align: center;
}
.tf-foot a { color: var(--rj-primary); font-weight: 600; text-decoration: none; }
.tf-foot a:hover { text-decoration: underline; }

/* ---- remember-me checkbox (Bootstrap custom-control on the PIN step) ---- */
.tf-card .custom-control-label { color: var(--rj-muted); }

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

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

/* Hidden superadmin entry — invisible ~44px bottom-right corner hotspot. */
.auth-admin-hotspot {
    position: fixed;
    right: 0;
    bottom: 0;
    width: 44px;
    height: 44px;
    z-index: 60;
    display: block;
    background: transparent;
}
