/* Tebis Authentication UI v5
   Standalone stylesheet: no Vite/Tailwind dependency.
   All selectors are scoped to .tb-auth-body to avoid affecting other modules. */

@font-face {
    font-family: "Vazirmatn";
    src: url("/fonts/Vazirmatn[wght].woff2") format("woff2");
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
}

html { min-height: 100%; }
body.tb-auth-body,
body.tb-auth-body * ,
body.tb-auth-body *::before,
body.tb-auth-body *::after { box-sizing: border-box; }

body.tb-auth-body {
    --tb-ink: #173744;
    --tb-muted: #71858e;
    --tb-border: #dce7ea;
    --tb-teal: #0d7180;
    --tb-teal-dark: #0b5263;
    display: flex;
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    padding: 28px 18px 20px;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    background:
        radial-gradient(ellipse at 12% 12%, rgba(31, 148, 153, .10), transparent 34%),
        radial-gradient(ellipse at 90% 88%, rgba(13, 113, 128, .08), transparent 32%),
        #f2f6f8;
    color: var(--tb-ink);
    direction: rtl;
    text-align: right;
    font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
}

body.tb-auth-body a { color: var(--tb-teal); text-decoration: none; }
body.tb-auth-body a:hover { color: var(--tb-teal-dark); text-decoration: underline; }
body.tb-auth-body button,
body.tb-auth-body input { font: inherit; }

.tb-auth-wrap { width: min(100%, 1080px); margin: auto; }
.tb-auth-card {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr);
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e2eaed;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 22px 65px rgba(25, 58, 70, .12);
}
.tb-auth-form-panel {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: clamp(28px, 4vw, 52px) clamp(22px, 4vw, 54px) 22px;
    background: #fff;
}
.tb-auth-content { width: 100%; max-width: 560px; min-width: 0; margin: auto; }
.tb-auth-mobile-brand { display: none; }
.tb-brand-mark {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: #e7f5f5;
    color: var(--tb-teal-dark);
    font-size: 23px;
    font-weight: 900;
}
.tb-brand-name { color: var(--tb-ink) !important; font-size: 19px; font-weight: 900; }

.tb-form-heading { margin: 0 0 22px; }
.tb-form-kicker { display: block; margin-bottom: 5px; color: var(--tb-teal); font-size: 11px; font-weight: 800; }
.tb-form-heading h1 {
    margin: 0 0 5px;
    color: #153542;
    font-family: "Vazirmatn", Tahoma, sans-serif;
    font-size: clamp(23px, 2.6vw, 30px);
    font-weight: 850;
    line-height: 1.55;
}
.tb-form-heading p { margin: 0; color: var(--tb-muted); font-size: 12px; line-height: 1.9; }

