/* tambill — หน้า Auth (login / register) : การ์ดกลางหน้าจอ */

:root {
    --tb-primary: #0E9AA7;
    --tb-primary-hover: #0C8793;
    --tb-dark: #073B4C;
    --tb-tint: #E0F4F6;
    --tb-bg: #F4F8F9;
    --tb-text: #1f2a30;
    --tb-text-2: #5a6b73;
    --tb-border: #cfdadd;
    --tb-danger: #d14343;
    --tb-danger-bg: #fdecec;
    --tb-ok: #1a7f5a;
    --tb-ok-bg: #e3f6ec;
}

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

body.tb-auth {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 24px 16px;
    font-family: 'Noto Sans Thai', 'Inter', -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--tb-text);
    background: var(--tb-tint);
    -webkit-font-smoothing: antialiased;
}

.tb-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 12px;
    padding: 32px 32px 28px;
    box-shadow: 0 1px 3px rgba(7, 59, 76, .08), 0 12px 32px rgba(7, 59, 76, .08);
}

.tb-logo { display: flex; justify-content: center; }
.tb-logo img { height: 64px; width: auto; display: block; }
.tb-tagline {
    margin: 6px 0 24px;
    text-align: center;
    color: var(--tb-text-2);
    font-size: 14px;
}

.tb-title {
    margin: 0 0 16px;
    font-size: 20px;
    font-weight: 600;
    color: var(--tb-dark);
}

.tb-alert {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
}
.tb-alert i { font-size: 18px; line-height: 1.4; }
.tb-alert--error { background: var(--tb-danger-bg); color: #9b2c2c; }
.tb-alert--ok { background: var(--tb-ok-bg); color: var(--tb-ok); }

.tb-field { margin-bottom: 16px; }
.tb-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--tb-text-2);
}
.tb-input-wrap { position: relative; }
.tb-input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--tb-border);
    border-radius: 8px;
    background: #fff;
    font: inherit;
    color: var(--tb-text);
    transition: border-color .15s, box-shadow .15s;
}
.tb-input::placeholder { color: #9fb0b6; }
.tb-input:focus {
    outline: none;
    border-color: var(--tb-primary);
    box-shadow: 0 0 0 3px rgba(14, 154, 167, .18);
}
.tb-input.is-invalid { border-color: var(--tb-danger); }
.tb-input.is-invalid:focus { box-shadow: 0 0 0 3px rgba(209, 67, 67, .15); }
.tb-input-wrap .tb-input { padding-right: 44px; }
.tb-eye {
    position: absolute;
    right: 4px;
    top: 4px;
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    border-radius: 6px;
    color: var(--tb-text-2);
    font-size: 19px;
    cursor: pointer;
}
.tb-eye:hover { background: var(--tb-bg); }

.tb-error { margin-top: 4px; font-size: 12px; color: var(--tb-danger); }

.tb-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -2px 0 18px;
    font-size: 13px;
}
.tb-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--tb-text-2); }
.tb-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--tb-primary); }

.tb-link { color: var(--tb-primary); font-weight: 500; text-decoration: none; }
.tb-link:hover { text-decoration: underline; }

.tb-btn {
    width: 100%;
    height: 44px;
    border: 0;
    border-radius: 8px;
    background: var(--tb-primary);
    color: #fff;
    font: inherit;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: background .15s;
}
.tb-btn:hover { background: var(--tb-primary-hover); }
.tb-btn:focus-visible { outline: 3px solid rgba(14, 154, 167, .35); outline-offset: 2px; }

.tb-foot-link { margin-top: 18px; text-align: center; font-size: 13px; color: var(--tb-text-2); }

.tb-copy { margin-top: 20px; text-align: center; font-size: 12px; color: var(--tb-text-2); }

@media (max-width: 480px) {
    .tb-card { padding: 24px 20px 22px; }
}

/* ---------- Register / OTP ---------- */
.tb-steps { display: flex; gap: 6px; margin: 4px 0 18px; }
.tb-steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--tb-line, #e3ecee); }
.tb-steps i.on { background: var(--tb-primary); }

.tb-sub { margin: -8px 0 16px; color: var(--tb-text-2); font-size: 14px; }
.tb-sub b { color: var(--tb-text); font-weight: 600; }

.tb-hint { margin-top: 4px; font-size: 12px; color: var(--tb-text-2); }

