/* ==========================================
   Prospector Advanced — Auth & Config UI
   Design futurista com glassmorphism e neon
   ========================================== */

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

:root {
    --bg-primary: #050912;
    --bg-secondary: #0a0e1a;
    --neon-cyan: #00f0ff;
    --neon-purple: #8b5cf6;
    --neon-pink: #ec4899;
    --neon-green: #10f0a0;
    --text-primary: #e8eaf0;
    --text-secondary: #8590a8;
    --text-muted: #5a6378;
    --glass-bg: rgba(15, 23, 42, 0.55);
    --glass-border: rgba(0, 240, 255, 0.18);
    --glass-shadow: 0 8px 32px rgba(0, 240, 255, 0.08);
}

html, body {
    height: 100%;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

.auth-body {
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

/* ============ Background ============ */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
    pointer-events: none;
}

.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.45;
    pointer-events: none;
    animation: floatGlow 20s ease-in-out infinite;
}
.bg-glow-1 { top: -10%; left: -10%; width: 600px; height: 600px; background: var(--neon-cyan); }
.bg-glow-2 { bottom: -10%; right: -10%; width: 500px; height: 500px; background: var(--neon-purple); animation-delay: -7s; }
.bg-glow-3 { top: 40%; right: 30%; width: 400px; height: 400px; background: var(--neon-pink); opacity: 0.25; animation-delay: -14s; }

@keyframes floatGlow {
    0%, 100% { transform: translate(0,0) scale(1); }
    33%      { transform: translate(60px,-40px) scale(1.1); }
    66%      { transform: translate(-40px,30px) scale(0.95); }
}

/* Particles */
.particles {
    position: fixed; inset: 0; pointer-events: none;
}
.particles span {
    position: absolute;
    width: 2px; height: 2px;
    background: var(--neon-cyan);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 8s linear infinite;
    box-shadow: 0 0 6px var(--neon-cyan);
}
.particles span:nth-child(1)  { left: 10%;  animation-delay: 0s;   animation-duration: 12s; }
.particles span:nth-child(2)  { left: 20%;  animation-delay: 2s;   animation-duration: 9s;  }
.particles span:nth-child(3)  { left: 30%;  animation-delay: 4s;   animation-duration: 14s; }
.particles span:nth-child(4)  { left: 40%;  animation-delay: 1s;   animation-duration: 10s; }
.particles span:nth-child(5)  { left: 50%;  animation-delay: 6s;   animation-duration: 13s; }
.particles span:nth-child(6)  { left: 60%;  animation-delay: 3s;   animation-duration: 11s; }
.particles span:nth-child(7)  { left: 70%;  animation-delay: 5s;   animation-duration: 8s;  }
.particles span:nth-child(8)  { left: 80%;  animation-delay: 0.5s; animation-duration: 12s; }
.particles span:nth-child(9)  { left: 90%;  animation-delay: 7s;   animation-duration: 9s;  }
.particles span:nth-child(10) { left: 5%;   animation-delay: 4.5s; animation-duration: 11s; }
.particles span:nth-child(11) { left: 15%;  animation-delay: 2.5s; animation-duration: 13s; }
.particles span:nth-child(12) { left: 25%;  animation-delay: 6.5s; animation-duration: 10s; }
.particles span:nth-child(13) { left: 35%;  animation-delay: 1.5s; animation-duration: 14s; background: var(--neon-purple); box-shadow: 0 0 6px var(--neon-purple);}
.particles span:nth-child(14) { left: 45%;  animation-delay: 5.5s; animation-duration: 9s;  background: var(--neon-purple); box-shadow: 0 0 6px var(--neon-purple);}
.particles span:nth-child(15) { left: 55%;  animation-delay: 3.5s; animation-duration: 12s; background: var(--neon-purple); box-shadow: 0 0 6px var(--neon-purple);}
.particles span:nth-child(16) { left: 65%;  animation-delay: 7.5s; animation-duration: 10s; }
.particles span:nth-child(17) { left: 75%;  animation-delay: 0.8s; animation-duration: 11s; }
.particles span:nth-child(18) { left: 85%;  animation-delay: 4.8s; animation-duration: 13s; }
.particles span:nth-child(19) { left: 95%;  animation-delay: 2.8s; animation-duration: 9s;  }
.particles span:nth-child(20) { left: 12%;  animation-delay: 6.8s; animation-duration: 12s; }
.particles span:nth-child(21) { left: 22%;  animation-delay: 1.2s; animation-duration: 14s; background: var(--neon-pink); box-shadow: 0 0 6px var(--neon-pink);}
.particles span:nth-child(22) { left: 32%;  animation-delay: 5.2s; animation-duration: 10s; background: var(--neon-pink); box-shadow: 0 0 6px var(--neon-pink);}
.particles span:nth-child(23) { left: 42%;  animation-delay: 3.2s; animation-duration: 13s; }
.particles span:nth-child(24) { left: 52%;  animation-delay: 7.2s; animation-duration: 9s;  }
.particles span:nth-child(25) { left: 62%;  animation-delay: 0.3s; animation-duration: 11s; }
.particles span:nth-child(26) { left: 72%;  animation-delay: 4.3s; animation-duration: 12s; }
.particles span:nth-child(27) { left: 82%;  animation-delay: 2.3s; animation-duration: 14s; }
.particles span:nth-child(28) { left: 92%;  animation-delay: 6.3s; animation-duration: 10s; }
.particles span:nth-child(29) { left: 8%;   animation-delay: 1.8s; animation-duration: 13s; }
.particles span:nth-child(30) { left: 18%;  animation-delay: 5.8s; animation-duration: 9s;  }

