/* =========================================================
   PFXCRM / Xfer360 - Modern secure authentication UI
   Scoped to .auth-modern so other pages are not affected.
   ========================================================= */

body.login_admin,
body.customers_login {
    --auth-bg-1: #070d19;
    --auth-bg-2: #0b1526;
    --auth-bg-3: #101d33;
    --auth-card: #0c1b33;
    --auth-card-soft: #10233f;
    --auth-text: #f8fafc;
    --auth-muted: #a8b6cc;
    --auth-border: rgba(148, 163, 184, .28);
    --auth-input: rgba(255, 255, 255, .06);
    --auth-link: #8CB8FF;
    --auth-primary: #1D6EFC;
    --auth-primary-2: #0B4FD1;
    --auth-primary-3: #4F8DFF;
    --auth-danger-bg: rgba(127, 29, 29, .28);
    --auth-danger-text: #fecaca;
    --auth-danger-border: rgba(248, 113, 113, .35);
    --auth-shadow: 0 30px 60px -20px rgba(2, 6, 23, .55), 0 18px 36px -24px rgba(2, 6, 23, .45);
    --auth-radius: 24px;
    color-scheme: light dark;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--auth-text);
    background:
        radial-gradient(1200px 700px at 8% -12%, rgba(29, 110, 252, .28), transparent 60%),
        radial-gradient(950px 600px at 104% -4%, rgba(29, 110, 252, .24), transparent 58%),
        radial-gradient(900px 700px at 50% 118%, rgba(79, 141, 255, .16), transparent 60%),
        linear-gradient(155deg, var(--auth-bg-1) 0%, var(--auth-bg-2) 48%, var(--auth-bg-3) 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Customer portal: hide the normal storefront chrome on login. */
body.customers_login .header,
body.customers_login .footer {
    display: none !important;
}

body.customers_login #wrapper,
body.customers_login #content {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    min-height: 100vh;
}

body.customers_login #content {
    display: block;
}

body.customers_login #content > .container {
    width: 100%;
    max-width: none;
    padding: 0;
}

body.customers_login #content > .container > .row {
    margin: 0;
}

body.customers_login #content > .container > .row > [class*="col-"] {
    width: 100%;
    float: none;
    margin: 0;
    padding: 0;
}

.auth-modern {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    overflow: hidden;
    color: var(--auth-text);
}

.auth-modern::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, .55), transparent 72%);
    mask-image: radial-gradient(ellipse at center, rgba(0, 0, 0, .55), transparent 72%);
    pointer-events: none;
}

.auth-modern::after {
    content: "";
    position: absolute;
    top: -260px;
    right: -160px;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(29, 110, 252, .28), transparent 68%);
    filter: blur(10px);
    pointer-events: none;
}

.auth-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
}

.auth-card {
    position: relative;
    overflow: hidden;
    padding: 38px 34px 30px;
    background: linear-gradient(160deg, #0c1b33 0%, #0f172a 100%);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: var(--auth-radius);
    box-shadow: var(--auth-shadow);
    color: var(--auth-text);
}

.auth-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--auth-primary-2), var(--auth-primary), var(--auth-primary-3));
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    margin: 0 auto 22px;
}

.auth-modern .auth-brand a {
    display: inline-flex;
    float: none !important;
    align-items: center;
    justify-content: center;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    text-decoration: none;
}

.auth-brand img {
    display: block;
    width: auto;
    max-width: 200px;
    max-height: 42px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(2, 6, 23, .35));
}

.auth-header {
    margin-bottom: 26px;
    text-align: center;
}

.auth-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 12px;
    padding: 6px 10px;
    border: 1px solid rgba(29, 110, 252, .25);
    border-radius: 999px;
    background: rgba(29, 110, 252, .12);
    color: var(--auth-link);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.auth-eyebrow svg {
    width: 13px;
    height: 13px;
}

.auth-header h1 {
    margin: 0 0 8px;
    color: var(--auth-text);
    font-size: 26px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -.03em;
    text-transform: none;
}

.auth-header p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.55;
}

.auth-field {
    margin-bottom: 18px;
}

.auth-modern .auth-field > label,
.auth-modern .auth-label-row label {
    display: block;
    margin: 0 0 8px;
    color: var(--auth-text);
    font-size: 13px;
    font-weight: 600 !important;
}

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

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 15px;
    z-index: 2;
    width: 18px;
    height: 18px;
    color: var(--auth-muted);
    pointer-events: none;
}