.tb-phone { display: flex; align-items: stretch; border: 1px solid var(--tb-border); border-radius: 8px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.tb-phone:focus-within { border-color: var(--tb-primary); box-shadow: 0 0 0 3px rgba(14, 154, 167, .18); }
.tb-phone.is-invalid { border-color: var(--tb-danger); }
.tb-phone__pf { display: grid; place-items: center; padding: 0 12px; color: var(--tb-text-2); border-right: 1px solid var(--tb-border); }
.tb-phone .tb-input { border: 0; border-radius: 0 8px 8px 0; box-shadow: none; }
.tb-phone .tb-input:focus { box-shadow: none; }

.tb-strength { display: flex; gap: 4px; margin-top: 6px; }
.tb-strength i { flex: 1; height: 3px; border-radius: 2px; background: #e3ecee; transition: background .15s; }

.tb-check--top { align-items: flex-start; font-size: 13px; line-height: 1.5; }
.tb-check--top input { margin-top: 2px; flex: none; }

.tb-alert--dev { background: #FFF4D6; color: #7a5500; }
.tb-alert--dev b { letter-spacing: 2px; }

.tb-otp { display: flex; gap: 8px; justify-content: center; margin: 4px 0 2px; }
.tb-otp input {
    width: 46px; height: 54px; text-align: center;
    border: 1px solid var(--tb-border); border-radius: 8px;
    font: inherit; font-size: 22px; font-weight: 600; color: var(--tb-dark);
    transition: border-color .15s, box-shadow .15s;
}
.tb-otp input:focus { outline: none; border-color: var(--tb-primary); box-shadow: 0 0 0 3px rgba(14, 154, 167, .18); }
.tb-otp input.is-invalid { border-color: var(--tb-danger); }
.tb-error--center { text-align: center; margin-top: 8px; }

.tb-linkbtn { border: 0; background: none; padding: 0; font: inherit; font-weight: 500; color: var(--tb-primary); cursor: pointer; }
.tb-linkbtn:hover:not(:disabled) { text-decoration: underline; }
.tb-linkbtn:disabled { color: var(--tb-text-2); cursor: default; }

@media (max-width: 480px) {
    .tb-otp { gap: 6px; }
    .tb-otp input { width: 40px; height: 50px; }
}

/* ---------- Create company ---------- */
body.tb-auth--top { justify-content: flex-start; padding-top: 0; }
.tb-topbar { width: 100%; max-width: 1080px; display: flex; align-items: center; justify-content: space-between; padding: 16px 4px; }
.tb-topbar img { height: 38px; width: auto; display: block; }
.tb-topbar__user { font-size: 13px; color: var(--tb-text-2); display: flex; gap: 12px; align-items: center; }
.tb-card--wide { max-width: 480px; margin-top: 8px; }
.tb-title--lg { font-size: 22px; }
.tb-req { color: var(--tb-danger); }
.tb-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
select.tb-input { appearance: auto; padding-right: 8px; }
.tb-hint--center { text-align: center; margin-top: 14px; }

.tb-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tb-opt { cursor: pointer; }
.tb-opt input { position: absolute; opacity: 0; pointer-events: none; }
.tb-opt span { display: block; border: 1px solid var(--tb-border); border-radius: 8px; padding: 10px 12px 10px 38px; position: relative; transition: border-color .15s, background .15s; }
.tb-opt span::before { content: ''; position: absolute; left: 12px; top: 15px; width: 16px; height: 16px; border-radius: 50%; border: 1px solid #9fb0b6; background: #fff; }
.tb-opt b { display: block; font-size: 14px; font-weight: 600; color: var(--tb-dark); }
.tb-opt small { display: block; font-size: 12px; color: var(--tb-text-2); }
.tb-opt input:checked + span { border-color: var(--tb-primary); background: var(--tb-tint); }
.tb-opt input:checked + span::before { border: 5px solid var(--tb-primary); }
.tb-opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(14, 154, 167, .25); }

.tb-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--tb-border); border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.tb-switch input { position: absolute; opacity: 0; pointer-events: none; }
.tb-switch__txt b { display: block; font-size: 14px; font-weight: 600; color: var(--tb-dark); }
.tb-switch__txt small { display: block; font-size: 12px; color: var(--tb-text-2); }
.tb-switch__ui { flex: none; width: 38px; height: 22px; border-radius: 99px; background: #cfdadd; position: relative; transition: background .15s; }
.tb-switch__ui::after { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.tb-switch input:checked ~ .tb-switch__ui { background: var(--tb-primary); }
.tb-switch input:checked ~ .tb-switch__ui::after { transform: translateX(16px); }
.tb-switch input:focus-visible ~ .tb-switch__ui { box-shadow: 0 0 0 3px rgba(14, 154, 167, .25); }

@media (max-width: 480px) {
    .tb-row2, .tb-seg { grid-template-columns: 1fr; }
}