@keyframes particleFloat {
    0%   { transform: translateY(110vh); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-10vh); opacity: 0; }
}

/* ============ Auth Card ============ */
.auth-container {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 10;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 48px 40px;
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    box-shadow: var(--glass-shadow), 0 0 80px rgba(139, 92, 246, 0.12);
    animation: cardEnter 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg,
        rgba(0, 240, 255, 0.05) 0%,
        transparent 40%,
        transparent 60%,
        rgba(139, 92, 246, 0.05) 100%);
    pointer-events: none;
}

@keyframes cardEnter {
    0%   { opacity: 0; transform: translateY(40px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============ Brand ============ */
.auth-brand {
    text-align: center;
    margin-bottom: 36px;
}

.brand-logo {
    width: 72px;
    height: 72px;
    margin: 0 auto 18px;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(0, 240, 255, 0.4),
                inset 0 0 20px rgba(255, 255, 255, 0.1);
    animation: logoFloat 4s ease-in-out infinite;
}

.brand-logo svg {
    width: 36px; height: 36px;
    color: white;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.6));
}

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

.brand-name {
    font-size: 1.6em;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-family: 'Space Grotesk', sans-serif;
}

.brand-suffix {
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 500;
}

.brand-tagline {
    font-size: 0.85em;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

/* ============ Form ============ */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-field label {
    display: block;
    font-size: 0.78em;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    font-weight: 600;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    width: 18px; height: 18px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.3s ease;
}

.auth-input-wrapper input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.95em;
    font-family: 'JetBrains Mono', monospace;
    transition: all 0.3s ease;
    outline: none;
}

.auth-input-wrapper input::placeholder {
    color: var(--text-muted);
    font-family: 'Space Grotesk', sans-serif;
}

.auth-input-wrapper input:focus {
    border-color: var(--neon-cyan);
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1),
                0 0 20px rgba(0, 240, 255, 0.15);
}

.auth-input-wrapper:focus-within .input-icon {
    color: var(--neon-cyan);
}

/* ============ Submit ============ */
.auth-submit {
    margin-top: 12px;
    padding: 16px;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 0.95em;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 240, 255, 0.3);
}

.auth-submit svg {
    width: 18px; height: 18px;
    transition: transform 0.3s ease;
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 240, 255, 0.5);
}

.auth-submit:hover svg {
    transform: translateX(4px);
}

.auth-submit::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}

.auth-submit:hover::before { left: 100%; }

/* ============ Errors ============ */
.auth-error {
    padding: 12px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: #fca5a5;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ============ Footer ============ */
.auth-footer {
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid rgba(139, 92, 246, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78em;
    color: var(--text-muted);
}

.auth-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px; height: 8px;
    background: var(--neon-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--neon-green);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.6; transform: scale(1.2); }
}

.auth-version {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85em;
}

/* ============ Config Page ============ */
.config-body {
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-y: auto;
    padding: 40px 24px;
}

.config-container {
    max-width: 980px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.config-title {
    font-size: 1.8em;
    font-weight: 700;
}

.config-title-suffix {
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.config-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    backdrop-filter: blur(12px);
}

.user-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.config-section {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 28px;
    margin-bottom: 20px;
    backdrop-filter: blur(16px);
}

.config-section h2 {
    font-size: 1.15em;
    margin-bottom: 18px;
    color: var(--neon-cyan);
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.config-item label {
    display: block;
    font-size: 0.78em;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}

.config-item input, .config-item select {
    width: 100%;
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    outline: none;
    transition: all 0.3s ease;
}

.config-item input:focus, .config-item select:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
}

.config-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.btn-config {
    padding: 12px 22px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary-neon {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    color: white;
    box-shadow: 0 4px 20px rgba(0, 240, 255, 0.3);
}

.btn-primary-neon:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 240, 255, 0.5);
}

.btn-secondary-neon {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-secondary-neon:hover {
    background: rgba(15, 23, 42, 0.9);
    border-color: var(--neon-cyan);
}

.config-message {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.9em;
}
.config-message.success {
    background: rgba(16, 240, 160, 0.1);
    border: 1px solid rgba(16, 240, 160, 0.3);
    color: #6ee7b7;
}
.config-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Toggle switch — design moderno e CLARO */
.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    transition: all 0.2s ease;
    margin-bottom: 12px;
}

.toggle-row:has(input:checked) {
    border-color: rgba(0, 240, 255, 0.5);
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.08), rgba(139, 92, 246, 0.06));
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.1);
}

.toggle-info {
    flex: 1;
    min-width: 0;
}

.toggle-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95em;
    margin-bottom: 4px;
    text-transform: none;
    letter-spacing: 0;
}

.toggle-desc {
    font-size: 0.8em;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Switch container */
.switch-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
    margin: 0;
}

.switch-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
    z-index: 2;
}

/* Slider — desativado (cinza com texto OFF) */
.switch-slider {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 78px;
    height: 32px;
    background: rgba(60, 70, 90, 0.85);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 18px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    overflow: hidden;
}

.switch-slider::before {
    content: 'OFF';
    position: absolute;
    right: 10px;
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.55);
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.switch-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Slider — ATIVADO */
.switch-toggle input:checked + .switch-slider {
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
    border-color: var(--neon-cyan);
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.55);
}

.switch-toggle input:checked + .switch-slider::before {
    content: 'ON';
    right: auto;
    left: 12px;
    color: white;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
}

.switch-toggle input:checked + .switch-slider::after {
    transform: translateX(46px);
    background: white;
    box-shadow: 0 2px 10px rgba(0, 240, 255, 0.6);
}
