html[data-theme="dark"] body {
    background:
        radial-gradient(circle at 20% 12%, rgba(0,153,255,.2), transparent 28%),
        radial-gradient(circle at 80% 20%, rgba(190,39,245,.22), transparent 32%),
        linear-gradient(135deg, #030711, #071426 58%, #02040a);
    color: #eef8ff;
}

.auth-page {
    position: relative;
    z-index: 2;
    width: min(1540px, 100%);
    margin: 0 auto;
    padding: 32px;
}

.theme-toggle {
    position: fixed;
    top: 18px;
    right: 28px;
    z-index: 20;
    display: flex;
    gap: 6px;
    padding: 6px;
    border: 1px solid rgba(0,153,255,.18);
    border-radius: 999px;
    background: rgba(255,255,255,.76);
    box-shadow: 0 12px 34px rgba(0,0,0,.12);
    backdrop-filter: blur(16px);
    cursor: pointer;
}

.theme-toggle span {
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 900;
}

html[data-theme="light"] .theme-toggle span:first-child,
html[data-theme="dark"] .theme-toggle span:last-child {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--tertiary));
}

html[data-theme="dark"] .theme-toggle {
    background: rgba(3,7,17,.78);
    color: #dff7ff;
}

.brand-3d,
.login-3d,
.topology-card,
.login-metrics div {
    transform: perspective(1200px) rotateX(1.2deg);
    transition: transform .25s ease, box-shadow .25s ease;
}

.brand-3d:hover,
.login-3d:hover,
.topology-card:hover,
.login-metrics div:hover {
    transform: perspective(1200px) rotateX(0deg) translateY(-5px);
}

.auth-brand {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 24px;
    overflow: hidden;
}

.sales-slogan {
    margin: 0 0 18px;
    color: var(--secondary);
    font-size: 20px;
}

.feature-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    gap: 14px;
    margin-top: 28px;
}

.feature-tile {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 104px;
    padding: 14px;
    border-radius: 20px;
    background: rgba(255,255,255,.62);
    border: 1px solid rgba(0,153,255,.14);
    box-shadow: 0 16px 34px rgba(0,42,92,.10);
    font-weight: 900;
    text-align: center;
    font-size: 13px;
}

.feature-tile:first-child {
    font-size: 26px;
}

.feature-tile span {
    font-size: 12px;
}

.growth-chip,
.protected-note {
    display: inline-flex;
    margin-top: 18px;
    padding: 11px 16px;
    border-radius: 999px;
    color: var(--secondary);
    background: rgba(0,153,255,.08);
    border: 1px solid rgba(0,153,255,.16);
    font-weight: 900;
}

.lock-badge {
    position: absolute;
    top: 26px;
    right: 28px;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(0,153,255,.18), rgba(190,39,245,.16));
    box-shadow: 0 18px 38px rgba(0,153,255,.20);
    font-size: 28px;
}

.auth-card {
    position: relative;
}

.africa-globe {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 270px;
    filter: drop-shadow(0 0 34px rgba(0,153,255,.45));
}

.africa-globe svg {
    width: min(250px, 100%);
    animation: globeFloat 5s ease-in-out infinite;
}

.globe-orbit {
    position: absolute;
    width: 240px;
    height: 72px;
    border: 2px solid rgba(0,153,255,.34);
    border-radius: 50%;
    transform: rotate(-18deg);
    box-shadow: 0 0 24px rgba(0,153,255,.36);
}

