:root {
    /* FBR Industries brand palette */
    --fbr-navy: #1a2d6b;
    --fbr-navy-dark: #0f1d47;
    --fbr-navy-light: #2a4088;
    --fbr-red: #c41e3a;
    --fbr-red-dark: #9e1830;
    --fbr-green: #2e9b4f;
    --fbr-green-dark: #227a3c;
    --fbr-green-light: #e8f6ec;

    --site-navy: var(--fbr-navy);
    --site-primary: var(--fbr-navy);
    --site-primary-dark: var(--fbr-navy-dark);
    --site-accent: var(--fbr-red);
    --site-success: var(--fbr-green);
    --site-text: #1e293b;
    --site-muted: #64748b;
    --site-border: #e2e8f0;
    --site-bg: #f8fafc;
}

* { box-sizing: border-box; }

.master-login-body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    background: var(--site-bg);
    color: var(--site-text);
    -webkit-font-smoothing: antialiased;
}

.login-split {
    display: flex;
    min-height: 100vh;
}

/* Left showcase — FBR navy */
.login-showcase {
    flex: 1;
    position: relative;
    background: linear-gradient(155deg, var(--fbr-navy-dark) 0%, var(--fbr-navy) 45%, var(--fbr-navy-light) 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 32px;
}

.login-showcase::before {
    content: '';
    position: absolute;
    top: -120px;
    right: -80px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(196, 30, 58, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.login-showcase::after {
    content: '';
    position: absolute;
    bottom: -100px;
    left: -60px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(46, 155, 79, 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.showcase-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.08;
    background-image: radial-gradient(circle at 2px 2px, #fff 1px, transparent 0);
    background-size: 28px 28px;
}

.showcase-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
}

.showcase-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    color: #fff;
}

.showcase-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #fff;
    padding: 6px;
    object-fit: contain;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.showcase-brand-title {
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0.04em;
}

.showcase-brand-sub {
    font-size: .82rem;
    opacity: .88;
    margin-top: 4px;
    font-weight: 500;
}

.showcase-brand-tag,
.login-brand-tag {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--fbr-green);
    margin-top: 4px;
}

.showcase-brand-tag { color: #7dcea0; }

.showcase-mockup {
    margin-bottom: 28px;
    perspective: 800px;
}

.mockup-window {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    transform: rotateY(-4deg) rotateX(2deg);
    border-top: 4px solid var(--fbr-red);
}

.mockup-bar {
    display: flex;
    gap: 6px;
    padding: 12px 14px;
    background: #f8fafc;
    border-bottom: 1px solid var(--site-border);
}

.mockup-bar span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
}

.mockup-bar span:first-child { background: var(--fbr-red); }
.mockup-bar span:nth-child(2) { background: #fbbf24; }
.mockup-bar span:nth-child(3) { background: var(--fbr-green); }

.mockup-body { padding: 16px; }

.mockup-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.mock-stat {
    height: 48px;
    border-radius: 10px;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
}

.mockup-chart-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.mock-chart {
    border-radius: 10px;
    min-height: 90px;
}

.mock-chart-bar {
    background: linear-gradient(180deg, #e0e7ff 0%, #f8fafc 40%, #fff 100%);
    position: relative;
}

.mock-chart-bar::after {
    content: '';
    position: absolute;
    bottom: 12px;
    left: 12px;
    right: 12px;
    height: 50px;
    background: repeating-linear-gradient(
        90deg,
        var(--fbr-navy) 0,
        var(--fbr-navy) 14px,
        transparent 14px,
        transparent 22px
    );
    opacity: 0.45;
    border-radius: 4px;
}

.mock-chart-donut {
    background: conic-gradient(var(--fbr-navy) 0 35%, var(--fbr-green) 35% 60%, var(--fbr-red) 60% 80%, #e2e8f0 80%);
    border-radius: 50%;
    width: 90px;
    height: 90px;
    margin: auto;
}

.mockup-table {
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 50%, #f8fafc 100%);
}

.showcase-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.showcase-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(4px);
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.showcase-pill i { font-size: .95rem; opacity: .9; }

/* Right form panel */
.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.login-form-wrap {
    width: 100%;
    max-width: 420px;
}

.login-form-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    padding: 6px;
    box-shadow: 0 8px 28px rgba(26, 45, 107, 0.15);
    margin-bottom: 14px;
    border: 3px solid var(--fbr-navy);
}

.login-brand-name {
    font-size: .95rem;
    font-weight: 800;
    color: var(--fbr-navy);
    letter-spacing: 0.06em;
    margin-bottom: 2px;
}

.login-brand-sub {
    font-size: .75rem;
    font-weight: 500;
    color: var(--site-muted);
    margin-bottom: 12px;
}

.login-page-title {
    margin: 0 0 8px;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--fbr-navy-dark);
    letter-spacing: -0.02em;
}

.login-page-sub {
    margin: 0;
    font-size: .9rem;
    color: var(--site-muted);
    line-height: 1.55;
}

.login-card {
    background: #fff;
    border: 1px solid var(--site-border);
    border-radius: 18px;
    padding: 28px 24px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.07);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--fbr-navy) 0%, var(--fbr-red) 50%, var(--fbr-green) 100%);
}

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

