/* ==========================================================================
   Theme 3 — TawiOS Split-screen Auth Design
   Self-contained design system, independent from the classic auth theme.
   Tune the tokens in :root to restyle without touching markup.
   ========================================================================== */

:root {
    --t3-primary: var(--header_color, #2f6fed);
    --t3-primary-hover: color-mix(in srgb, var(--t3-primary) 88%, #000);

    --t3-text: #101828;
    --t3-text-muted: #667085;
    --t3-placeholder: #98a2b3;
    --t3-border: #e4e7ec;
    --t3-border-hover: #d0d5dd;
    --t3-field-bg: #ffffff;
    --t3-bg: #ffffff;
    --t3-subtle-bg: #f9fafb;

    --t3-danger: #d92d20;
    --t3-success: #067647;
    --t3-info: #175cd3;

    --t3-radius: 10px;
    --t3-radius-sm: 8px;
    --t3-input-height: 44px;
    --t3-panel-width: 520px;
    --t3-content-width: 400px;

    --t3-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --t3-shadow-btn: 0 1px 3px rgba(16, 24, 40, .10);

    /* Match the main app's body font (main.css) */
    --t3-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

html, body.t3-body {
    height: 100%;
}

body.t3-body {
    margin: 0;
    font-family: var(--t3-font);
    color: var(--t3-text);
    background: var(--t3-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

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

.t3-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100svh;
}

/* ==========================================================================
   Left panel (form)
   ========================================================================== */

.t3-panel-left {
    width: 100%;
    max-width: var(--t3-panel-width);
    flex: 0 0 var(--t3-panel-width);
    min-width: 0;
    background: var(--t3-bg);
    overflow-y: auto;
    overflow-x: hidden;
}

.t3-panel-left-inner {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: var(--t3-content-width);
    min-height: 100vh;
    min-height: 100svh;
    margin: 0 auto;
    padding: 54px 27px 34px;
}

/* Logo + form grouped and vertically centred within the panel. */
.t3-panel-left-main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 0;
}

.t3-brand {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.t3-brand-logo {
    max-height: 38px;
    border-radius: 6px;
    margin-right: 10px;
}

.t3-brand-name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--t3-text);
}

#auth-form-container {
    width: 100%;
}

/* Smaller, understated login heading that sits directly under the logo. */
.t3-login-heading {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -.01em;
    margin: 0 0 22px;
    color: var(--t3-text);
}

.t3-title {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -.02em;
    line-height: 1.2;
    margin: 0 0 7px;
    color: var(--t3-text);
}

.t3-subtitle {
    font-size: 14px;
    line-height: 1.55;
    color: var(--t3-text-muted);
    margin: 0 0 27px;
}

/* ==========================================================================
   Form controls
   ========================================================================== */

.t3-form .form-group {
    margin-bottom: 12px;
}

.t3-form label {
    display: inline-block;
    font-weight: 500;
    font-size: 13px;
    color: var(--t3-text);
    margin-bottom: 6px;
}

/* 16px is not a taste: below it, iOS Safari zooms the page in on focus and the
   visitor is left panning around a form they were halfway through typing. */
.t3-form .form-control {
    display: block;
    width: 100%;
    height: var(--t3-input-height);
    padding: 0 13px;
    font-size: 16px;
    font-family: inherit;
    color: var(--t3-text);
    background: var(--t3-field-bg);
    border: 1px solid var(--t3-border);
    border-radius: var(--t3-radius);
    box-shadow: var(--t3-shadow-sm);
    transition: border-color .15s ease, box-shadow .15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.t3-form .form-control::placeholder {
    color: var(--t3-placeholder);
}

.t3-form .form-control:hover {
    border-color: var(--t3-border-hover);
}

.t3-form .form-control:focus {
    outline: none;
    border-color: var(--t3-primary);
    /* Fallback for browsers without color-mix, then a primary-tinted ring. */
    box-shadow: 0 0 0 4px rgba(47, 111, 237, .14);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--t3-primary) 16%, transparent);
}

.t3-form .form-control.is-invalid {
    border-color: var(--t3-danger);
}

.t3-form .form-control.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(217, 45, 32, .14);
}