.tb-alert {
    margin: 0 0 16px;
    padding: 10px 13px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.9;
}
.tb-alert-success { border-color: #bce6d5; background: #effaf5; color: #176747; }
.tb-alert-error { border-color: #f0c9c9; background: #fff4f3; color: #a33434; }

.tb-auth-form { display: block; width: 100%; max-width: 100%; margin: 0; }
.tb-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 14px;
    align-items: start;
}
.tb-login-grid { grid-template-columns: minmax(0, 1fr); }
.tb-field { display: block; width: 100%; min-width: 0; margin: 0 0 14px; }
.tb-grid-full { grid-column: 1 / -1; }
.tb-field label {
    display: block;
    margin: 0 0 6px;
    color: #304c57;
    font-size: 12px;
    font-weight: 750;
}
.tb-required { color: #d04b4b; }
.tb-optional { color: #93a1a6; font-size: 10px; font-weight: 400; }
.tb-field input,
.tb-auth-form > input:not([type="hidden"]) {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 46px;
    margin: 0;
    padding: 0 12px;
    border: 1px solid var(--tb-border);
    border-radius: 9px;
    outline: none;
    background: #fbfdfe;
    color: #183642;
    font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
    font-size: 13px;
    line-height: normal;
    box-shadow: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.tb-field input::placeholder { color: #a5b2b7; opacity: 1; }
.tb-field input:focus,
.tb-captcha-input:focus {
    border-color: #16818a;
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(22, 129, 138, .12);
}
.tb-ltr,
.tb-auth-body input[dir="ltr"] {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: plaintext;
}
.tb-field-hint { margin: -5px 0 14px; color: #84949b; font-size: 10px; line-height: 1.8; }

.tb-captcha {
    width: 100%;
    margin: 4px 0 16px;
    padding: 12px;
    border: 1px solid #e0e9ec;
    border-radius: 11px;
    background: #f7fafb;
}
.tb-captcha-caption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 9px;
}
.tb-captcha-caption label { margin: 0; color: #304c57; font-size: 11px; font-weight: 750; }
.tb-captcha-caption span { color: #83949b; font-size: 10px; }
.tb-captcha-row { display: flex; width: 100%; flex-direction: row; align-items: center; gap: 9px; }
.tb-captcha-question {
    display: inline-flex;
    min-width: 86px;
    min-height: 40px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    border: 1px solid #dbe6e8;
    border-radius: 8px;
    background: #fff;
    color: #145b67;
    font: 800 18px/1.4 Arial, sans-serif;
    text-align: center;
}
.tb-captcha-equals { flex: 0 0 auto; color: #82979e; }
.tb-captcha-input {
    width: min(100%, 150px);
    min-width: 0;
    height: 42px;
    margin: 0;
    padding: 0 10px;
    border: 1px solid var(--tb-border);
    border-radius: 8px;
    background: #fff;
    color: var(--tb-ink);
    font-size: 13px;
}
.tb-form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 2px 0 17px;
}
.tb-check { display: inline-flex; align-items: center; gap: 7px; color: #60757e; font-size: 11px; cursor: pointer; }
.tb-check input { width: 15px; height: 15px; margin: 0; accent-color: var(--tb-teal); }
.tb-inline-link { font-size: 11px; }
.tb-submit {
    display: flex;
    width: 100%;
    min-height: 49px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(110deg, #0d6574, #138b8e);
    color: #fff;
    font-family: "Vazirmatn", Tahoma, sans-serif;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 7px 16px rgba(13, 101, 116, .16);
    transition: transform .15s ease, filter .15s ease;
}
.tb-submit:hover { filter: brightness(1.05); transform: translateY(-1px); }
.tb-submit:focus-visible { outline: 3px solid rgba(19, 139, 142, .25); outline-offset: 3px; }
.tb-switch-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    margin: 19px 0 0;
    color: #7a8c93;
    font-size: 11px;
}
.tb-switch-auth a { font-weight: 800; }
.tb-auth-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 24px 0 0;
    padding: 12px 0 0;
    border-top: 1px solid #edf1f2;
    color: #9aa9ae;
    font-size: 10px;
}
.tb-page-note { margin: 12px 0 0; color: #8b9ca2; font-size: 10px; text-align: center; }

.tb-auth-aside {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 34px 30px;
    background: linear-gradient(145deg, #0d5969, #0b7180 58%, #159395);
    color: #fff;
}
.tb-aside-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; color: #fff !important; font-size: 19px; font-weight: 900; }
.tb-aside-brand .tb-brand-mark { background: rgba(255,255,255,.16); color: #fff; }
.tb-aside-copy { position: relative; z-index: 1; max-width: 360px; margin: auto 0; padding: 45px 0; }
.tb-aside-eyebrow { color: #bce8e7; font-size: 11px; font-weight: 700; }
.tb-aside-copy h2 { margin: 12px 0; color: #fff; font-size: clamp(23px, 2.5vw, 31px); font-weight: 850; line-height: 1.8; }
.tb-aside-copy p { margin: 0; color: rgba(255,255,255,.82); font-size: 13px; line-height: 2.1; }
.tb-feature-list { display: grid; gap: 13px; margin: 28px 0 0; padding: 0; list-style: none; color: rgba(255,255,255,.92); font-size: 11px; }
.tb-feature-list li { display: flex; align-items: center; gap: 9px; }
.tb-feature-icon { display: inline-flex; width: 22px; height: 22px; flex: 0 0 22px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; }
.tb-aside-bottom { position: relative; z-index: 1; color: rgba(255,255,255,.72); font-size: 10px; }
.tb-decor { position: absolute; display: block; border: 1px solid rgba(255,255,255,.10); border-radius: 50%; pointer-events: none; }
.tb-decor-one { width: 280px; height: 280px; left: -110px; top: -100px; }
.tb-decor-two { width: 420px; height: 420px; left: -190px; bottom: -250px; }

@media (max-width: 820px) {
    body.tb-auth-body { align-items: flex-start; padding: 16px 12px 20px; }
    .tb-auth-wrap { max-width: 580px; }
    .tb-auth-card { display: block; border-radius: 19px; }
    .tb-auth-aside { display: none; }
    .tb-auth-form-panel { padding: 22px clamp(17px, 5vw, 32px) 18px; }
    .tb-auth-mobile-brand { display: flex; align-items: center; gap: 9px; margin: 0 0 20px; }
    .tb-auth-content { max-width: none; }
}
@media (max-width: 560px) {
    .tb-form-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .tb-grid-full { grid-column: auto; }
    .tb-form-heading { margin-bottom: 18px; }
    .tb-form-heading h1 { font-size: 23px; }
    .tb-captcha-caption { align-items: flex-start; flex-direction: column; gap: 3px; }
    .tb-captcha-input { width: 100%; max-width: none; }
    .tb-form-options { align-items: flex-start; flex-direction: column; }
    .tb-auth-footer { align-items: center; flex-direction: column; gap: 4px; }
}
@media (max-width: 360px) {
    body.tb-auth-body { padding-right: 8px; padding-left: 8px; }
    .tb-auth-form-panel { padding-right: 14px; padding-left: 14px; }
    .tb-captcha { padding: 9px; }
    .tb-captcha-row { gap: 6px; }
    .tb-captcha-question { min-width: 70px; }
}
@media (prefers-reduced-motion: reduce) {
    body.tb-auth-body *, body.tb-auth-body *::before, body.tb-auth-body *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
