/* ==========================================================================
   Dealers Marketing — auth (login / signup / forgot / reset)
   Split panel per mockups/login.html. Dark theme.

   Display values here must stay compatible with auth.js, which toggles
   elements with inline styles:
     #auth-container      -> display:flex
     .auth-tabs           -> display:flex / none
     #auth-password-field -> display:flex / none
     #forgot-password-link-> display:block / none
     #auth-error          -> display:block / none
   ========================================================================== */

#auth-container {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background: var(--bg);
}

.auth-shell {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: 1160px;
    min-height: 680px;
    border: 1px solid var(--line);
    border-radius: 28px;
    overflow: hidden;
}

/* ---------- left: brand panel ---------- */
.auth-brand {
    background: var(--nav);
    color: #fff;
    padding: 56px 52px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.auth-brand::before,
.auth-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(20px);
    pointer-events: none;
}

.auth-brand::before {
    width: 520px;
    height: 520px;
    right: -160px;
    top: -140px;
    background: radial-gradient(circle, rgba(173, 123, 255, .35), transparent 70%);
}

.auth-brand::after {
    width: 440px;
    height: 440px;
    left: -160px;
    bottom: -160px;
    background: radial-gradient(circle, rgba(211, 242, 106, .22), transparent 70%);
}

.auth-brand-logo {
    position: relative;
    margin-bottom: auto;
}

.auth-brand-logo img {
    height: 34px;
    width: auto;
    object-fit: contain;
    display: block;
}

.auth-brand h2 {
    position: relative;
    font-size: 44px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.05;
    margin-bottom: 16px;
}

.auth-brand h2 span {
    color: var(--purple);
}

.auth-brand p {
    position: relative;
    color: #B7B7BE;
    font-size: 15px;
    max-width: 360px;
    line-height: 1.6;
    margin-bottom: 34px;
}

.auth-feat {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    list-style: none;
}

.auth-feat li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: #E4E4E8;
}

.auth-feat li i {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: var(--lime);
    color: var(--ink);
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.auth-feat li i svg {
    width: 15px;
    height: 15px;
}

/* ---------- right: form panel ---------- */
.auth-card {
    background: var(--surface);
    padding: 56px 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-logo {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 26px;
}

.auth-logo img {
    height: 40px;
    width: auto;
    object-fit: contain;
    margin-bottom: 20px;
}

/* the brand panel already carries the lockup — don't repeat it beside itself */
@media (min-width: 901px) {
    .auth-brand + .auth-card .auth-logo img {
        display: none;
    }
}

.auth-logo h2 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.15;
}

.auth-logo p {
    color: var(--text-dim);
    font-size: 14px;
    margin-top: 6px;
}

.auth-tabs {
    display: flex;
    background: var(--surface-2);
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    text-align: center;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-dim);
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    transition: background .18s, color .18s;
}

.auth-tab:hover {
    color: var(--text);
}

.auth-tab.active {
    background: var(--surface);
    color: var(--text);
}

.auth-form {
    display: flex;
    flex-direction: column;
}

.auth-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.auth-field label {
    font-size: 12.5px;
    color: var(--text-dim);
    font-weight: 500;
    margin-bottom: 7px;
}

.auth-field input {
    width: 100%;
    background: var(--field);
    border: 1.5px solid transparent;
    border-radius: 12px;
    padding: 14px 15px;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color .18s, background .18s;
}

.auth-field input::placeholder {
    color: var(--text-mute);
}

.auth-field input:focus {
    border-color: var(--purple);
    background: var(--field-focus);
}

.auth-forgot-password {
    text-align: right;
    margin-bottom: 20px;
}

.auth-forgot-password a {
    font-size: 12.5px;
    color: var(--purple);
    font-weight: 600;
    text-decoration: none;
}

.auth-forgot-password a:hover {
    color: var(--purple-700);
}

.auth-btn {
    width: 100%;
    background: var(--lime);
    color: var(--ink);
    border: none;
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    padding: 15px;
    border-radius: 13px;
    cursor: pointer;
    transition: background .18s;
}

.auth-btn:hover:not(:disabled) {
    background: var(--lime-600);
}

.auth-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.auth-error {
    display: none;
    background: rgba(229, 72, 77, .1);
    border: 1px solid rgba(229, 72, 77, .22);
    color: #FF8A8E;
    font-size: 13px;
    padding: 12px 14px;
    border-radius: 11px;
    margin-bottom: 18px;
    line-height: 1.45;
}

.auth-footer {
    text-align: center;
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 22px;
}

.auth-footer a {
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
}

.auth-footer a:hover {
    color: var(--lime);
}

.auth-terms {
    text-align: center;
    font-size: 11.5px;
    color: var(--text-mute);
    margin-top: 14px;
    line-height: 1.6;
}

.auth-terms a {
    color: var(--text-dim);
    text-decoration: underline;
}

.auth-terms a:hover {
    color: var(--text);
}

/* ---------- global loader ---------- */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 900;
}

.loading-overlay .spinner {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 3px solid var(--surface-2);
    border-top-color: var(--lime);
    animation: auth-spin .8s linear infinite;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: 1fr;
        min-height: 0;
        max-width: 460px;
    }

    /* the brand panel is decorative — the form is what matters on a phone */
    .auth-brand {
        display: none;
    }

    .auth-card {
        padding: 40px 28px;
    }
}

@media (max-width: 420px) {
    #auth-container {
        padding: 14px;
    }

    .auth-card {
        padding: 32px 20px;
    }

    .auth-logo h2 {
        font-size: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .loading-overlay .spinner {
        animation: none;
    }
}