.t3-form .invalid-feedback {
    display: block;
    margin-top: 5px;
    font-size: 12.5px;
    color: var(--t3-danger);
}

/* Input group (password toggle, subdomain suffix) */
.t3-form .input-group {
    display: flex;
    align-items: stretch;
    position: relative;
}

.t3-form .input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.t3-form .input-group-text,
.t3-form .toggle-password {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 13px;
    font-size: 14px;
    border: 1px solid var(--t3-border);
    border-left: none;
    border-top-right-radius: var(--t3-radius);
    border-bottom-right-radius: var(--t3-radius);
    background: var(--t3-field-bg);
    color: var(--t3-text-muted);
    box-shadow: var(--t3-shadow-sm);
}

.t3-form .toggle-password {
    cursor: pointer;
    transition: color .15s ease, background .15s ease;
}

.t3-form .toggle-password:hover {
    color: var(--t3-text);
    background: var(--t3-subtle-bg);
}

/* Keep the toggle button border in sync when the field is focused. */
.t3-form .input-group:focus-within .form-control,
.t3-form .input-group:focus-within .input-group-text,
.t3-form .input-group:focus-within .toggle-password {
    border-color: var(--t3-primary);
}

.t3-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--t3-text-muted);
    margin-bottom: 19px;
    cursor: pointer;
}

.t3-checkbox input {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin-top: 1px;
    accent-color: var(--t3-primary);
    cursor: pointer;
}

.t3-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: -2px 0 19px;
}

.t3-row-between .t3-checkbox {
    margin-bottom: 0;
}

.t3-link {
    font-size: 13px;
    font-weight: 500;
    color: var(--t3-primary);
    text-decoration: none;
    transition: color .15s ease;
}

.t3-link:hover {
    color: var(--t3-primary-hover);
    text-decoration: underline;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.t3-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    height: var(--t3-input-height);
    border-radius: var(--t3-radius);
    font-size: 15px;
    font-family: inherit;
    font-weight: 600;
    line-height: 1;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .12s ease, box-shadow .15s ease, opacity .15s ease;
}

.t3-btn i {
    transition: transform .15s ease;
}

.t3-btn:hover i {
    transform: translateX(3px);
}

.t3-btn:active {
    transform: translateY(1px);
}

.t3-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

.t3-btn-primary {
    background: var(--t3-primary);
    color: #fff;
    box-shadow: var(--t3-shadow-btn);
}

.t3-btn-primary:hover {
    background: var(--t3-primary-hover);
}

.t3-btn-secondary {
    background: #fff;
    color: var(--t3-text);
    border-color: var(--t3-border);
    box-shadow: var(--t3-shadow-sm);
}

.t3-btn-secondary:hover {
    background: var(--t3-subtle-bg);
    border-color: var(--t3-border-hover);
}

.t3-btn + .t3-btn {
    margin-top: 10px;
}

/* ==========================================================================
   Social login + dividers
   ========================================================================== */

.t3-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 19px 0;
    color: var(--t3-text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.t3-divider::before,
.t3-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--t3-border);
}

.t3-social-row {
    display: flex;
    gap: 10px;
    margin-bottom: 4px;
}

.t3-social-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    border-radius: var(--t3-radius);
    border: 1px solid var(--t3-border);
    background: #fff;
    box-shadow: var(--t3-shadow-sm);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .12s ease;
}

.t3-social-btn:hover {
    background: var(--t3-subtle-bg);
    border-color: var(--t3-border-hover);
    transform: translateY(-1px);
}

.t3-social-btn img {
    height: 20px;
}

/* ==========================================================================
   Alerts
   ========================================================================== */

/* Bootstrap isn't loaded on the auth pages, but the markup/JS uses `d-none`
   to hide/show elements — define it here so hidden alerts stay hidden. */
.d-none {
    display: none !important;
}

.t3-alert {
    padding: 11px 13px;
    border-radius: var(--t3-radius-sm);
    border: 1px solid transparent;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 19px;
}

/* Safety net: never show an alert box that has no content. */
.t3-alert:empty {
    display: none;
}

.t3-alert ul {
    margin: 0;
    padding-left: 15px;
}

.t3-alert-info {
    background: #eff4ff;
    border-color: #d1e0ff;
    color: #1849a9;
}

