:root {
    --crm-primary: #1d4ed8;
    --crm-primary-dark: #1e3a8a;
    --crm-accent: #2563eb;
}

* { font-family: 'Inter', sans-serif; }

.navbar-public {
    background: #fff;
    box-shadow: 0 2px 16px rgba(15, 23, 42, 0.08);
}
.navbar-public .navbar-brand {
    font-weight: 800;
    color: var(--crm-primary-dark) !important;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
}
.site-logo {
    display: block;
    width: auto;
    height: 40px;
    max-width: 200px;
    object-fit: contain;
}
.site-logo-footer {
    background: #fff;
    padding: 6px 12px;
    border-radius: 8px;
}
.navbar-public .brand-icon { color: var(--crm-accent); font-size: 1.25rem; }
.navbar-public .nav-link.active { color: var(--crm-primary) !important; font-weight: 600; }

.hero-welcome {
    background: linear-gradient(135deg, #0f172a 0%, var(--crm-primary-dark) 45%, var(--crm-accent) 100%);
    color: #fff;
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}
.hero-welcome::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(255,255,255,.08), transparent 50%);
}
.hero-welcome .container { position: relative; z-index: 1; }

.feature-card {
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    height: 100%;
    background: #fff;
    transition: transform .2s, box-shadow .2s;
}
.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(29, 78, 216, 0.12);
}
.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: var(--crm-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.plan-card-pub {
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    transition: all .25s;
}
.plan-card-pub:hover, .plan-card-pub.popular {
    border-color: var(--crm-accent);
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.15);
}
.plan-card-pub.popular { position: relative; }
.popular-ribbon {
    position: absolute;
    top: 14px;
    right: -32px;
    background: var(--crm-accent);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: 4px 40px;
    transform: rotate(45deg);
}

.register-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

