/* Twib sign-up and login. Mobile first; loaded only by login and registration. */

:root {
    --brand: #3ca7ee;
    --primary: #1b84d1;
    --primary-hover: #156fb2;
    --primary-soft: #e8f4fd;
    --ink: #0f2233;
    --ink-2: #3d4f60;
    --muted: #66788a;
    --line: #d5dee7;
    --line-strong: #b8c6d3;
    --surface: #ffffff;
    --canvas: #f4f7fa;
    --error: #c9302c;
    --error-soft: #fdf0ef;
    --success: #1c8a55;
    --success-soft: #edf8f2;
    --route: #f2b705;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 20px;
    --focus: 0 0 0 3px rgba(27, 132, 209, .28);
    /* Side gutters: 20px on phones, and on tablets wide enough to keep the form about 440px wide. */
    --gutter-l: max(20px, env(safe-area-inset-left), calc((100vw - 440px) / 2));
    --gutter-r: max(20px, env(safe-area-inset-right), calc((100vw - 440px) / 2));
    --font: 'Open Sans', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.auth {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--surface);
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: rgba(27, 132, 209, .12);
    touch-action: manipulation;
}

.auth a { color: var(--primary); text-decoration: none; font-weight: 600; }
.auth a:hover { color: var(--primary-hover); text-decoration: underline; }
.auth a:focus-visible, .auth button:focus-visible, .auth input:focus-visible, .auth select:focus-visible {
    outline: none;
    box-shadow: var(--focus);
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -48px;
    padding: 8px 14px;
    background: var(--ink);
    color: #fff !important;
    border-radius: var(--radius-sm);
    z-index: 30;
}
.skip-link:focus { top: 12px; }

/* ---------- Layout ---------- */

.auth-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.auth-aside { display: none; }

.auth-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--surface);
}

/* Phone header: Twib-blue band with the logo and the page title, curving into the form. */
.auth-hero {
    position: relative;
    overflow: hidden;
    padding: 0 var(--gutter-r) 0 var(--gutter-l);
    color: #fff;
    background: radial-gradient(120% 90% at 0% 0%, #5bbaf5 0%, #2a93de 40%, #1874bf 100%);
}

.auth-topbar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 72px;
}

.auth-logo img { display: block; height: 48px; width: auto; }