.t3-alert-success {
    background: #ecfdf3;
    border-color: #abefc6;
    color: #067647;
}

.t3-alert-danger {
    background: #fef3f2;
    border-color: #fecdca;
    color: #b42318;
}

/* ==========================================================================
   Floating light / dark theme toggle
   Browser-level only: default is the admin theme, user choice persists in
   localStorage (see js/theme-toggle.js). Fixed to the bottom-right corner.
   ========================================================================== */

.t3-theme-toggle {
    position: fixed;
    right: 16px;
    bottom: 20px;
    z-index: 90;
    display: flex;
    flex-direction: column;
    width: 46px;
    height: 108px;
    padding: 5px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 30px;
    background: #10141c;
    box-shadow: 0 12px 30px rgba(16, 24, 40, .32);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.t3-theme-opt {
    position: relative;
    z-index: 1;
    flex: 1 1 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .5);
}

.t3-theme-thumb {
    position: absolute;
    left: 6px;
    right: 6px;
    top: 6px;
    height: calc(50% - 6px);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    color: #fff;
    background: linear-gradient(180deg, #313a4b 0%, #232a37 100%);
    box-shadow: 0 5px 14px rgba(0, 0, 0, .4);
    transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}

.t3-theme-toggle[data-mode="dark"] .t3-theme-thumb {
    transform: translateY(100%);
}

.t3-theme-ic {
    font-size: 12px;
    line-height: 1;
}

.t3-theme-ic--moon { display: none; }
.t3-theme-toggle[data-mode="dark"] .t3-theme-ic--sun { display: none; }
.t3-theme-toggle[data-mode="dark"] .t3-theme-ic--moon { display: inline; }

@media (max-width: 1024px) {
    .t3-theme-toggle { right: 12px; bottom: 14px; }
}

@media (max-width: 600px) {
    /* Slightly smaller floating toggle so it doesn't crowd the phone screen. */
    .t3-theme-toggle { width: 40px; height: 94px; }
    .t3-theme-ic { font-size: 10px; }
    .t3-theme-opt { font-size: 9px; letter-spacing: .1em; }
}

/* ==========================================================================
   Footer / language switcher
   ========================================================================== */

.t3-footer-text {
    margin-top: 20px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--t3-text-muted);
    text-align: center;
}

.t3-footer-sep {
    margin: 0 7px;
    color: var(--t3-border-hover);
    user-select: none;
}

.t3-lang-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 15px;
    margin-top: 34px;
    padding-top: 19px;
    border-top: 1px solid var(--t3-border);
}

.t3-lang-switcher .t3-link {
    color: var(--t3-text-muted);
    font-weight: 400;
}

.t3-lang-switcher .t3-link:hover {
    color: var(--t3-primary);
}

/* ==========================================================================
   Left-panel footer — social links + attribution (mirrors landing footer)
   ========================================================================== */

.t3-foot {
    margin-top: 24px;
    padding-top: 19px;
    border-top: 1px solid var(--t3-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* When the language switcher is present it already draws the divider — don't
   double it up above the footer. */
.t3-lang-switcher + .t3-foot {
    margin-top: 14px;
    padding-top: 0;
    border-top: none;
}

/* ==========================================================================
   Form swap transition (ajax navigation)
   ========================================================================== */

#auth-form-container.t3-swapping {
    opacity: .35;
    transition: opacity .12s ease;
}

.t3-swapped-in {
    animation: t3-fade-in .28s ease both;
}

@keyframes t3-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .t3-swapped-in { animation: none; }
    .t3-btn:hover i { transform: none; }
}

/* ==========================================================================
   Right panel (promotional / marketing)
   ========================================================================== */

.t3-panel-right {
    position: relative;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 54px 6% 54px 54px;
    color: #fff;
    /* Derived entirely from the admin theme color (--t3-primary): a solid brand
       base with a light-to-dark diagonal sheen layered on top for depth. */
    background: var(--t3-primary);
    background:
        linear-gradient(135deg, rgba(255, 255, 255, .16) 0%, rgba(0, 0, 0, .30) 100%),
        var(--t3-primary);
}

/* Photo pinned to the far right with a chevron ("<") left edge — the point
   juts into the brand panel at the vertical centre. */
