/**
 * Login — fixed ideal card size per device (desktop / laptop / tablet / phone)
 * Does not scale with huge monitors; stays centered at standard form size.
 */

:root {
    --auth-blue: #0096ee;
    --auth-blue-hover: #0080cc;
    --auth-blue-light: #33aaf1;
    --auth-blue-soft: rgba(0, 150, 238, 0.12);
    --auth-blue-glow: rgba(0, 150, 238, 0.22);
    --auth-blue-text: #0284c7;
    --auth-green: #39c529;

    /* Ideal card widths per breakpoint (fixed px, not vw) */
    --auth-card-desktop: 940px;
    --auth-card-laptop: 860px;
    --auth-card-tablet: 720px;
    --auth-card-tablet-sm: 440px;
    --auth-card-phone: 100%;

    --auth-form-max: 320px;
}

body.login_admin,
body.customers_login {
    margin: 0;
    padding: 0;
    min-height: 100%;
    min-height: 100dvh;
    background: var(--theme-login-page-bg, #eef2f6) !important;
    font-family: 'Poppins', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body.login_admin header,
body.login_admin footer,
body.customers_login header,
body.customers_login footer.footer,
body.customers_login .header {
    display: none !important;
}

body.customers_login #wrapper,
body.customers_login #wrapper #content,
body.customers_login .container,
body.customers_login div#content {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    min-height: 100dvh;
}

/* ── Page — centered, natural flow ─────────────────────── */

.auth-page {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
    background: var(--theme-login-page-bg, #eef2f6);
}

.auth-card {
    width: var(--auth-card-desktop);
    max-width: 100%;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 150, 238, 0.12);
    overflow: hidden;
    box-sizing: border-box;
    flex-shrink: 0;
}

.auth-card--split {
    display: grid;
    grid-template-columns: 3fr 2fr;
    align-items: stretch;
}

/* ── Left panel ─────────────────────────────────────────── */

.auth-panel-left {
    padding: 32px 28px;
    background:
        radial-gradient(circle at 20% 15%, rgba(0, 150, 238, 0.1), transparent 42%),
        radial-gradient(circle at 85% 80%, rgba(57, 197, 41, 0.08), transparent 38%),
        linear-gradient(165deg, #f4f9ff 0%, #e8f2f8 55%, #f7fbff 100%);
    border-right: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    box-sizing: border-box;
}

.auth-panel-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.auth-panel-logo img,
.auth-panel-logo-img {
    max-height: 52px;
    max-width: 170px;
    width: auto;
    display: block;
}

.auth-panel-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.03em;
    background: linear-gradient(90deg, var(--auth-blue) 0%, var(--auth-blue-light) 50%, var(--auth-green) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.auth-panel-lead {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: #475569;
}

.auth-stats {
    display: flex;
    gap: 8px;
}

.auth-stat {
    flex: 1;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 150, 238, 0.15);
    border-radius: 10px;
    padding: 10px 6px;
    text-align: center;
}

.auth-stat strong {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: var(--auth-blue);
    line-height: 1.2;
}

.auth-stat span {
    display: block;
    margin-top: 3px;
    font-size: 8px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #64748b;
}

.auth-features {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-features li {
    position: relative;
    padding: 10px 12px 10px 30px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 150, 238, 0.12);
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.45;
    color: #334155;
}

.auth-features li::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 15px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--auth-blue);
}

.auth-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.auth-tags span {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--auth-blue);
    background: var(--auth-blue-soft);
    border: 1px solid rgba(0, 150, 238, 0.2);
    border-radius: 999px;
    padding: 5px 10px;
}

/* ── Right form panel ───────────────────────────────────── */

.auth-panel-right {
    padding: 32px 28px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.auth-body {
    width: 100%;
    max-width: var(--auth-form-max);
    margin: 0 auto;
    box-sizing: border-box;
}

.auth-company-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eef1f5;
}

.auth-company-logo {
    max-height: 36px;
    max-width: 90px;
    object-fit: contain;
}

.auth-company-name {
    font-size: 17px;
    font-weight: 700;
    color: var(--auth-blue-text);
}

.auth-heading {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 600;
    color: var(--auth-blue-text);
    line-height: 1.3;
}

.auth-subheading {
    margin: 0 0 18px;
    font-size: 13px;
    line-height: 1.5;
    color: #64748b;
}

.auth-body .form-group {
    margin-bottom: 14px;
}

.auth-body label,
.auth-body .control-label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
}

.auth-body .form-control {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border-radius: 8px;
    background: #ffffff;
    border: 1px solid #d1d9e6;
    color: #334155;
    font-size: 14px;
    box-shadow: none !important;
    box-sizing: border-box;
}

.auth-body .form-control:focus {
    border-color: var(--auth-blue) !important;
    box-shadow: 0 0 0 3px var(--auth-blue-glow) !important;
    outline: none;
}

.auth-body .form-control::placeholder {
    color: #94a3b8;
}

.auth-body .row {
    margin: 0 !important;
}

.auth-body .row > [class*="col-"] {
    padding: 0 !important;
}

.auth-body .row.align-items-center .col-sm-6 {
    width: 50%;
    float: left;
}

.auth-body .row.align-items-center .col-sm-6.text-right {
    text-align: right;
}

.auth-body .checkbox label {
    font-size: 13px;
    color: #475569;
}

.auth-body a {
    color: var(--auth-blue);
    font-size: 13px;
    text-decoration: none;
}

.auth-body a:hover {
    text-decoration: underline;
}