.public-footer {
    background: #0b1120;
    color: rgba(255, 255, 255, 0.75);
}
.public-footer a { color: rgba(255, 255, 255, 0.65); text-decoration: none; }
.public-footer a:hover { color: #fff; }

.public-footer-v2 {
    background: linear-gradient(180deg, #0b1120 0%, #070b14 100%);
    color: rgba(255, 255, 255, 0.72);
}

.public-footer-v2 .footer-heading {
    color: #fff;
    font-weight: 700;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

.footer-brand-col {
    text-align: center;
}

.footer-logo-link {
    line-height: 0;
}

.footer-tagline {
    color: #93c5fd;
    font-weight: 600;
    font-size: 0.95rem;
    margin-top: 0.85rem;
}

.footer-about {
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.6;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.footer-links li {
    margin-bottom: 0.6rem;
}

.footer-links a {
    font-size: 0.9rem;
    transition: color .2s, padding-left .2s;
    display: inline-block;
}

.footer-links a:hover {
    color: #fff;
    padding-left: 4px;
}

.footer-contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    line-height: 1.55;
}

.footer-contact-list li:last-child {
    margin-bottom: 0;
}

.footer-contact-list i {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #93c5fd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.footer-contact-list span {
    flex: 1;
    min-width: 0;
    color: rgba(255, 255, 255, 0.72);
}

.footer-contact-list a {
    color: rgba(255, 255, 255, 0.85);
}

.footer-contact-list a:hover {
    color: #fff;
}

.footer-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.8) !important;
    transition: background .2s, color .2s, transform .2s;
}

.footer-social a:hover {
    background: var(--crm-accent);
    color: #fff !important;
    transform: translateY(-2px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.5);
}

.footer-bottom-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-bottom-links a {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    transition: background .2s, color .2s;
}

.footer-bottom-links a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

@media (min-width: 768px) {
    .footer-brand-col {
        text-align: left;
    }

    .footer-about {
        margin-left: 0;
        margin-right: 0;
    }

    .footer-social {
        justify-content: flex-start;
    }

    .footer-bottom-links {
        justify-content: flex-end;
    }
}

@media (min-width: 992px) {
    .footer-main {
        padding-top: 4rem !important;
        padding-bottom: 3rem !important;
    }

    .footer-contact-col {
        padding-left: 1.5rem;
        border-left: 1px solid rgba(255, 255, 255, 0.08);
    }
}

@media (max-width: 767.98px) {
    .footer-main {
        padding-top: 2.5rem !important;
        padding-bottom: 2rem !important;
    }

    .footer-links-col {
        padding-top: 0.25rem;
    }

    .footer-contact-col {
        margin-top: 0.5rem;
        padding-top: 1.25rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
    }

    .footer-heading {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .footer-bottom-links {
        gap: 0.5rem;
    }

    .footer-bottom-links a {
        flex: 1 1 calc(50% - 0.5rem);
        text-align: center;
    }
}

.contact-info-card {
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.contact-info-card p {
    margin-bottom: 0.75rem;
}

.contact-info-card a {
    color: var(--crm-primary);
    text-decoration: none;
}

.contact-info-card a:hover {
    text-decoration: underline;
}
.contact-info-card i {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #eff6ff;
    color: var(--crm-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.section-cta {
    background: linear-gradient(135deg, var(--crm-primary-dark), var(--crm-accent));
    color: #fff;
    border-radius: 24px;
}

.btn-crm-primary {
    background: linear-gradient(135deg, var(--crm-primary-dark), var(--crm-accent));
    color: #fff;
    border: none;
    font-weight: 600;
    border-radius: 50px;
    padding: 12px 28px;
}
.btn-crm-primary:hover { color: #fff; opacity: .92; }

/* ── Login page ──────────────────────────────── */
.login-page {
    min-height: calc(100vh - 72px);
    background: linear-gradient(180deg, #f8fafc 0%, #eef2ff 100%);
    display: flex;
    align-items: center;
}

.login-shell {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.12);
    border: 1px solid #e2e8f0;
    min-height: 560px;
}

.login-brand-panel {
    background: linear-gradient(145deg, #0f172a 0%, var(--crm-primary-dark) 50%, var(--crm-accent) 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.login-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(255,255,255,.12), transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(255,255,255,.08), transparent 40%);
}

.login-brand-inner {
    position: relative;
    z-index: 1;
    padding: 3rem 2.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    width: fit-content;
}

.login-headline {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.login-lead {
    opacity: 0.88;
    font-size: 1.05rem;
    margin-bottom: 2rem;
    max-width: 360px;
}

.login-features li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0;
    font-size: 0.95rem;
    opacity: 0.92;
}

.login-features li i {
    color: #93c5fd;
    font-size: 1rem;
}

.login-brand-footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.login-brand-footer small {
    display: block;
    opacity: 0.7;
    margin-bottom: 0.35rem;
}

.login-register-link {
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.login-register-link:hover { color: #bfdbfe; }

.login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    background: #fff;
}

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

.login-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: var(--crm-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.login-input-group .input-group-text {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
}

.login-input-group .form-control {
    border-color: #e2e8f0;
    background: #fff;
}

.login-input-group .form-control:focus {
    border-color: var(--crm-accent);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.12);
}

.login-toggle-pw {
    cursor: pointer;
    border-color: #e2e8f0;
    background: #f8fafc;
}

.login-toggle-pw:hover {
    background: #eff6ff;
    color: var(--crm-primary);
}

.login-card-footer .btn-outline-primary {
    border-radius: 50px;
    font-weight: 600;
    padding: 0.65rem 1rem;
}

@media (max-width: 991.98px) {
    .login-page { align-items: flex-start; }
    .login-shell { min-height: auto; }
    .login-brand-panel { border-radius: 24px 24px 0 0; }
    .login-brand-inner { padding: 2rem 1.5rem; }
    .login-form-panel { padding: 2rem 1.5rem 2.5rem; }
}

/* ── Standalone portal auth (reseller / admin) ─ */
.portal-auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #0f172a;
    color: #fff;
}

.portal-auth-topbar {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.portal-auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    text-decoration: none;
    color: #fff;
}

.portal-auth-footer-contact a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
}

.portal-auth-footer-contact a:hover {
    color: #fff;
}

.portal-auth-footer .footer-social {
    justify-content: flex-end;
}

.portal-auth-brand:hover { color: #fff; opacity: 0.92; }

.portal-auth-brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #14b8a6, #0d9488);
    box-shadow: 0 8px 24px rgba(20, 184, 166, 0.35);
}

.portal-auth-brand strong {
    display: block;
    font-size: 1rem;
    line-height: 1.2;
}

.portal-auth-brand small {
    display: block;
    font-size: 0.75rem;
    opacity: 0.65;
    font-weight: 500;
}

.portal-auth-back {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color .2s;
}

.portal-auth-back:hover { color: #fff; }

.portal-auth-main {
    flex: 1;
    display: flex;
    align-items: stretch;
    padding: 1.5rem 0 2rem;
}

.portal-auth-shell {
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.35);
    min-height: calc(100vh - 180px);
}

.portal-auth-brand-panel {
    position: relative;
    overflow: hidden;
    background: linear-gradient(155deg, #042f2e 0%, #0f766e 42%, #14b8a6 100%);
}

.portal-auth-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 10% 15%, rgba(255,255,255,.14), transparent 42%),
        radial-gradient(circle at 90% 85%, rgba(255,255,255,.08), transparent 38%);
}

.portal-auth-brand-inner {
    position: relative;
    z-index: 1;
    padding: clamp(2rem, 5vw, 4rem);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.portal-auth-badge {
    display: inline-block;
    width: fit-content;
    padding: 0.45rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.portal-auth-headline {
    font-size: clamp(1.85rem, 3.5vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
    max-width: 520px;
}

.portal-auth-lead {
    font-size: 1.05rem;
    opacity: 0.9;
    max-width: 480px;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.portal-auth-features li {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.55rem 0;
    font-size: 0.95rem;
    opacity: 0.92;
}

.portal-auth-features li i {
    width: 28px;
    text-align: center;
    color: #99f6e4;
}

.portal-stat-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    padding: 0.85rem 1rem;
    text-align: center;
}

.portal-stat-value {
    font-size: 1.1rem;
    font-weight: 800;
}

.portal-stat-label {
    font-size: 0.72rem;
    opacity: 0.75;
    margin-top: 0.15rem;
}

.portal-auth-form-panel {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 4vw, 3.5rem);
}

.portal-auth-card {
    width: 100%;
    max-width: 420px;
    color: #0f172a;
}

.portal-auth-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ccfbf1, #99f6e4);
    color: #0f766e;
}

.portal-input-group .input-group-text {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #64748b;
}

.portal-input-group .form-control {
    border-color: #e2e8f0;
}

.portal-input-group .form-control:focus {
    border-color: #14b8a6;
    box-shadow: 0 0 0 0.2rem rgba(20, 184, 166, 0.15);
}

.portal-toggle-pw {
    cursor: pointer;
    border-color: #e2e8f0;
    background: #f8fafc;
}

.portal-toggle-pw:hover {
    background: #f0fdfa;
    color: #0f766e;
}

.portal-btn-primary {
    background: linear-gradient(135deg, #0f766e, #14b8a6);
    color: #fff;
    border: none;
    font-weight: 600;
    border-radius: 12px;
    transition: opacity .2s, transform .2s;
}

.portal-btn-primary:hover {
    color: #fff;
    opacity: 0.94;
    transform: translateY(-1px);
}

.portal-auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #94a3b8;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.portal-auth-divider::before,
.portal-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.portal-auth-footer {
    padding: 1rem 0 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
}

.portal-auth-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.portal-auth-footer-links a {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
}

.portal-auth-footer-links a:hover { color: #fff; }

@media (max-width: 991.98px) {
    .portal-auth-shell { min-height: auto; }
    .portal-auth-main { padding: 1rem 0 1.5rem; }
    .portal-auth-back span { display: none; }
    .portal-auth-brand-inner { padding: 2rem 1.5rem; }
    .portal-auth-form-panel { padding: 2rem 1.5rem 2.5rem; }
}

/* Admin portal theme overrides */
.portal-admin .portal-auth-brand-icon {
    background: linear-gradient(135deg, #6366f1, #4338ca);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.portal-admin .portal-auth-brand-panel {
    background: linear-gradient(155deg, #1e1b4b 0%, #3730a3 45%, #6366f1 100%);
}

.portal-admin .portal-auth-features li i {
    color: #c7d2fe;
}

.portal-admin .portal-auth-card-icon {
    background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
    color: #4338ca;
}

.portal-admin .portal-input-group .form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 0.2rem rgba(99, 102, 241, 0.15);
}

.portal-admin .portal-toggle-pw:hover {
    background: #eef2ff;
    color: #4338ca;
}

.portal-admin .portal-btn-primary {
    background: linear-gradient(135deg, #4338ca, #6366f1);
}

.portal-admin .portal-auth-security-note {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.78rem;
    color: #64748b;
}
