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

:root {
    /* Core Colors - Will be updated with user's theme */
    --primary-blue: #4f46e5;
    --primary-blue-light: #6366f1;
    --primary-blue-dark: #3730a3;
    --accent-cyan: #06b6d4;
    --accent-cyan-light: #22d3ee;
    
    /* Dark Theme Colors */
    --background-dark: #0f0f23;
    --background-darker: #242479;
    --surface-dark: #161e27;
    --surface-lighter: #1a1a99;
    
    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Status Colors */
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;
    
    /* Spacing - Reduced for less spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-base: 0.75rem;
    --spacing-lg: 1rem;
    --spacing-xl: 1.25rem;
    --spacing-2xl: 1.5rem;
    --spacing-3xl: 2rem;
    
    /* Radius */
    --radius-sm: 0.375rem;
    --radius-base: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

body {
    font-family: var(--font-family);
    line-height: 1.5;
    color: var(--gray-900);
    background-color: var(--background-dark);
    overflow: hidden;
}

/* Login Container
   Porcentagem (e nao vh/vw): com zoom na pagina, vh/vw ficam menores que a janela
   e sobra faixa escura na direita e embaixo. */
.login-container {
    display: flex;
    height: calc(100vh / 0.9); /* 0.9 = zoom da pagina (html { zoom: 0.9 } no login.php) */
    width: 100%;
}

/* Brand Panel (Left Side) - Dark Tech Theme */
.brand-panel {
    flex: 2;
    background: linear-gradient(135deg, var(--background-dark) 0%, var(--background-darker) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Animated Tech Background */
.tech-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.grid-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(79, 70, 229, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 70, 229, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

.floating-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-blue);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 8s ease-in-out infinite;
}

.particle:nth-child(1) {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
    animation-duration: 8s;
}

.particle:nth-child(2) {
    top: 60%;
    left: 80%;
    animation-delay: 2s;
    animation-duration: 10s;
}

.particle:nth-child(3) {
    top: 80%;
    left: 30%;
    animation-delay: 4s;
    animation-duration: 12s;
}

.particle:nth-child(4) {
    top: 30%;
    left: 70%;
    animation-delay: 1s;
    animation-duration: 9s;
}

.particle:nth-child(5) {
    top: 70%;
    left: 60%;
    animation-delay: 3s;
    animation-duration: 11s;
}

.particle:nth-child(6) {
    top: 40%;
    left: 40%;
    animation-delay: 5s;
    animation-duration: 7s;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) translateX(0px) scale(1);
        opacity: 0.6;
    }
    25% { 
        transform: translateY(-20px) translateX(10px) scale(1.2);
        opacity: 1;
    }
    50% { 
        transform: translateY(-10px) translateX(-15px) scale(0.8);
        opacity: 0.8;
    }
    75% { 
        transform: translateY(15px) translateX(5px) scale(1.1);
        opacity: 0.9;
    }
}

.connection-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.connections {
    width: 100%;
    height: 100%;
    opacity: 0.4;
}

.connection-path {
    stroke-width: 1.5;
    stroke-dasharray: 5, 10;
    animation: dash 15s linear infinite;
}

@keyframes dash {
    0% {
        stroke-dashoffset: 0;
        opacity: 0.4;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        stroke-dashoffset: -100;
        opacity: 0.4;
    }
}

.brand-content {
    position: relative;
    z-index: 2;
    max-width: 500px;
    padding: var(--spacing-2xl);
    color: var(--white);
    text-align: center;
}

.main-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-3xl);
}

.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
}

.logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-cyan));
    color: var(--white);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-3xl);
    box-shadow: 0 0 30px rgba(79, 70, 229, 0.4);
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { 
        box-shadow: 0 0 30px rgba(79, 70, 229, 0.4);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 40px rgba(79, 70, 229, 0.6);
        transform: scale(1.05);
    }
}

.brand-name {
    font-size: var(--font-size-5xl);
    font-weight: 700;
    color: var(--white);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.hero-text {
    text-align: center;
}

.hero-text h2 {
    font-size: var(--font-size-3xl);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    line-height: 1.2;
    color: var(--white);
}


.highlight {
    color: var(--accent-cyan);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

/* Form Panel (Right Side) - Dark Theme */
.form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--surface-dark) 0%, var(--surface-lighter) 100%);
    position: relative;
}

.form-content {
    width: 100%;
    max-width: 380px;
    padding: var(--spacing-xl);
}

/* Mobile Brand (Hidden on Desktop) */
.mobile-brand {
    display: none;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-base);
    margin-bottom: var(--spacing-xl);
}

.mobile-logo {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-cyan));
    color: var(--white);
    border-radius: var(--radius-base);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--font-size-xl);
}

.mobile-brand h1 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--white);
}