.auth-topbar__link { margin: 0; font-size: 14px; color: rgba(255, 255, 255, .85); }
.auth-topbar__link a { margin-left: 4px; color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.auth-topbar__link a:hover { color: #fff; }

.auth-hero__copy { position: relative; padding: 2px 0 44px; }

.auth-hero__title {
    margin: 0;
    font-size: 26px;
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: -.025em;
    color: #fff;
    text-wrap: balance;
}

.auth-hero__sub { margin: 6px 0 0; font-size: 14.5px; color: rgba(255, 255, 255, .88); text-wrap: balance; }

.auth-intro { display: none; }

.auth-card {
    position: relative;
    width: 100%;
    margin: -24px 0 0;
    /* The white card overlaps the blue header with rounded top corners. */
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 28px var(--gutter-r) max(28px, env(safe-area-inset-bottom)) var(--gutter-l);
    background: var(--surface);
    flex: 1;
    animation: rise .35s ease-out both;
}

@keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

.auth-title {
    margin: 0 0 4px;
    font-size: 26px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.02em;
    text-wrap: balance;
}

.auth-subtitle {
    margin: 0 0 24px;
    color: var(--muted);
    font-size: 15px;
}

.auth-subtitle strong { color: var(--success); font-weight: 600; }

/* ---------- Steps ---------- */

.auth-steps {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
}

.auth-steps__bar {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.auth-steps__bar span {
    height: 4px;
    border-radius: 4px;
    background: var(--line);
}

.auth-steps__bar span.is-done { background: var(--primary); }

/* ---------- Fields ---------- */

.field { position: relative; margin: 0 0 16px; }

.field__label {
    display: block;
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-2);
}

.field__label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.field__label-row a { font-size: 14px; }

.field__control { position: relative; }

.auth input[type=text],
.auth input[type=email],
.auth input[type=tel],
.auth input[type=password],
.auth select {
    display: block;
    width: 100%;
    height: 50px;
    padding: 0 14px;
    font: inherit;
    font-size: 16px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.auth input::placeholder { color: #93a2b0; }

.auth input:hover, .auth select:hover { border-color: #93a5b6; }

.auth input:focus, .auth select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--focus);
}

.auth select {
    padding-right: 40px;
    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' fill='none' stroke='%2366788a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.auth input.inputerror, .auth input.error { border-color: var(--error); }
.auth input.inputerror:focus, .auth input.error:focus { box-shadow: 0 0 0 3px rgba(201, 48, 44, .2); }
.auth input.inputsuccess { border-color: var(--success); }

.field__control--password input { padding-right: 52px; }

.field__toggle {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
}

.field__toggle:hover { color: var(--ink); }
.field__toggle svg { width: 20px; height: 20px; }
.field__toggle .icon-hide { display: none; }
.field__toggle[aria-pressed=true] .icon-show { display: none; }
.field__toggle[aria-pressed=true] .icon-hide { display: block; }

.field__hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.field__hint svg { width: 14px; height: 14px; flex: none; opacity: .5; }
.field__hint.is-met { color: var(--success); }
.field__hint.is-met svg { opacity: 1; }

/* Error and status lines under a field. jQuery Validate writes its own label inside. */
.Form__error-label {
    display: block;
    min-height: 0;
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.4;
    color: var(--error);
}

.Form__error-label:empty { display: none; }
.Form__error-label label { font-weight: 400; margin: 0; }
.Form__error-label .username_success { color: var(--success); }
.Form__error-label .username_error { color: var(--error); }
.Form__error-label a { margin-left: 4px; }

.field-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 12px;
}

/* ---------- Buttons ---------- */

.btn {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 52px;
    padding: 0 20px;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(180deg, #2390dc 0%, var(--primary) 100%);
    border: 0;
    border-radius: var(--radius-sm);
    box-shadow: 0 6px 16px rgba(27, 132, 209, .28), inset 0 1px 0 rgba(255, 255, 255, .18);
    cursor: pointer;
    transition: background-color .15s ease, box-shadow .15s ease, transform .1s ease;
    -webkit-appearance: none;
    appearance: none;
}

.btn:hover { background: var(--primary-hover); box-shadow: 0 8px 20px rgba(27, 132, 209, .34); }
.btn:active { transform: translateY(1px); }

/* "nextbtn-inactive" still marks step 1 as not ready (the smoke test reads it), but the
   button keeps its normal look: pressing it explains what is missing. */
.btn.is-busy, .btn.disabled { background: #7fb6df; cursor: default; }

.btn.is-busy { color: transparent; }
.btn.is-busy::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    border: 2.5px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.form-alert {
    margin: 0 0 16px;
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.45;
    border-radius: var(--radius-sm);
    color: var(--error);
    background: var(--error-soft);
}

.form-alert:empty { display: none; }
.form-alert--success { color: var(--success); background: var(--success-soft); }
.form-alert a { color: inherit; text-decoration: underline; }

.step1-error {
    margin: 10px 0 0;
    font-size: 14px;
    color: var(--error);
    text-align: center;
}

.auth-alt {
    margin: 20px 0 0;
    text-align: center;
    font-size: 15px;
    color: var(--muted);
}

.auth-legal {
    margin: 14px 0 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--muted);
    text-align: center;
}

.auth-legal a { font-weight: 600; }

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 14px;
    padding: 0;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    background: none;
    border: 0;
    cursor: pointer;
}

.auth-back svg { width: 16px; height: 16px; }

.g-recaptcha { margin: 0 0 16px; }

/* ---------- What the trial includes (phones) ---------- */

.auth-gets {
    margin: 28px 0 0;
    padding: 16px 18px;
    border-radius: var(--radius);
    background: var(--primary-soft);
}

.auth-gets__title {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-hover);
}

.auth-gets ul { margin: 0; padding: 0; list-style: none; }

.auth-gets li {
    position: relative;
    padding: 0 0 0 24px;
    margin: 0 0 6px;
    font-size: 14px;
    color: var(--ink-2);
}

.auth-gets li:last-child { margin-bottom: 0; }

.auth-gets li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5'/%3E%3C/svg%3E") center / 11px no-repeat;
}

/* ---------- Steps visibility ---------- */

#step2 { display: none; }

/* ---------- Desktop and tablet ---------- */

@media (min-width: 960px) {
    .auth-shell {
        display: grid;
        grid-template-columns: minmax(380px, 44%) 1fr;
    }

    .auth-aside {
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 32px;
        padding: 48px 56px;
        color: #fff;
        background:
            radial-gradient(120% 80% at 0% 0%, rgba(255, 255, 255, .16), transparent 55%),
            linear-gradient(160deg, #3ca7ee 0%, #1f8ad8 55%, #176fb6 100%);
        overflow: hidden;
    }

    .auth-aside__eyebrow {
        margin: 0 0 12px;
        font-size: 13px;
        font-weight: 600;
        letter-spacing: .02em;
        color: rgba(255, 255, 255, .85);
    }

    .auth-aside h2 {
        margin: 0;
        max-width: 15em;
        font-size: 34px;
        line-height: 1.18;
        font-weight: 700;
        letter-spacing: -.02em;
        text-wrap: balance;
    }

    .auth-points {
        margin: 28px 0 0;
        padding: 0;
        list-style: none;
    }

    .auth-points li {
        display: flex;
        gap: 12px;
        margin: 0 0 16px;
        font-size: 15.5px;
        line-height: 1.45;
        color: rgba(255, 255, 255, .95);
    }

    .auth-points svg {
        flex: none;
        width: 22px;
        height: 22px;
        margin-top: 1px;
        padding: 4px;
        color: var(--primary);
        background: #fff;
        border-radius: 50%;
    }

    .auth-route { width: 100%; max-width: 440px; height: auto; color: #fff; }

    .auth-proof {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        max-width: 520px;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .auth-proof li {
        padding: 12px 14px;
        border-radius: var(--radius);
        background: rgba(255, 255, 255, .14);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
        font-size: 13px;
        color: rgba(255, 255, 255, .9);
    }

    .auth-proof strong {
        display: block;
        font-size: 17px;
        line-height: 1.2;
        color: #fff;
    }

    .auth-main {
        justify-content: flex-start;
        padding: 0 48px 40px;
        background: var(--surface);
    }

    .auth-hero { padding: 0; overflow: visible; color: var(--muted); background: none; }
    .auth-hero__copy, .auth-gets { display: none; }
    .auth-intro { display: block; }

    .auth-topbar { height: 88px; justify-content: flex-end; }
    .auth-topbar .auth-logo { display: none; }
    .auth-topbar__link { color: var(--muted); }
    .auth-topbar__link a { color: var(--primary); text-decoration: none; }
    .auth-topbar__link a:hover { color: var(--primary-hover); text-decoration: underline; }
    .auth-aside__logo { display: block; height: 48px; width: auto; margin: 0 0 40px; }

    .auth-card {
        flex: 0 0 auto;
        max-width: 420px;
        margin: auto;
        padding: 8px 0 24px;
        background: none;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-title { font-size: 30px; }

    .field-row { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1280px) {
    .auth-aside { padding: 56px 72px; }
    .auth-aside h2 { font-size: 38px; }
}

/* Short laptop screens: tighten the brand panel so the proof cards stay on screen. */
@media (min-width: 960px) and (max-height: 820px) {
    .auth-aside { gap: 20px; padding-top: 32px; padding-bottom: 32px; }
    .auth-aside__logo { height: 40px; margin-bottom: 24px; }
    .auth-aside h2 { font-size: 30px; }
    .auth-points { margin-top: 20px; }
    .auth-points li { margin-bottom: 10px; font-size: 15px; }
    .auth-route { max-height: 110px; }
}

@media (min-width: 960px) and (max-height: 660px) {
    .auth-route { display: none; }
}

@media (min-width: 380px) {
    .field-row { grid-template-columns: 1fr 1fr; }
}

/* Very small phones */
@media (max-width: 359px) {
    .auth-hero { padding-left: 16px; padding-right: 16px; }
    .auth-card { padding-left: 16px; padding-right: 16px; }
    .auth-title { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation-duration: .01ms !important; }
}

/* ---------- Maintenance overlay (login) ---------- */

.overlay_screen {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    text-align: center;
    background: var(--surface);
}

.overlay_screen img { max-width: 160px; height: auto; }

/* ---------- Chat and messenger links ---------- */

.messengers-container {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 20;
    display: none;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 10px;
}

.messengers-container .chat-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 6px 16px rgba(23, 111, 182, .3);
    cursor: pointer;
}

.messengers-container .chat-icon img { width: 24px; height: 24px; }

.messengers {
    display: none;
    flex-direction: column;
    gap: 10px;
}

.messengers-container:hover .messengers,
.messengers.activeMessege { display: flex; }

.messenger-link {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #fff;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px;
    box-shadow: 0 4px 12px rgba(15, 34, 51, .16);
}

.messenger-link.whatsapp { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2325d366'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm0 18.2a8.2 8.2 0 0 1-4.2-1.1l-.3-.2-3 .8.8-2.9-.2-.3A8.2 8.2 0 1 1 12 20.2zm4.5-6.1c-.2-.1-1.5-.7-1.7-.8-.2-.1-.4-.1-.6.1l-.8 1c-.1.2-.3.2-.5.1a6.7 6.7 0 0 1-3.3-2.9c-.3-.4.2-.4.6-1.3.1-.2 0-.3 0-.4l-.8-1.8c-.2-.5-.4-.4-.6-.4h-.5a1 1 0 0 0-.7.3 3 3 0 0 0-.9 2.2 5.2 5.2 0 0 0 1.1 2.7 11.8 11.8 0 0 0 4.5 4c1.7.7 2.4.8 3.2.6.5-.1 1.5-.6 1.7-1.2.2-.6.2-1.1.2-1.2-.1-.1-.3-.2-.5-.3z'/%3E%3C/svg%3E"); }
.messenger-link.facebook-messenger { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%230084ff'%3E%3Cpath d='M12 2C6.4 2 2 6.1 2 11.6c0 2.9 1.2 5.4 3.1 7.1V22l2.9-1.6c.9.2 1.9.4 3 .4 5.6 0 10-4.1 10-9.6S17.6 2 12 2zm1 12.9-2.6-2.7-5 2.7 5.5-5.8 2.6 2.7 4.9-2.7-5.4 5.8z'/%3E%3C/svg%3E"); }
.messenger-link.tawk_to { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231b84d1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.4A8 8 0 1 1 21 12z'/%3E%3C/svg%3E"); }
.messenger-link.email { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366788a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7l9 6 9-6'/%3E%3C/svg%3E"); }

.email-typo-accept {
    padding: 0;
    font: inherit;
    font-weight: 600;
    color: var(--primary);
    background: none;
    border: 0;
    text-decoration: underline;
    cursor: pointer;
}
