/* ==========================================================================
   Base e Variáveis CSS
   ========================================================================== */
:root {
    --bg-color: #0d0d12;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
    --accent-color: #ec4899;
    
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --input-bg: rgba(0, 0, 0, 0.2);
    --input-border: rgba(255, 255, 255, 0.12);
    --input-focus: rgba(139, 92, 246, 0.5);
    
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.4);
    --glass-blur: 24px;
    --radius-lg: 20px;
    --radius-md: 12px;
    --radius-sm: 8px;
    
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-medium: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* ==========================================================================
   Background & Blobs Decorativos
   ========================================================================== */
.page-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
    animation: float 10s ease-in-out infinite alternate;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--primary-color) 0%, transparent 70%);
    top: -10%;
    left: -10%;
}

.blob-2 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--accent-color) 0%, transparent 70%);
    bottom: -15%;
    right: -10%;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 40px) scale(1.1); }
}

/* ==========================================================================
   Card de Login (Glassmorphism)
   ========================================================================== */
.login-container {
    background: var(--card-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-soft);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-wrapper {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 1.25rem;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
}

.logo-wrapper i {
    font-size: 28px;
    color: white;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ==========================================================================
   Formulário e Inputs
   ========================================================================== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 2px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.icon-left {
    position: absolute;
    left: 14px;
    color: var(--text-secondary);
    font-size: 1.2rem;
    pointer-events: none;
    transition: color var(--transition-fast);
}

.input-wrapper input {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    padding: 0.875rem 1rem 0.875rem 2.8rem;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all var(--transition-fast);
}

.input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

/* Foco nos Inputs */
.input-wrapper input:focus,
.input-wrapper input:hover {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.3);
}

.input-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--input-focus);
}

.input-wrapper input:focus ~ .icon-left,
.input-wrapper input:not(:placeholder-shown) ~ .icon-left {
    color: var(--primary-color);
}

/* Alternar Senha (Olho) */
.toggle-password {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color var(--transition-fast);
}

.toggle-password:hover {
    color: var(--text-primary);
}

/* ==========================================================================
   Ações (Lembrar-me & Esqueci Senha)
   ========================================================================== */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

/* Custom Checkbox */
.remember-me input {
    display: none;
}

.checkmark-box {
    width: 18px;
    height: 18px;
    border: 1px solid var(--input-border);
    border-radius: 4px;
    background: var(--input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.remember-me input:checked + .checkmark-box {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.remember-me input:checked + .checkmark-box::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

.forgot-password {
    color: var(--primary-color);
    font-size: 0.875rem;
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.forgot-password:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* ==========================================================================
   Botão Principal
   ========================================================================== */
.btn-primary {
    position: relative;
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all var(--transition-medium);
    overflow: hidden;
}

/* Efeito de brilho hover */
.btn-primary::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 ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 1.1rem;
    transition: transform var(--transition-medium);
}

.btn-primary:hover .btn-icon {
    transform: translateX(4px);
}

/* Loading spinner */
.loader-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.none {
    display: none !important;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Estado de loading no botão */
.btn-primary.loading {
    opacity: 0.8;
    pointer-events: none;
}

.btn-primary.loading .btn-text,
.btn-primary.loading .btn-icon {
    display: none;
}

.btn-primary.loading .loader-spinner {
    display: block !important;
}

/* ==========================================================================
   Footer do Painel
   ========================================================================== */
.login-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
}

.login-footer p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-footer a {
    color: white;
    font-weight: 500;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.login-footer a:hover {
    color: var(--primary-color);
}

/* ==========================================================================
   Responsividade
   ========================================================================== */
@media (max-width: 480px) {
    .login-container {
        padding: 2.5rem 1.5rem;
        margin: 1rem;
        border-radius: 16px;
    }
    
    .blob {
        filter: blur(60px);
    }
}


/* Efeito de Erro */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}
.error-shake { animation: shake 0.4s; }