@keyframes globeFloat {
    0%,100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

.login-topology {
    margin-top: 26px;
}

.particles {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 0 14px var(--primary);
    animation: particleDrift linear infinite;
}

.particle:nth-child(1) { left: 8%; top: 90%; animation-duration: 15s; animation-delay: -1s; }
.particle:nth-child(2) { left: 18%; top: 84%; animation-duration: 18s; animation-delay: -7s; }
.particle:nth-child(3) { left: 30%; top: 92%; animation-duration: 20s; animation-delay: -3s; }
.particle:nth-child(4) { left: 46%; top: 88%; animation-duration: 16s; animation-delay: -9s; }
.particle:nth-child(5) { left: 61%; top: 94%; animation-duration: 22s; animation-delay: -6s; }
.particle:nth-child(6) { left: 76%; top: 86%; animation-duration: 19s; animation-delay: -4s; }
.particle:nth-child(7) { left: 88%; top: 92%; animation-duration: 21s; animation-delay: -10s; }
.particle:nth-child(8) { left: 96%; top: 80%; animation-duration: 17s; animation-delay: -5s; }

@keyframes particleDrift {
    0% { transform: translateY(0) translateX(0); opacity: 0; }
    12% { opacity: .9; }
    75% { opacity: .65; }
    100% { transform: translateY(-110vh) translateX(38px); opacity: 0; }
}

.topology-card {
    position: relative;
    min-height: 720px;
    border: 1px solid rgba(0,153,255,.18);
    border-radius: 34px;
    background:
        radial-gradient(circle at 50% 18%, rgba(0,153,255,.15), transparent 28%),
        rgba(255,255,255,.72);
    box-shadow: 0 34px 90px rgba(0,42,92,.16);
    backdrop-filter: blur(18px);
    overflow: hidden;
}

.topology-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0,153,255,.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,153,255,.05) 1px, transparent 1px);
    background-size: 34px 34px;
    opacity: .7;
}