/* Form Header */
.form-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.form-header h2 {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--white);
    margin-bottom: var(--spacing-xs);
}

.form-header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: var(--font-size-sm);
}

/* Form - Less Spacing */
.login-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-field label {
    font-weight: 600;
    color: var(--white);
    font-size: var(--font-size-sm);
}

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

.form-input {
    width: 100%;
    height: 44px;
    padding: 0 var(--spacing-base);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-base);
    font-size: var(--font-size-sm);
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    backdrop-filter: blur(10px);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-size: var(--font-size-sm);
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: var(--spacing-base);
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: var(--spacing-xs);
    border-radius: var(--radius-sm);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--white);
}

/* Validation States */
.form-field.error .form-input {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.1);
}

.form-field.success .form-input {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
    background: rgba(16, 185, 129, 0.1);
}

.error-message {
    font-size: var(--font-size-xs);
    color: var(--error);
    font-weight: 500;
    min-height: 16px;
}

/* Submit Button - Less Spacing */
.submit-button {
    height: 44px;
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-cyan));
    color: var(--white);
    border: none;
    border-radius: var(--radius-base);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.submit-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
}

.submit-button:active:not(:disabled) {
    transform: translateY(0);
}

.submit-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
}

.submit-button.loading .button-text {
    opacity: 0;
}

.submit-button.loading .loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alternative Login */
.alternative-login {
    text-align: center;
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.alternative-login a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: var(--font-size-xs);
    transition: color 0.2s;
}

.alternative-login a:hover {
    color: var(--accent-cyan);
}

.alternative-login strong {
    color: var(--accent-cyan);
    font-weight: 600;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: var(--spacing-base);
    right: var(--spacing-base);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.toast {
    background: var(--surface-dark);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-base);
    padding: var(--spacing-base) var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    max-width: 320px;
    transform: translateX(400px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: var(--font-size-sm);
    color: var(--white);
    backdrop-filter: blur(10px);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid var(--success);
    color: var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
    color: var(--error);
}

/* Typewriter Animation */
@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Desktop Layout */
@media (min-width: 1024px) {
    .mobile-brand {
        display: none;
    }
    
    .form-header {
        text-align: left;
    }
}

/* Tablet Layout */
@media (max-width: 1023px) and (min-width: 769px) {
    .brand-panel {
        display: none;
    }
    
    .form-panel {
        flex: none;
        width: 100%;
        background: linear-gradient(135deg, var(--surface-dark) 0%, var(--surface-lighter) 100%);
    }
    
    .mobile-brand {
        display: flex;
    }
    
    .form-header {
        text-align: center;
    }
    
    .form-content {
        max-width: 420px;
    }
}

/* Mobile Layout - Improved */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
    }
    
    .login-container {
        flex-direction: column;
        height: auto;
        min-height: calc(100vh / 0.9);
    }
    
    .brand-panel {
        display: none;
    }
    
    .form-panel {
        flex: 1;
        padding: var(--spacing-base);
        background: linear-gradient(135deg, var(--surface-dark) 0%, var(--surface-lighter) 100%);
        min-height: calc(100vh / 0.9);
        justify-content: flex-start;
        padding-top: var(--spacing-3xl);
    }
    
    .mobile-brand {
        display: flex;
        margin-bottom: var(--spacing-2xl);
    }
    
    .form-content {
        padding: var(--spacing-base);
        max-width: none;
        width: 100%;
    }
    
    .form-header {
        text-align: center;
        margin-bottom: var(--spacing-xl);
    }
    
    .form-header h2 {
        font-size: var(--font-size-xl);
    }
    
    .login-form {
        gap: var(--spacing-lg);
    }
    
    .form-input,
    .submit-button {
        height: 48px;
    }
    
    .toast-container {
        left: var(--spacing-base);
        right: var(--spacing-base);
    }
    
    .toast {
        max-width: none;
        transform: translateY(-100px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
    .form-content {
        padding: var(--spacing-sm);
    }
    
    .mobile-brand h1 {
        font-size: var(--font-size-xl);
    }
    
    .form-header h2 {
        font-size: var(--font-size-lg);
    }
    
    .form-input,
    .submit-button {
        height: 44px;
        font-size: var(--font-size-sm);
    }
    
    .login-form {
        gap: var(--spacing-base);
    }
    
    .form-field {
        gap: 2px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .tech-background * {
        animation: none !important;
    }
}

@media (prefers-contrast: high) {
    .form-input {
        border-width: 2px;
    }
    
    .form-input:focus {
        border-width: 3px;
    }
}

/* Focus visible for keyboard navigation */
.form-input:focus-visible,
.submit-button:focus-visible,
.password-toggle:focus-visible,
.alternative-login a:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 2px;
}

/* High DPI/Retina displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo {
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .particle {
        border: 0.5px solid rgba(79, 70, 229, 0.3);
    }
}