/* ============================================
   DRMAPI - Página de Login
   Sistema de Design Moderno com Tema Claro/Escuro
   ============================================ */

/* Variáveis CSS para temas */
:root {
    /* Tema Claro (padrão) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Cores do sistema - Azul */
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --primary-darker: #1e3a8a;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    
    /* Gradientes - Azul */
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    --gradient-secondary: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
    --gradient-accent: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%);
    
    /* Orbs animados - Azul */
    --orb-1-color: rgba(37, 99, 235, 0.3);
    --orb-2-color: rgba(59, 130, 246, 0.3);
    --orb-3-color: rgba(96, 165, 250, 0.2);
}

[data-theme="dark"] {
    /* Tema Escuro */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: #334155;
    --bg-overlay: rgba(15, 23, 42, 0.8);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    
    /* Tema Escuro - Azul Escuro */
    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --primary-light: #2563eb;
    --primary-darker: #1e3a8a;
    
    --gradient-primary: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    --gradient-secondary: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    --gradient-accent: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    
    --orb-1-color: rgba(30, 64, 175, 0.2);
    --orb-2-color: rgba(37, 99, 235, 0.2);
    --orb-3-color: rgba(59, 130, 246, 0.15);
}

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--orb-1-color);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: var(--orb-2-color);
    bottom: -250px;
    right: -250px;
    animation-delay: -7s;
}

.orb-3 {
    width: 350px;
    height: 350px;
    background: var(--orb-3-color);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* Container Principal */
.login-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Header com Toggle de Tema */
.login-header {
    position: fixed;
    top: 30px;
    right: 30px;
    z-index: 1000;
}

.theme-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--bg-secondary);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-icon {
    position: absolute;
    font-size: 20px;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.theme-icon.sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-icon.moon {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

[data-theme="dark"] .theme-icon.sun {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

[data-theme="dark"] .theme-icon.moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Card de Login */
.login-card {
    width: 100%;
    max-width: 450px;
    background: var(--bg-secondary);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 48px 40px;
    box-shadow: var(--shadow-2xl);
    border: 1px solid var(--border-color);
    animation: slideUp 0.6s ease-out;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

[data-theme="dark"] .login-card {
    background: var(--bg-overlay);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-card:hover {
    box-shadow: var(--shadow-2xl);
    transform: translateY(-2px);
}

/* Brand/Logo */
.login-brand {
    text-align: center;
    margin-bottom: 40px;
}

.logo-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon {
    font-size: 48px;
    z-index: 2;
    position: relative;
    animation: pulse 2s ease-in-out infinite;
    color: var(--primary);
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.logo-rings {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.ring {
    position: absolute;
    border-radius: 50%;
    border: 2px solid var(--primary);
    opacity: 0.3;
    animation: ripple 2s ease-out infinite;
}

.ring-1 {
    width: 100px;
    height: 100px;
    top: 0;
    left: 0;
    animation-delay: 0s;
}

.ring-2 {
    width: 120px;
    height: 120px;
    top: -10px;
    left: -10px;
    animation-delay: 0.5s;
}

.ring-3 {
    width: 140px;
    height: 140px;
    top: -20px;
    left: -20px;
    animation-delay: 1s;
}

@keyframes ripple {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

.brand-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    letter-spacing: -1px;
}

.brand-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.version-badge {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    padding: 2px 8px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 6px;
    letter-spacing: 0.3px;
}

[data-theme="dark"] .version-badge {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

/* Mensagem de Boas-vindas */
.welcome-message {
    text-align: center;
    margin-bottom: 32px;
}

.welcome-message h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.welcome-message p {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Formulário */
.login-form {
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 16px;
    font-size: 16px;
    z-index: 1;
    pointer-events: none;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.password-toggle {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    z-index: 1;
}

.password-toggle:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.eye-icon {
    font-size: 18px;
}

.social-icon {
    font-size: 18px;
}

/* Opções do Formulário */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    font-size: 0.875rem;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 8px;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-label {
    color: var(--text-secondary);
    user-select: none;
}

.forgot-password {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.forgot-password:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Botões */
.btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-loader {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Botões Sociais */
.social-login {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    margin-bottom: 24px;
}

.btn-social {
    flex: 1;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 12px 20px;
    font-size: 0.95rem;
}

.btn-social:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-google {
    transition: all 0.3s ease;
}

.btn-google:hover {
    border-color: #4285F4;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.btn-github {
    transition: all 0.3s ease;
}

.btn-github:hover {
    border-color: #333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-text {
    font-weight: 600;
}

/* Divisor */
.divider {
    display: flex;
    align-items: center;
    margin: 32px 0;
    gap: 16px;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.divider-text {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* Footer */
.login-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.login-footer .link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.login-footer .link:hover {
    text-decoration: underline;
}

.version-info {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 100px;
    right: 30px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: var(--shadow-xl);
    min-width: 300px;
    animation: slideInRight 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 12px;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    border-left: 4px solid var(--success);
}

.toast.error {
    border-left: 4px solid var(--error);
}

.toast-icon {
    font-size: 20px;
}

.toast-message {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* Efeito de brilho no card ao hover */
.login-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.login-card:hover::before {
    opacity: 1;
}

/* Melhorias nos inputs */
.form-input {
    font-family: inherit;
}

.form-input:valid {
    border-color: var(--success);
}

/* Animação suave no botão social ao hover */
.btn-social {
    position: relative;
    overflow: hidden;
}

.btn-social::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-social:hover::before {
    width: 300px;
    height: 300px;
}

.social-icon,
.social-text {
    position: relative;
    z-index: 1;
}

/* Responsividade */
@media (max-width: 640px) {
    .login-header {
        top: 20px;
        right: 20px;
    }

    .theme-toggle {
        width: 50px;
        height: 50px;
    }

    .login-card {
        padding: 32px 24px;
        border-radius: 20px;
    }

    .brand-title {
        font-size: 2rem;
    }

    .social-login {
        flex-direction: column;
    }

    .toast-container {
        right: 20px;
        left: 20px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }
}

/* Animações de entrada */
@media (prefers-reduced-motion: no-preference) {
    .login-card {
        animation: slideUp 0.6s ease-out;
    }

    .logo-icon {
        animation: pulse 2s ease-in-out infinite;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