.topology-label {
    position: absolute;
    top: 22px;
    left: 24px;
    z-index: 3;
    color: var(--secondary);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.security-chip {
    position: absolute;
    top: 18px;
    right: 24px;
    z-index: 3;
    padding: 9px 13px;
    border: 1px solid rgba(32,245,154,.45);
    border-radius: 999px;
    background: rgba(32,245,154,.10);
    color: #087a48;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.topology-card svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.link-soft {
    fill: none;
    stroke: rgba(0,153,255,.16);
    stroke-width: 10;
    stroke-linecap: round;
}

.link {
    fill: none;
    stroke: rgba(0,153,255,.72);
    stroke-width: 3.2;
    stroke-linecap: round;
    filter: drop-shadow(0 0 8px rgba(0,153,255,.9));
}

.device {
    filter: drop-shadow(0 16px 22px rgba(0,0,0,.22));
    animation: floatDevice 4.8s ease-in-out infinite;
    transform-origin: center;
}

.device.alt {
    animation-delay: -1.4s;
}

@keyframes floatDevice {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

.device-box {
    stroke-width: 2;
    rx: 14;
}

.cpe-box {
    fill: rgba(255,255,255,.45);
    stroke: rgba(0,102,204,.70);
}

.bridge-box {
    fill: rgba(32,245,154,.10);
    stroke: rgba(32,245,154,.88);
}

.switch-box {
    fill: rgba(255,153,0,.10);
    stroke: rgba(255,153,0,.86);
}

.server-box {
    fill: rgba(0,153,255,.10);
    stroke: rgba(0,153,255,.88);
}

.device text {
    fill: #07111f;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .05em;
    text-anchor: middle;
    dominant-baseline: middle;
}

.device .sub {
    fill: rgba(7,17,31,.68);
    font-size: 8px;
    letter-spacing: .12em;
}

.packet {
    r: 5;
    fill: var(--primary);
    filter: url(#packetGlow);
}

.packet.green {
    fill: #20f59a;
}

.packet.orange {
    fill: var(--accent);
}

.login-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-top: 22px;
}

.login-metrics div {
    padding: 22px;
    border-radius: 22px;
    background: rgba(255,255,255,.72);
    border: 1px solid rgba(0,153,255,.14);
    box-shadow: 0 18px 40px rgba(0,42,92,.11);
    text-align: center;
}

.login-metrics strong {
    display: block;
    color: var(--secondary);
    font-size: 24px;
}

.login-metrics span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-weight: 800;
}

html[data-theme="dark"] .auth-brand,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .topology-card,
html[data-theme="dark"] .login-metrics div,
html[data-theme="dark"] .feature-tile {
    background: rgba(4,10,22,.78);
    border-color: rgba(84,214,255,.24);
    color: #eef8ff;
    box-shadow: 0 34px 90px rgba(0,0,0,.42), inset 0 1px 0 rgba(255,255,255,.08);
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] label,
html[data-theme="dark"] .device text {
    color: #eef8ff;
    fill: #eef8ff;
}

html[data-theme="dark"] p,
html[data-theme="dark"] .login-metrics span {
    color: #9fb8cc;
}

html[data-theme="dark"] input {
    background: rgba(2,8,18,.76);
    border-color: rgba(84,214,255,.22);
    color: #eef8ff;
}

html[data-theme="dark"] .topology-card {
    background:
        radial-gradient(circle at 50% 18%, rgba(0,153,255,.18), transparent 28%),
        linear-gradient(145deg, rgba(7,17,32,.86), rgba(4,10,22,.72));
}

html[data-theme="dark"] .device .sub {
    fill: rgba(217,243,255,.68);
}

html[data-theme="dark"] .security-chip {
    color: #c6ffe5;
}

@media (max-width: 1100px) {
    .auth-brand {
        grid-template-columns: 1fr;
    }

    .africa-globe {
        min-height: 210px;
    }

    .feature-row,
    .login-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 680px) {
    .auth-page {
        padding: 14px;
    }

    .theme-toggle {
        position: static;
        margin: 12px auto;
        width: max-content;
    }

    .feature-row,
    .login-metrics {
        grid-template-columns: 1fr;
    }

    .topology-card {
        min-height: 620px;
        border-radius: 24px;
        overflow-x: auto;
    }

    .topology-card svg {
        min-width: 880px;
    }

    .topology-label,
    .security-chip {
        font-size: 11px;
    }
}

/* Phase 1B UI polish: Africa-first login hero */
.auth-shell {
    align-items: stretch;
    gap: 28px;
}

.auth-brand {
    grid-template-columns: minmax(0, 1fr) 340px;
    min-height: 390px;
}

.auth-brand h1 {
    font-size: clamp(52px, 5.2vw, 82px);
    line-height: .95;
    letter-spacing: -.055em;
}

.auth-card {
    min-height: 390px;
}

.sales-slogan::before {
    content: "🛡 ";
}

.africa-globe {
    min-height: 330px;
    align-self: center;
}

.africa-globe-svg {
    width: min(330px, 100%);
    overflow: visible;
    animation: globeFloat 5s ease-in-out infinite;
}

.globe-orbit {
    width: 318px;
    height: 92px;
}

.orbit-one {
    transform: rotate(-18deg);
}

.orbit-two {
    transform: rotate(22deg);
    opacity: .62;
}

.map-land {
    fill: rgba(255,255,255,.68);
    stroke: rgba(255,255,255,.62);
    stroke-width: 1.1;
    filter: drop-shadow(0 0 9px rgba(255,255,255,.38));
}

.africa-main {
    fill: rgba(255,255,255,.78);
}

.network-line {
    fill: none;
    stroke: rgba(255,255,255,.42);
    stroke-width: 1.1;
}

.globe-node {
    fill: #20f59a;
    filter: drop-shadow(0 0 8px #20f59a);
}

.caribbean-node {
    fill: #ff9900;
    filter: drop-shadow(0 0 8px #ff9900);
}

.feature-tile {
    transform: translateZ(20px);
}

.feature-tile:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 22px 46px rgba(0,153,255,.18);
}

.topology-label::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 10px;
    border-radius: 999px;
    background: #20f59a;
    box-shadow: 0 0 14px #20f59a;
}

.topology-card::after {
    content: "Real-time network infrastructure overview";
    position: absolute;
    top: 47px;
    left: 24px;
    z-index: 3;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.login-metrics div {
    display: grid;
    place-items: center;
    min-height: 86px;
}

html[data-theme="dark"] .map-land {
    fill: rgba(126,205,255,.72);
    stroke: rgba(255,255,255,.44);
}

html[data-theme="dark"] .africa-main {
    fill: rgba(185,228,255,.82);
}

html[data-theme="dark"] .network-line {
    stroke: rgba(41,216,255,.50);
}

html[data-theme="dark"] .topology-card::after {
    color: #9fb8cc;
}

@media (max-width: 1100px) {
    .auth-brand {
        grid-template-columns: 1fr;
    }

    .africa-globe {
        min-height: 250px;
    }

    .africa-globe-svg {
        width: 250px;
    }

    .globe-orbit {
        width: 245px;
        height: 72px;
    }
}

/* Clear Africa-focused globe correction */
.africa-map-globe {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 360px;
    filter: drop-shadow(0 22px 44px rgba(0,153,255,.32));
}

.africa-globe-svg {
    width: min(360px, 100%);
    overflow: visible;
    animation: globeFloat 5s ease-in-out infinite;
}

.globe-core {
    filter: drop-shadow(0 0 28px rgba(0,153,255,.55));
}

.continent {
    fill: rgba(235,248,255,.78);
    stroke: rgba(255,255,255,.85);
    stroke-width: 1.5;
    filter: drop-shadow(0 0 8px rgba(255,255,255,.32));
}

.africa-main {
    fill: rgba(255,255,255,.82);
}

.africa-horn {
    fill: rgba(235,248,255,.76);
}

.madagascar {
    fill: rgba(235,248,255,.66);
}

.europe-edge {
    fill: rgba(255,255,255,.56);
}

.network-line {
    fill: none;
    stroke: rgba(255,255,255,.48);
    stroke-width: 1.4;
}

.globe-node {
    fill: #20f59a;
    filter: drop-shadow(0 0 8px #20f59a);
}

.orange-node,
.caribbean-node {
    fill: #ff9900;
    filter: drop-shadow(0 0 8px #ff9900);
}

.map-label {
    fill: rgba(255,255,255,.90);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
}

.globe-orbit {
    position: absolute;
    width: 350px;
    height: 104px;
    border: 2px solid rgba(0,153,255,.24);
    border-radius: 50%;
    box-shadow: 0 0 24px rgba(0,153,255,.26);
}

.orbit-one {
    transform: rotate(-18deg);
}

.orbit-two {
    transform: rotate(23deg);
    opacity: .58;
}

@keyframes globeFloat {
    0%,100% { transform: translateY(0) rotate(-1deg); }
    50% { transform: translateY(-10px) rotate(1deg); }
}

/* Topology title correction */
.topology-label {
    font-size: 14px;
}

@media (max-width: 1100px) {
    .africa-map-globe {
        min-height: 280px;
    }

    .africa-globe-svg {
        width: 280px;
    }

    .globe-orbit {
        width: 275px;
        height: 82px;
    }
}

@media (max-width: 680px) {
    .africa-map-globe {
        min-height: 230px;
    }

    .africa-globe-svg {
        width: 230px;
    }

    .globe-orbit {
        width: 225px;
        height: 68px;
    }
}

/* Final globe replacement: use real Africa PNG */
.africa-png-globe {
    display: grid;
    place-items: center;
    min-height: 340px;
    filter: drop-shadow(0 26px 50px rgba(0,153,255,.36));
}

.africa-globe-img {
    width: min(370px, 100%);
    height: auto;
    object-fit: contain;
    animation: globeFloat 5s ease-in-out infinite;
}

/* Hide old SVG globe/orbit decorations if still cached */
.africa-png-globe .globe-orbit,
.africa-png-globe svg {
    display: none !important;
}

/* Mobile topology responsiveness */
@media (max-width: 680px) {
    .topology-card {
        min-height: 520px !important;
        overflow: hidden !important;
        padding-top: 74px;
    }

    .topology-card svg {
        position: absolute;
        inset: 54px 0 0 0;
        width: 100% !important;
        height: calc(100% - 54px) !important;
        min-width: 0 !important;
        max-width: 100% !important;
        preserve-aspect-ratio: xMidYMid meet;
    }

    .topology-label {
        top: 18px;
        left: 18px;
        right: 120px;
        max-width: calc(100% - 150px);
        font-size: 10px !important;
        line-height: 1.25;
        white-space: normal;
    }

    .topology-card::after {
        top: 48px;
        left: 18px;
        right: 18px;
        font-size: 10px;
    }

    .security-chip {
        top: 16px;
        right: 14px;
        font-size: 9px !important;
        padding: 7px 9px;
    }

    .africa-png-globe {
        min-height: 230px;
    }

    .africa-globe-img {
        width: min(250px, 88vw);
    }
}

@media (max-width: 420px) {
    .topology-card {
        min-height: 470px !important;
    }

    .topology-card svg {
        transform: scale(.92);
        transform-origin: center top;
    }
}