.login-field label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--fbr-navy-dark);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.req { color: var(--fbr-red); }

.phone-input-row,
.password-input-row {
    display: flex;
    align-items: stretch;
    border: 1.5px solid var(--site-border);
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}

.phone-input-row:focus-within,
.password-input-row:focus-within {
    border-color: var(--fbr-navy);
    box-shadow: 0 0 0 3px rgba(26, 45, 107, 0.1);
}

.phone-prefix {
    display: flex;
    align-items: center;
    padding: 0 14px;
    background: #f8fafc;
    border-right: 1px solid var(--site-border);
    font-weight: 700;
    color: var(--fbr-navy);
    font-size: 15px;
}

.login-input {
    flex: 1;
    min-width: 0;
    border: none;
    outline: none;
    padding: 14px 16px;
    font-size: 16px;
    background: transparent;
    color: var(--site-text);
}

.login-note {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--site-muted);
    line-height: 1.45;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--site-muted);
}

.login-remember .form-check-input:checked {
    background-color: var(--fbr-green);
    border-color: var(--fbr-green);
}

.login-remember label {
    margin: 0;
    font-weight: 500;
    cursor: pointer;
}

.login-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, opacity .15s;
    letter-spacing: 0.02em;
}

.login-btn-primary {
    background: linear-gradient(135deg, var(--fbr-navy) 0%, var(--fbr-navy-dark) 100%);
    color: #fff;
    box-shadow: 0 6px 20px rgba(26, 45, 107, 0.28);
}

.login-btn-primary:hover {
    box-shadow: 0 8px 26px rgba(26, 45, 107, 0.38);
}

.login-btn-verify {
    background: linear-gradient(135deg, var(--fbr-green) 0%, var(--fbr-green-dark) 100%);
    color: #fff;
    width: auto;
    min-width: 100px;
    padding: 0 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(46, 155, 79, 0.3);
}

.login-btn:active:not(:disabled) { transform: scale(0.98); }
.login-btn:disabled { opacity: .6; pointer-events: none; }

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 20px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

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

.login-otp-panel { margin-top: 4px; }

.login-mode-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 22px;
    padding: 5px;
    background: #f1f5f9;
    border-radius: 14px;
    border: 1px solid var(--site-border);
}

.login-mode-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--site-muted);
    font-size: 14px;
    font-weight: 700;
    padding: 11px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background .15s, color .15s, box-shadow .15s;
}

.login-mode-tab.active {
    background: #fff;
    color: var(--fbr-navy);
    box-shadow: 0 2px 8px rgba(26, 45, 107, 0.1);
}

.login-mode-tab i { margin-right: 6px; }

.otp-input-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.otp-input-row .login-input {
    border: 1.5px solid var(--site-border);
    border-radius: 12px;
    padding: 14px 16px;
}

.otp-input-row .login-input:focus {
    border-color: var(--fbr-navy);
    box-shadow: 0 0 0 3px rgba(26, 45, 107, 0.1);
}

.login-otp-status {
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--fbr-green);
}

.login-otp-status.error { color: var(--fbr-red); }

.login-back-link {
    display: block;
    text-align: center;
    margin-top: 24px;
    color: var(--fbr-red);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.login-back-link:hover { color: var(--fbr-red-dark); }

.login-footer {
    margin-top: 32px;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
}

#authMessage {
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 16px;
}

#authMessage.alert-success {
    background: var(--fbr-green-light);
    border-color: #b8e6c8;
    color: var(--fbr-green-dark);
}

#authMessage.alert-danger {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--fbr-red-dark);
}

@media (max-width: 991.98px) {
    .login-split { flex-direction: column; }

    .login-showcase {
        min-height: auto;
        padding: 28px 20px;
    }

    .showcase-mockup { display: none; }

    .showcase-pills {
        justify-content: center;
    }

    .showcase-pill {
        font-size: .75rem;
        padding: 6px 12px;
    }

    .login-form-side {
        padding: 28px 20px 36px;
    }
}

@media (max-width: 575.98px) {
    .login-page-title { font-size: 1.4rem; }
    .login-card { padding: 22px 18px; }
    .login-logo { width: 84px; height: 84px; }
    .otp-input-row { flex-direction: column; }
    .login-btn-verify { width: 100%; }
}

/* Communication FAQ (login + portals) */
.comm-faq { margin-top: 1.25rem; }
.comm-faq-compact .comm-faq-details {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.65rem 0.85rem;
    font-size: 0.875rem;
}
.comm-faq-compact summary {
    cursor: pointer;
    font-weight: 600;
    color: #334155;
    list-style: none;
}
.comm-faq-compact summary::-webkit-details-marker { display: none; }
.comm-faq-item { margin-top: 0.75rem; }
.comm-faq-q { font-weight: 600; color: #1e293b; margin-bottom: 0.25rem; }
.comm-faq-a { color: #64748b; font-size: 0.85rem; line-height: 1.5; }
.comm-faq-full {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-top: 1.5rem;
}
.comm-faq-heading { font-size: 1.1rem; margin-bottom: 1rem; }
