@import url("design-system.css");

:root {
    --portal-sidebar-bg: var(--ab-secondary);
    --portal-sidebar-text: rgba(255,255,255,0.82);
    --portal-sidebar-active: rgba(var(--ab-primary-rgb), 0.18);
}

body.ab-customer-portal {
    font-family: var(--ab-font-body);
    color: var(--ab-text);
    background: var(--ab-surface-muted);
}

.ab-customer-portal .sidebar {
    background: var(--portal-sidebar-bg) !important;
}

.ab-customer-portal .sidebar-menu a,
.ab-customer-portal .sidebar-menu li a {
    color: var(--portal-sidebar-text);
    border-radius: var(--ab-radius-sm);
}

.ab-customer-portal .sidebar-menu li.active > a,
.ab-customer-portal .sidebar-menu a:hover {
    background: var(--portal-sidebar-active);
    color: #fff;
}

.ab-customer-portal .page-wrapper .content {
    padding: 1.5rem;
}

.ab-customer-portal .card {
    border: 1px solid var(--ab-border);
    border-radius: var(--ab-radius-md);
    box-shadow: var(--ab-shadow-sm);
}

.ab-customer-portal .btn-primary {
    background: var(--ab-primary);
    border-color: var(--ab-primary);
}

.ab-customer-portal .btn-primary:hover {
    background: var(--site-primary-dark, #e55a1f);
    border-color: var(--site-primary-dark, #e55a1f);
}

.ab-customer-auth {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.ab-customer-auth__brand {
    background: linear-gradient(145deg, var(--ab-secondary), #0a3558);
    color: #fff;
    padding: clamp(2rem, 6vw, 4rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ab-customer-auth__brand h1 {
    font-family: var(--ab-font-display);
    color: #fff;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
}

.ab-customer-auth__form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: #fff;
}

.ab-customer-auth__card {
    width: min(100%, 420px);
}

.ab-customer-portal .header {
    background: #fff;
    border-bottom: 1px solid var(--ab-border);
    box-shadow: var(--ab-shadow-sm);
}

.ab-customer-portal .sidebar-logo {
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.ab-customer-portal .page-wrapper {
    background: var(--ab-surface-muted);
}

.ab-customer-portal .footer {
    border-top: 1px solid var(--ab-border) !important;
}

.ab-customer-portal .form-control:focus,
.ab-customer-portal .form-select:focus {
    border-color: var(--ab-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--ab-primary-rgb), 0.15);
}

.ab-customer-portal .menu-title span {
    color: rgba(255,255,255,0.45);
    letter-spacing: 0.08em;
    font-size: 0.7rem;
}

.ab-customer-auth .form-control {
    border-radius: var(--ab-radius-sm);
    padding: 0.75rem 1rem;
}

.ab-customer-auth .ab-btn { width: 100%; }

@media (max-width: 991px) {
    .ab-customer-auth { grid-template-columns: 1fr; }
    .ab-customer-auth__brand { min-height: auto; padding: 2rem; }
}

/* Guest auth — Theme 01 (marketing alignment) */
.ab-customer-portal--guest {
    font-family: "Rethink Sans", var(--ab-font-body), system-ui, sans-serif;
}

.ab-customer-auth--theme01 {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.ab-customer-auth--theme01 .ab-customer-auth__brand {
    background: linear-gradient(160deg, var(--primary-color, #163f34) 0%, rgba(var(--site-primary-rgb, 22, 63, 52), 0.95) 55%, rgba(0, 0, 0, 0.35) 100%);
    color: #fff;
    padding: clamp(2rem, 5vw, 3.5rem);
    position: relative;
    overflow: hidden;
}

.ab-customer-auth--theme01 .ab-customer-auth__brand::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 80%, rgba(var(--site-primary-rgb, 255, 109, 46), 0.15), transparent 50%);
    pointer-events: none;
}

.ab-customer-auth--theme01 .ab-customer-auth__brand > * {
    position: relative;
    z-index: 1;
}

.ab-customer-auth--theme01 .ab-customer-auth__back-link {
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 2rem;
    transition: color 0.2s ease;
}

.ab-customer-auth--theme01 .ab-customer-auth__back-link:hover {
    color: #fff;
}

.ab-customer-auth--theme01 .ab-customer-auth__brand h1 {
    font-family: "Rethink Sans", var(--ab-font-display), sans-serif;
    color: #fff;
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.ab-customer-auth--theme01 .ab-customer-auth__subtitle,
.ab-customer-auth--theme01 .ab-customer-auth__tagline {
    color: rgba(255, 255, 255, 0.78);
    font-size: 1rem;
    line-height: 1.5;
}

.ab-customer-auth--theme01 .ab-customer-auth__form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1.5rem, 4vw, 2.5rem);
    background: var(--ab-surface-muted, #f4f7fb);
}

.ab-customer-auth--theme01 .ab-customer-auth__card {
    width: min(100%, 440px);
    background: #fff;
    border-radius: 20px;
    padding: clamp(1.5rem, 4vw, 2.25rem);
    box-shadow: 0 16px 48px rgba(4, 34, 62, 0.08);
    border: 1px solid var(--ab-border, rgba(4, 34, 62, 0.08));
}

.ab-customer-auth-form .form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ab-text, #1a2332);
}

.ab-customer-auth-form .form-control {
    border-radius: 12px;
    padding: 0.75rem 1rem;
    border-color: var(--ab-border, rgba(4, 34, 62, 0.12));
}

.ab-customer-auth-form .form-control:focus {
    border-color: var(--site-primary-solid, var(--ab-primary));
    box-shadow: 0 0 0 0.2rem rgba(var(--site-primary-rgb, 255, 109, 46), 0.15);
}

.ab-customer-auth-form__link {
    color: var(--site-primary-solid, var(--ab-primary));
    font-weight: 600;
    text-decoration: none;
}

.ab-customer-auth-form__link:hover {
    text-decoration: underline;
}

.ab-customer-auth-form__submit.btn-default {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    border: none;
    cursor: pointer;
    padding: 14px 24px;
    font-weight: 600;
}

.ab-customer-auth-form__submit--muted {
    margin-top: 0.75rem;
    opacity: 0.9;
}

.ab-customer-auth-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.25rem;
    background: var(--ab-surface-muted, #f4f7fb);
    border-radius: 12px;
}

.ab-customer-auth-tabs__btn {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.6rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--ab-text-muted, #5a6578);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.ab-customer-auth-tabs__btn.is-active {
    background: #fff;
    color: var(--site-primary-solid, var(--ab-primary));
    box-shadow: 0 2px 8px rgba(4, 34, 62, 0.08);
}

.ab-customer-auth-panel {
    display: none;
}

.ab-customer-auth-panel.is-active {
    display: block;
}

@media (max-width: 991.98px) {
    .ab-customer-auth--theme01 {
        grid-template-columns: 1fr;
    }

    .ab-customer-auth--theme01 .ab-customer-auth__brand {
        padding: 1.75rem 1.5rem 2rem;
    }

    .ab-customer-auth--theme01 .ab-customer-auth__logo {
        max-width: 160px;
    }

    .ab-customer-auth--theme01 .ab-customer-auth__brand h1 {
        font-size: 1.5rem;
    }
}