.t3-promo-media {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 50%;
    clip-path: polygon(28% 0, 100% 0, 100% 100%, 28% 100%, 0 50%);
    z-index: 1;
}

.t3-promo-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Light brand tint near the chevron edge only, so the photo stays clear while
   still blending into the theme color where it meets the panel. */
.t3-promo-media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, var(--t3-primary) 0%, rgba(255, 255, 255, 0) 34%);
    opacity: .55;
}

/* Oversized faded brand watermark behind the copy. */
.t3-promo-watermark {
    position: absolute;
    left: 44px;
    bottom: -0.16em;
    margin: 0;
    font-size: 21vw;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -.03em;
    color: rgba(255, 255, 255, .10);
    z-index: 0;
    pointer-events: none;
    user-select: none;
}

.t3-promo-copy {
    position: relative;
    z-index: 2;
    max-width: 500px;
}

.t3-promo-brand {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.01em;
    margin-bottom: 44px;
}

.t3-promo-brand-dot {
    position: relative;
    display: inline-block;
}

.t3-promo-brand-dot::after {
    content: '';
    position: absolute;
    top: 46%;
    left: 50%;
    width: .32em;
    height: .32em;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.t3-promo-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .9);
    margin-bottom: 15px;
}

.t3-promo-title {
    font-size: 40px;
    line-height: 1.06;
    font-weight: 800;
    letter-spacing: -.025em;
    margin: 0 0 19px;
    color: #fff;
    text-shadow: 0 1px 12px rgba(0, 0, 0, .18);
}

.t3-promo-text {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .94);
    margin: 0 0 29px;
    max-width: 440px;
}

.t3-promo-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 27px;
    background: #101828;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--t3-radius-sm);
    box-shadow: 0 8px 24px rgba(16, 24, 40, .22);
    transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
}

.t3-promo-btn:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(16, 24, 40, .3);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1200px) {
    .t3-promo-title { font-size: 33px; }
    .t3-promo-media { width: 44%; }
    .t3-panel-left { flex-basis: 460px; max-width: 460px; }
}

@media (max-width: 900px) {
    .t3-panel-right {
        display: none;
    }

    .t3-panel-left {
        max-width: 100%;
        flex: 1 1 auto;
    }

    .t3-panel-left-inner {
        max-width: 440px;
    }
}

@media (max-width: 480px) {
    .t3-panel-left-inner {
        padding: 37px 19px 27px;
    }

    .t3-brand {
        margin-bottom: 29px;
    }

    .t3-title {
        font-size: 22px;
    }
}

/* ==========================================================================
   Dark mode (Superadmin > Auth Theme = dark)
   ========================================================================== */

.dark-theme {
    --t3-text: #f2f4f7;
    --t3-text-muted: #98a2b3;
    --t3-placeholder: #667085;
    --t3-border: #2f3341;
    --t3-border-hover: #3d4252;
    --t3-field-bg: #1a1c26;
    --t3-subtle-bg: #22252f;
    --t3-bg: #141620;
    --t3-shadow-sm: none;
    --t3-shadow-btn: 0 1px 3px rgba(0, 0, 0, .4);
}

.dark-theme.t3-body,
.dark-theme .t3-panel-left {
    background: var(--t3-bg);
}

.dark-theme .t3-btn-secondary {
    background: var(--t3-field-bg);
    color: var(--t3-text);
    border-color: var(--t3-border);
}

.dark-theme .t3-btn-secondary:hover,
.dark-theme .t3-social-btn:hover,
.dark-theme .t3-form .toggle-password:hover {
    background: var(--t3-subtle-bg);
}

.dark-theme .t3-social-btn {
    background: var(--t3-field-bg);
    border-color: var(--t3-border);
}

.dark-theme .t3-alert-info {
    background: rgba(41, 112, 255, .12);
    border-color: rgba(41, 112, 255, .25);
    color: #84adff;
}

.dark-theme .t3-alert-success {
    background: rgba(6, 118, 71, .15);
    border-color: rgba(6, 118, 71, .3);
    color: #75e0a7;
}

.dark-theme .t3-alert-danger {
    background: rgba(217, 45, 32, .12);
    border-color: rgba(217, 45, 32, .3);
    color: #fda29b;
}
