:root {
    --primary: #00e5ff;
    --primary-dark: #00b0ff;
    --secondary: #b388ff;
    --bg-dark: #020914;
    --bg-glass: rgba(10, 18, 38, 0.45);
    --border-glass: rgba(255, 255, 255, 0.08);
    --text-main: #f8fdff;
    --text-muted: #8b9bb4;
    --success: #00e676;
    --error: #ff1744;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', sans-serif;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Fundo Animado com Partículas (Canvas) */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
}

/* Área de Apresentação Hero */
.hero-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 10;
}

.hero-title {
    font-size: 4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.2s;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 50px;
    max-width: 600px;
    opacity: 0;
    animation: fadeUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.5s;
}

.scroll-indicator {
    position: absolute;
    bottom: 50px;
    animation: floatBounce 2s infinite ease-in-out;
    opacity: 0;
    animation-delay: 1.5s;
    transition: opacity 0.5s;
}

.scroll-indicator a {
    color: var(--primary);
    font-size: 2rem;
    text-decoration: none;
    cursor: pointer;
}

/* Sessão Form ElementReveal */
.form-section {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    position: relative;
    z-index: 10;
    opacity: 0;
    transform: translateY(100px);
    transition: all 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-section.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Perspective Container for 3D Flip */
.flip-container {
    perspective: 1500px;
    width: 100%;
    max-width: 500px;
}

/* The Flipper Logic */
.flipper {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform-style: preserve-3d;
}

.flip-container.flipped .flipper {
    transform: rotateY(180deg);
}

/* Front & Back Faces */
.front, .back {
    width: 100%;
    backface-visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    
    /* Glassmorphism */
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 50px 40px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255,255,255,0.1);
}

/* Because they are absolute to overlap, the parent needs height. We will manage this dynamically in JS, but give a default */
.front {
    z-index: 2;
    transform: rotateY(0deg);
    position: relative; /* Set front to relative so the container takes its height */
}

.back {
    transform: rotateY(180deg);
    /* For back, we'll make it absolute so it snaps exactly onto the front */
    position: absolute;
    top: 0;
    left: 0;
    height: 100%; 
    display: flex;
    flex-direction: column;
}

/* Logo Area */
.glass-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 40px;
}

.glass-logo-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
    margin-right: 15px;
}

.glass-logo-text {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -1px;
}
.glass-logo-text span {
    color: var(--primary);
}

/* Headings */
.front h1, .back h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

.front p, .back p {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    margin-bottom: 30px;
}

/* Switcher */
.scene-switcher {
    text-align: center;
    margin-top: 25px;
    font-size: 14px;
    color: var(--text-muted);
}
.scene-switcher span {
    color: var(--primary);
    cursor: pointer;
    font-weight: 600;
    transition: color 0.3s;
}
.scene-switcher span:hover {
    color: var(--primary-dark);
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

/* Forms and Inputs */
.form-group-float {
    position: relative;
    margin-bottom: 25px;
}

.form-group-float input, .form-group-float select {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 16px 20px 16px 50px;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s;
    outline: none;
}

.form-group-float select {
    appearance: none;
}
.form-group-float select option {
    background: var(--bg-dark);
    color: white;
}

.form-group-float i.field-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
    transition: color 0.3s;
}

.form-group-float input:focus, .form-group-float select:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.15);
}

.form-group-float input:focus ~ i.field-icon, .form-group-float select:focus ~ i.field-icon {
    color: var(--primary);
}

.password-toggle {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.3s;
    z-index: 5;
}
.password-toggle:hover {
    color: var(--primary);
}

/* Floating labels effect */
.form-group-float label.floating-label {
    position: absolute;
    left: 50px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: all 0.3s;
    font-size: 15px;
}

.form-group-float input:focus ~ label.floating-label, 
.form-group-float input:not(:placeholder-shown) ~ label.floating-label {
    top: -10px;
    left: 15px;
    font-size: 12px;
    color: var(--primary);
    background: var(--bg-dark);
    padding: 0 5px;
    border-radius: 4px;
}

/* Buttons */
.btn-neon {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.1), rgba(179, 136, 255, 0.1));
    border: 1px solid var(--primary);
    color: var(--primary);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.btn-neon::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-neon:hover {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 25px rgba(0, 229, 255, 0.4);
    transform: translateY(-2px);
}

.btn-neon:hover::before {
    left: 100%;
}

.btn-neon.success-theme {
    border-color: var(--success);
    color: var(--success);
    background: linear-gradient(135deg, rgba(0, 230, 118, 0.1), rgba(0, 230, 118, 0.05));
}
.btn-neon.success-theme:hover {
    background: linear-gradient(135deg, var(--success), #00bfa5);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 25px rgba(0, 230, 118, 0.4);
}

/* Extra Links */
.extra-links {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    font-size: 14px;
}

.remember-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}
.remember-check input[type="checkbox"] {
    accent-color: var(--primary);
    width: 16px;
    height: 16px;
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    transition: 0.3s;
}
.forgot-password:hover {
    text-shadow: 0 0 8px rgba(0, 229, 255, 0.6);
}

/* App Footer Links */
.corporate-links {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    z-index: 10;
}

.corporate-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
    background: rgba(0,0,0,0.5);
    padding: 8px 15px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.05);
}

.corporate-links a:hover {
    color: var(--primary);
    background: rgba(0,0,0,0.8);
    border-color: var(--primary);
}

/* Alerts Validation */
.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
    animation: fadeIn 0.3s;
    backdrop-filter: blur(10px);
}
.alert.show { display: block; }
.alert.success {
    background: rgba(0, 230, 118, 0.1);
    color: var(--success);
    border: 1px solid rgba(0, 230, 118, 0.3);
}
.alert.error {
    background: rgba(255, 23, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(255, 23, 68, 0.3);
}

/* CNPJ Wrapper Custom */
.cnpj-status-icon {
    font-size: 20px;
    color: var(--text-muted);
    transition: color 0.3s;
}

/* Animations */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Forgot Modal styling adjusted for glass */
.forgot-modal-backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}
.forgot-modal {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: white;
}
.forgot-modal-header h3 { color: white; }
.forgot-modal p { color: var(--text-muted); }
.forgot-modal .form-group label { color: white; }
.forgot-modal .form-group input[type="email"] {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
    color: white;
}
.forgot-modal .form-group input[type="email"]:focus {
    border-color: var(--primary);
}
.forgot-modal .btn-cancelar { color: var(--text-muted); }
.forgot-modal .btn-cancelar:hover { color: white; }
.forgot-modal .btn-enviar {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}