.auth-modern .auth-input {
    width: 100%;
    height: 52px;
    padding: 0 48px 0 46px;
    border: 1.5px solid var(--auth-border);
    border-radius: 14px;
    background: var(--auth-input);
    box-shadow: none;
    color: var(--auth-text);
    font-size: 15px;
    line-height: 1;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.auth-modern .auth-input:hover {
    border-color: rgba(148, 163, 184, .5);
}

.auth-modern .auth-input:focus {
    outline: none;
    border-color: #4F8DFF;
    background: rgba(255, 255, 255, .08);
    box-shadow: 0 0 0 4px rgba(29, 110, 252, .18);
}

.auth-modern .auth-input::placeholder {
    color: #94a3b8;
}

.auth-modern .auth-input:-webkit-autofill {
    -webkit-text-fill-color: var(--auth-text);
    -webkit-box-shadow: 0 0 0 1000px #0f1e38 inset;
    transition: background-color 9999s ease-out;
}

.auth-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--auth-muted);
    cursor: pointer;
    transform: translateY(-50%);
    transition: background .15s ease, color .15s ease;
}

.auth-toggle:hover {
    background: rgba(255, 255, 255, .08);
    color: var(--auth-text);
}

.auth-toggle:focus-visible {
    outline: 3px solid rgba(29, 110, 252, .35);
    outline-offset: 2px;
}

.auth-toggle svg {
    width: 20px;
    height: 20px;
}

.auth-toggle .auth-eye-off {
    display: none;
}

.auth-toggle[aria-pressed="true"] .auth-eye-open {
    display: none;
}

.auth-toggle[aria-pressed="true"] .auth-eye-off {
    display: block;
}

.auth-hint {
    margin: 7px 0 0;
    color: var(--auth-muted);
    font-size: 12px;
    line-height: 1.4;
}

.auth-caps {
    color: #fbbf24;
    font-weight: 600;
}

.auth-modern .alert,
.auth-alert {
    margin-bottom: 16px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 13.5px;
}

.auth-alert-danger,
.auth-modern .alert-danger {
    border-color: var(--auth-danger-border);
    background: var(--auth-danger-bg);
    color: var(--auth-danger-text);
}

.auth-modern .alert-success {
    border-color: rgba(16, 185, 129, .3);
    background: rgba(16, 185, 129, .12);
    color: #6ee7b7;
}

.auth-modern .alert-info {
    border-color: rgba(29, 110, 252, .3);
    background: rgba(29, 110, 252, .12);
    color: #8CB8FF;
}

.auth-modern .text-danger,
.auth-modern .error {
    margin-top: 6px;
    color: var(--auth-danger-text);
    font-size: 12.5px;
}

.auth-recaptcha {
    display: flex;
    justify-content: center;
    margin: 4px 0 18px;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin: 2px 0 22px;
}

.auth-modern .auth-check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    color: var(--auth-muted);
    font-size: 13.5px;
    font-weight: 500 !important;
    cursor: pointer;
    user-select: none;
}

.auth-check input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.auth-check-box {
    display: inline-flex;
    flex: 0 0 19px;
    align-items: center;
    justify-content: center;
    width: 19px;
    height: 19px;
    border: 1.5px solid var(--auth-border);
    border-radius: 6px;
    background: rgba(255, 255, 255, .06);
    transition: background .15s ease, border-color .15s ease;
}

.auth-check input:checked + .auth-check-box {
    border-color: transparent;
    background: linear-gradient(135deg, var(--auth-primary-2), var(--auth-primary));
}

.auth-check input:checked + .auth-check-box::after {
    content: "";
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
}

.auth-check input:focus-visible + .auth-check-box {
    outline: 3px solid rgba(29, 110, 252, .35);
    outline-offset: 2px;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--auth-primary-2) 0%, var(--auth-primary) 60%, var(--auth-primary-3) 100%);
    box-shadow: 0 16px 30px -14px rgba(29, 110, 252, .75);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .01em;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.auth-btn:hover {
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 20px 34px -14px rgba(29, 110, 252, .85);
    filter: saturate(1.05);
}

.auth-btn:active {
    transform: translateY(0);
}

