﻿/* ==========================================================================
   VARIÁVEIS GLOBAIS - Tema Claro/Escuro
   ========================================================================== */
:root {
    --primary-color: #4361ee;
    --secondary-color: #3a0ca3;
    --dark-color: #1a1a2e;
    --light-color: #f8f9fa;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
}

[data-theme="dark"] {
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --text-primary: #e9ecef;
    --text-secondary: #adb5bd;
    --border-color: #343a40;
}

/* ==========================================================================
   LAYOUT PRINCIPAL
   ========================================================================== */
body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin: 0;
    transition: background-color 0.3s ease;
}

.auth-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.auth-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

[data-theme="light"] .auth-card {
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

/* ==========================================================================
   LOGO E TÍTULOS
   ========================================================================== */
.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo-img {
    max-width: 200px;
    height: auto;
    margin-bottom: 10px;
}

[data-theme="dark"] .auth-logo-img {
    filter: brightness(0) invert(1);
}

.auth-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 5px;
    text-align: center;
}

.auth-subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 30px;
}

/* ==========================================================================
   TABS
   ========================================================================== */
.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 12px 0;
    text-align: center;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

    .auth-tab:hover {
        color: var(--primary-color);
    }

    .auth-tab.active {
        color: var(--primary-color);
        border-bottom-color: var(--primary-color);
    }

/* ==========================================================================
   FORMULÁRIOS
   ========================================================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: block;
}

.form-control {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    width: 100%;
}

    .form-control:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
        outline: none;
    }

    .form-control::placeholder {
        color: var(--text-secondary);
        opacity: 0.7;
    }

    .form-control.input-validation-error {
        border-color: #dc3545;
    }

/* Grupo de input com botão de visibilidade */
.password-input-group {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    transition: color 0.3s ease;
}

    .toggle-password:hover {
        color: var(--primary-color);
    }

/* Checkbox */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
}

    .form-check-input:checked {
        background-color: var(--primary-color);
        border-color: var(--primary-color);
    }

.form-check-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

/* ==========================================================================
   MEDIDOR DE FORÇA DA SENHA
   ========================================================================== */
.password-strength {
    margin-top: 8px;
}

.strength-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 4px;
}

.strength-fill {
    height: 100%;
    width: 0%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.strength-weak {
    background: #dc3545;
    width: 25%;
}

.strength-fair {
    background: #fd7e14;
    width: 50%;
}

.strength-good {
    background: #ffc107;
    width: 75%;
}

.strength-strong {
    background: #28a745;
    width: 100%;
}

.password-requirements {
    margin-top: 5px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.requirement {
    display: flex;
    align-items: center;
    margin-bottom: 3px;
}

    .requirement.valid {
        color: #28a745;
    }

    .requirement.invalid {
        color: var(--text-secondary);
    }

    .requirement i {
        margin-right: 5px;
        font-size: 0.7rem;
    }

/* ==========================================================================
   BOTÕES
   ========================================================================== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border: none;
    color: white;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(67, 97, 238, 0.3);
    }

    .btn-primary:active {
        transform: translateY(0);
    }

    .btn-primary:disabled {
        opacity: 0.7;
        cursor: not-allowed;
        transform: none;
    }

/* ==========================================================================
   LINKS E FOOTER
   ========================================================================== */
.auth-footer {
    margin-top: 30px;
    text-align: center;
}

.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

    .auth-link:hover {
        text-decoration: underline;
        color: var(--secondary-color);
    }

.copyright {
    margin-top: 30px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   ALERTAS E VALIDAÇÃO
   ========================================================================== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    border: 1px solid transparent;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    border-color: rgba(25, 135, 84, 0.2);
    color: #198754;
}

.text-danger {
    color: #dc3545 !important;
    font-size: 0.8rem;
    margin-top: 4px;
    display: block;
}

.field-validation-error {
    color: #dc3545 !important;
    font-size: 0.8rem;
    margin-top: 4px;
    display: block;
}

.validation-summary-errors {
    color: #dc3545 !important;
}

    .validation-summary-errors ul {
        padding-left: 20px;
        margin-bottom: 0;
    }

/* ==========================================================================
   TOGGLE DE TEMA
   ========================================================================== */
.theme-toggle-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.theme-toggle {
    width: 50px;
    height: 26px;
    background: var(--border-color);
    border-radius: 50px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .theme-toggle.active {
        background: var(--primary-color);
    }

.theme-toggle-icons {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
    z-index: 1;
}

    .theme-toggle-icons i {
        font-size: 0.8rem;
    }

.sun-icon {
    color: #FFD700;
}

.moon-icon {
    color: #E2E8F0;
}

[data-theme="light"] .moon-icon {
    color: #4a5568;
}

.theme-toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 2;
}

.theme-toggle.active .theme-toggle-slider {
    transform: translateX(24px);
}

/* ==========================================================================
   ANIMAÇÕES
   ========================================================================== */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   RESPONSIVIDADE
   ========================================================================== */
@media (max-width: 576px) {
    .auth-card {
        padding: 30px 20px;
    }

    .auth-container {
        padding: 0 10px;
    }

    .theme-toggle-container {
        top: 15px;
        right: 15px;
    }

    .auth-title {
        font-size: 1.5rem;
    }
}

/* ==========================================================================
   ESTILOS ESPECÍFICOS - FORGOT PASSWORD
   ========================================================================== */
.auth-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 30px;
    line-height: 1.6;
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

    .btn-outline-primary:hover {
        background: rgba(67, 97, 238, 0.1);
        text-decoration: none;
        color: var(--primary-color);
    }

.auth-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 576px) {
    .auth-links {
        flex-direction: column;
        gap: 10px;
    }
}

.info-box {
    background: rgba(13, 202, 240, 0.1);
    border: 1px solid rgba(13, 202, 240, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 25px;
    font-size: 0.85rem;
    color: #0dcaf0;
}

    .info-box i {
        margin-right: 8px;
        font-size: 1rem;
    }

[data-theme="light"] .info-box {
    background: rgba(13, 110, 253, 0.1);
    border-color: rgba(13, 110, 253, 0.2);
    color: #0d6efd;
}

.success-box {
    background: rgba(25, 135, 84, 0.1);
    border: 1px solid rgba(25, 135, 84, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 25px;
    text-align: center;
}

    .success-box i {
        font-size: 2rem;
        color: #198754;
        margin-bottom: 10px;
    }

    .success-box h4 {
        color: #198754;
        margin-bottom: 10px;
        font-size: 1.2rem;
    }

    .success-box p {
        color: var(--text-secondary);
        margin-bottom: 0;
    }

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}