.auth-body .btn-primary,
.auth-body .btn-success {
    width: 100%;
    height: 46px;
    margin-top: 4px;
    border: none !important;
    border-radius: 10px !important;
    background: var(--theme-btn-gradient, linear-gradient(90deg, #0096ee 0%, #00fec0 100%)) !important;
    color: #ffffff !important;
    font-weight: 600;
    font-size: 15px;
    box-shadow: var(--theme-btn-shadow, 0 4px 14px rgba(0, 150, 238, 0.28));
    transition: transform 0.12s ease, box-shadow 0.2s ease;
}

.auth-body .btn-primary:hover,
.auth-body .btn-success:hover {
    background: var(--theme-btn-gradient-hover, linear-gradient(90deg, #0080cc 0%, #00e0b0 100%)) !important;
    transform: translateY(-1px);
    box-shadow: var(--theme-btn-shadow-hover, 0 6px 18px rgba(0, 150, 238, 0.35));
}

.auth-switch {
    margin: 14px 0 0;
    font-size: 13px;
    color: #64748b;
    text-align: center;
}

.auth-footer {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #eef1f5;
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
}

.auth-body .alert {
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 12px;
    padding: 10px 12px;
}

.auth-body .bootstrap-select {
    width: 100% !important;
}

.auth-body .bootstrap-select > .dropdown-toggle {
    height: 44px;
    border-radius: 8px;
}

/* ── Dark theme ─────────────────────────────────────────── */

html[data-theme="dark"] .auth-card {
    border-color: #2a3544;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .auth-panel-left {
    background:
        radial-gradient(circle at 20% 15%, rgba(0, 150, 238, 0.15), transparent 42%),
        radial-gradient(circle at 85% 80%, rgba(57, 197, 41, 0.08), transparent 38%),
        linear-gradient(165deg, #1a2836 0%, #1e3044 55%, #182230 100%);
    border-right-color: #3a5068;
}

html[data-theme="dark"] .auth-panel-right {
    background: #141c26;
}

html[data-theme="dark"] .auth-panel-lead,
html[data-theme="dark"] .auth-subheading,
html[data-theme="dark"] .auth-switch,
html[data-theme="dark"] .auth-footer {
    color: #8494a7;
}

html[data-theme="dark"] .auth-heading,
html[data-theme="dark"] .auth-company-name {
    color: var(--auth-blue-light);
}

html[data-theme="dark"] .auth-features li,
html[data-theme="dark"] .auth-stat {
    background: rgba(20, 28, 38, 0.85);
    border-color: #2a3544;
    color: #b8c5d4;
}

html[data-theme="dark"] .auth-body .form-control {
    background: #1a2432;
    border-color: #3a4656;
    color: #e8eef4;
}

html[data-theme="dark"] .auth-company-brand,
html[data-theme="dark"] .auth-footer {
    border-color: #2a3544;
}

html[data-theme="dark"] .auth-body label {
    color: #b8c5d4;
}

/* ── Laptop (1024–1279) ─────────────────────────────────── */

@media (max-width: 1279px) {
    .auth-card {
        width: var(--auth-card-laptop);
    }

    .auth-panel-left,
    .auth-panel-right {
        padding: 28px 24px;
    }
}

/* ── Tablet landscape (768–1023) ────────────────────────── */

@media (max-width: 1023px) {
    .auth-card {
        width: var(--auth-card-tablet);
    }

    .auth-panel-title {
        font-size: 22px;
    }
}

/* ── Tablet portrait (481–767) — stack panels ───────────── */

@media (max-width: 767px) {
    .auth-page {
        padding: 20px 16px;
        align-items: flex-start;
        padding-top: max(20px, env(safe-area-inset-top));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }

    .auth-card {
        width: var(--auth-card-tablet-sm);
    }

    .auth-card--split {
        grid-template-columns: 1fr;
    }

    .auth-panel-left {
        padding: 24px 20px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
    }

    .auth-panel-right {
        padding: 24px 20px;
    }

    .auth-features li:nth-child(n+3) {
        display: none;
    }

    .auth-body {
        max-width: 100%;
    }
}

/* ── Phone / iOS (≤480) ─────────────────────────────────── */

@media (max-width: 480px) {
    .auth-page {
        padding: 16px 12px;
    }

    .auth-card {
        width: var(--auth-card-phone);
        max-width: 400px;
        border-radius: 14px;
    }

    .auth-panel-left,
    .auth-panel-right {
        padding: 20px 18px;
    }

    .auth-panel-logo img,
    .auth-panel-logo-img {
        max-height: 44px;
    }

    .auth-panel-title {
        font-size: 20px;
    }

    .auth-panel-lead {
        font-size: 12px;
    }

    .auth-stats {
        gap: 6px;
    }

    .auth-stat strong {
        font-size: 14px;
    }

    .auth-features {
        display: none;
    }

    .auth-tags {
        display: none;
    }

    .auth-heading {
        font-size: 18px;
    }

    .auth-body .form-control {
        height: 48px;
        font-size: 16px;
    }

    .auth-body .btn-primary,
    .auth-body .btn-success {
        height: 48px;
    }

    .auth-body .row.align-items-center .col-sm-6,
    .auth-body .row.align-items-center .col-sm-6.text-right {
        width: 100%;
        float: none;
        text-align: left !important;
    }

    .auth-body .row.align-items-center .col-sm-6.text-right {
        margin-top: 6px;
    }
}

/* ── Large desktop / Mac (≥1440) — cap at ideal size ───── */

@media (min-width: 1440px) {
    .auth-card {
        width: var(--auth-card-desktop);
    }
}
