:root {
    --bg-base: #030712;
    --bg-surface: rgba(11, 19, 36, 0.72);
    --bg-surface-elevated: rgba(15, 25, 48, 0.88);
    --bg-terminal: #070d19;
    --cyan-neon: #00f0ff;
    --cyan-soft: #38bdf8;
    --cyan-glow: rgba(0, 240, 255, 0.35);
    --purple-electric: #8b5cf6;
    --purple-glow: rgba(139, 92, 246, 0.35);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-neon: rgba(0, 240, 255, 0.28);
    --text-muted-custom: #7e8c9f;
    --font-code: 'JetBrains Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    min-height: 100%;
    width: 100%;
    background-color: var(--bg-base);
    color: #f1f5f9;
    font-family: 'Plus Jakarta Sans', sans-serif;
    overflow-x: hidden;
    position: relative;
}

/* Ambient interactive canvas & grid background */
#ambientCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.cyber-grid-overlay {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.2) 75%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.2) 75%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

/* Dynamic cursor glow spotlight */
.spotlight {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 240, 255, 0.06) 0%, rgba(139, 92, 246, 0.03) 45%, transparent 70%);
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: opacity 0.5s ease;
    z-index: 0;
}

/* Main viewport center layout */
.gateway-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 1.25rem 1rem;
}

/* Unified Glassmorphism Master Card */
.master-auth-card {
    background: var(--bg-surface);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-radius: 1.5rem;
    border: 1px solid var(--border-neon);
    box-shadow:
        0 35px 80px -15px rgba(0, 0, 0, 0.85),
        0 0 45px -10px rgba(0, 240, 255, 0.15),
        inset 0 1px 1px 0 rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 1040px;
    margin: 0 auto;
}

/* Glowing gradient hairline on the top edge */
.master-auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #00f0ff 30%, #8b5cf6 70%, transparent 100%);
    z-index: 2;
}

/* Brand Header elements */
.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, #00f0ff 0%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #030712;
    font-size: 1.05rem;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.45);
    flex-shrink: 0;
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
    line-height: 1.1;
}

.brand-title span {
    background: linear-gradient(135deg, #00f0ff, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Status badge pill */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.85rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-family: var(--font-code);
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.25);
    color: #a5f3fc;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #00f0ff;
    box-shadow: 0 0 8px #00f0ff;
    animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.8);
    }
}

/* Left Side: Mock Terminal & Live Security Architecture */
.terminal-container {
    background: var(--bg-terminal);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.6);
    font-family: var(--font-code);
}

.terminal-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 0.65rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.terminal-dots {
    display: flex;
    gap: 6px;
}

.terminal-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.terminal-code {
    padding: 1.1rem;
    font-size: 0.82rem;
    line-height: 1.65;
    color: #94a3b8;
    min-height: 145px;
}

.code-cyan {
    color: var(--cyan-neon);
}

.code-purple {
    color: #c084fc;
}

.code-yellow {
    color: #fde047;
}

.code-green {
    color: #4ade80;
}

.code-dim {
    color: #475569;
}

/* Telemetry micro-cards */
.stat-badge {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.75rem;
    padding: 0.75rem 0.9rem;
    transition: all 0.3s ease;
}

.stat-badge:hover {
    background: rgba(0, 240, 255, 0.05);
    border-color: rgba(0, 240, 255, 0.3);
    transform: translateY(-2px);
}

/* Form and Input Elements */
.form-group-relative {
    position: relative;
}

.input-icon-left {
    position: absolute;
    left: 1.15rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted-custom);
    font-size: 0.95rem;
    pointer-events: none;
    transition: color 0.25s ease;
    z-index: 3;
}

.form-control-gateway {
    background: rgba(7, 13, 25, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.75rem;
    padding: 0.82rem 1.1rem 0.82rem 2.9rem;
    color: #f8fafc;
    font-size: 0.92rem;
    transition: all 0.25s ease;
}

.form-control-gateway::placeholder {
    color: #4b586e;
    font-size: 0.88rem;
}

.form-control-gateway:focus {
    background: rgba(9, 17, 33, 0.95);
    border-color: var(--cyan-neon);
    box-shadow:
        0 0 0 3px rgba(0, 240, 255, 0.18),
        0 0 20px rgba(0, 240, 255, 0.12);
    color: #ffffff;
}

.form-group-relative:focus-within .input-icon-left {
    color: var(--cyan-neon);
}

.password-toggle-trigger {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted-custom);
    padding: 0.4rem 0.6rem;
    cursor: pointer;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    z-index: 3;
}

.password-toggle-trigger:hover {
    color: var(--cyan-neon);
}

/* Social Authenticator Buttons */
.btn-social-cyber {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 0.75rem;
    color: #e2e8f0;
    padding: 0.65rem 0.8rem;
    font-size: 0.88rem;
    font-weight: 600;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
}

.btn-social-cyber:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 240, 255, 0.45);
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.15);
}

/* Primary glowing action button */
.btn-cyber-primary {
    background: linear-gradient(135deg, #00f0ff 0%, #00bcff 50%, #8b5cf6 100%);
    background-size: 200% 200%;
    color: #030712;
    border: none;
    border-radius: 0.75rem;
    padding: 0.88rem 1.6rem;
    font-size: 0.96rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    box-shadow: 0 4px 25px rgba(0, 240, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.btn-cyber-primary:hover {
    background-position: right center;
    transform: translateY(-2px);
    box-shadow: 0 8px 35px rgba(0, 240, 255, 0.6);
    color: #000000;
}

.btn-cyber-primary:active {
    transform: translateY(0);
}

/* Custom Checkbox */
.form-check-input {
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--cyan-neon);
    border-color: var(--cyan-neon);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

.link-cyan {
    color: var(--cyan-neon);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.link-cyan:hover {
    color: #7dd3fc;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
    text-decoration: underline;
}

/* Footer formatting */
.footer-credits {
    font-size: 0.8rem;
    color: var(--text-muted-custom);
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.author-highlight {
    font-family: var(--font-code);
    color: var(--cyan-neon);
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 0.35rem;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.2);
}