.auth-btn:focus-visible {
    outline: 3px solid rgba(29, 110, 252, .45);
    outline-offset: 3px;
}

.auth-btn-secondary {
    margin-top: 10px;
    border: 1.5px solid var(--auth-border);
    background: transparent;
    box-shadow: none;
    color: var(--auth-link);
}

.auth-btn-secondary:hover {
    background: rgba(29, 110, 252, .08);
    box-shadow: none;
    color: var(--auth-link);
}

.auth-link {
    color: var(--auth-link);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

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

.auth-link:focus-visible {
    outline: 3px solid rgba(29, 110, 252, .35);
    outline-offset: 2px;
    border-radius: 4px;
}

.auth-modern .auth-select {
    width: 100%;
    height: 52px;
    padding: 0 42px 0 16px;
    border: 1.5px solid var(--auth-border);
    border-radius: 14px;
    background-color: var(--auth-input);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a8b6cc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    color: var(--auth-text);
    font-size: 15px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.auth-modern .auth-select:focus {
    outline: none;
    border-color: #4F8DFF;
    background-color: rgba(255, 255, 255, .08);
    box-shadow: 0 0 0 4px rgba(29, 110, 252, .18);
}

.auth-modern .auth-select option {
    background: #0f1e38;
    color: var(--auth-text);
}

/* The theme auto-initializes selects as Bootstrap Select. */
.auth-modern .bootstrap-select.auth-select {
    width: 100% !important;
    height: auto !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
}

.auth-modern .bootstrap-select > .dropdown-toggle,
.auth-modern .bootstrap-select .btn-default {
    width: 100%;
    height: 52px !important;
    padding: 0 42px 0 16px !important;
    border: 1.5px solid var(--auth-border) !important;
    border-radius: 14px !important;
    background: rgba(255, 255, 255, .06) !important;
    box-shadow: none !important;
    color: var(--auth-text) !important;
    font-size: 15px !important;
    text-transform: none !important;
}

.auth-modern .bootstrap-select > .dropdown-toggle:focus,
.auth-modern .bootstrap-select.show > .dropdown-toggle {
    border-color: #4F8DFF !important;
    box-shadow: 0 0 0 4px rgba(29, 110, 252, .18) !important;
    outline: none !important;
}

.auth-modern .bootstrap-select .filter-option,
.auth-modern .bootstrap-select .filter-option-inner-inner {
    color: var(--auth-text) !important;
    line-height: 50px !important;
}

.auth-modern .bootstrap-select .caret {
    border-top-color: var(--auth-text) !important;
}

.auth-modern .bootstrap-select .dropdown-menu {
    min-width: 100%;
    padding: 6px;
    border: 1px solid var(--auth-border) !important;
    border-radius: 12px !important;
    background: #0f1e38 !important;
    box-shadow: 0 24px 48px -24px rgba(0, 0, 0, .8) !important;
}

.auth-modern .bootstrap-select .dropdown-menu li a,
.auth-modern .bootstrap-select .dropdown-menu .text {
    color: var(--auth-text) !important;
}

.auth-modern .bootstrap-select .dropdown-menu li a:hover,
.auth-modern .bootstrap-select .dropdown-menu li.selected a {
    background: rgba(29, 110, 252, .15) !important;
    color: #fff !important;
}

.auth-note {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 7px;
    margin: 22px 0 0;
    padding-top: 18px;
    border-top: 1px solid var(--auth-border);
    color: var(--auth-muted);
    font-size: 12px;
    line-height: 1.5;
    text-align: center;
}

.auth-note svg {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    margin-top: 2px;
    color: var(--auth-link);
}

.auth-meta {
    margin-top: 16px;
    color: rgba(226, 232, 240, .72);
    font-size: 12px;
    text-align: center;
    text-shadow: 0 1px 2px rgba(2, 6, 23, .4);
}

.auth-meta a {
    color: rgba(226, 232, 240, .9);
    text-decoration: none;
}

@media (max-width: 520px) {
    .auth-modern {
        padding: 24px 12px;
    }

    .auth-card {
        padding: 30px 22px 24px;
        border-radius: 20px;
    }

    .auth-header h1 {
        font-size: 23px;
    }

    .auth-brand img {
        max-height: 38px;
    }
}

@media (max-width: 420px) {
    .auth-recaptcha .g-recaptcha {
        transform: scale(.9);
        transform-origin: center;
    }
}

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