/*
 * Ovisoft - Estilos de Autenticación
 * 
 * ============================================================
 * DESCRIPCIÓN:
 * ============================================================
 * Estilos para las páginas de login y registro
 * Usa la misma paleta de colores del dashboard principal
 * Incluye soporte para modo oscuro y diseño responsivo
 */

/* ========================================
   Variables CSS y Configuración de Tema
   ======================================== */

:root {
    /* Colores Primarios (del dashboard) */
    --primary-color: #4c6fff;
    --primary-dark: #3d5acc;
    --primary-light: #6b85ff;

    /* Colores Secundarios */
    --secondary-color: #00d4aa;
    --accent-color: #6c5dd3;

    /* Gradientes */
    --gradient-start: #0d47a1;
    --gradient-mid: #1976d2;
    --gradient-end: #42a5f5;

    /* Colores Neutros - Tema Claro */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f3f9;

    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);

    /* Transiciones */
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;

    /* Colores de Estado */
    --success-color: #00d4aa;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
}

/* Tema Oscuro */
[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --border-color: #334155;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
}

/* ========================================
   Estilos Base
   ======================================== */

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

body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    transition: var(--transition-base);
}

/* ========================================
   Botón de Modo Oscuro
   ======================================== */

.btn-dark-mode {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition-fast);
    z-index: 1000;
}

.btn-dark-mode:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    transform: scale(1.05);
}

/* ========================================
   Contenedor Principal
   ======================================== */

.auth-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ========================================
   Columna de Branding (Izquierda)
   ======================================== */

.auth-branding {
    position: relative;
    background: url('/upload/backlogin.svg') no-repeat center center;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    overflow: hidden;
}

.branding-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 500px;
}

.branding-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 40px;
    filter: brightness(0) invert(1);
}

.branding-title {
    font-size: 42px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 16px;
    line-height: 1.2;
}

.branding-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

/* Decoración de Fondo */
.branding-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.decoration-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.decoration-circle-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
}

.decoration-circle-2 {
    width: 300px;
    height: 300px;
    bottom: -80px;
    left: -80px;
}

.decoration-circle-3 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 10%;
    opacity: 0.5;
}

/* ========================================
   Columna de Formulario (Derecha)
   ======================================== */

.auth-form-container {
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
}

.auth-form-wrapper {
    width: 100%;
    max-width: 480px;
}

/* Logo Móvil (oculto en desktop) */
.auth-logo-mobile {
    display: none;
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-mobile img {
    max-width: 150px;
    height: auto;
}

/* ========================================
   Header del Formulario
   ======================================== */

.auth-header {
    margin-bottom: 32px;
}

.auth-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.auth-description {
    font-size: 15px;
    color: var(--text-secondary);
}

/* ========================================
   Formulario
   ======================================== */

.auth-form {
    width: 100%;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-label i {
    font-size: 14px;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: var(--transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 111, 255, 0.1);
    background-color: var(--bg-secondary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control.error {
    border-color: var(--error-color);
}

.form-error {
    display: none;
    font-size: 13px;
    color: var(--error-color);
    margin-top: 6px;
}

.form-error.show {
    display: block;
}

/* ========================================
   Mensaje de Ayuda
   ======================================== */

.form-help {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    background-color: rgba(76, 111, 255, 0.1);
    border-left: 3px solid var(--primary-color);
    border-radius: 6px;
    margin-bottom: 24px;
}

.form-help i {
    color: var(--primary-color);
    font-size: 16px;
    margin-top: 2px;
}

.form-help span {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ========================================
   Mensaje de Éxito
   ======================================== */

.success-message {
    text-align: center;
    padding: 32px 24px;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #00d4aa 0%, #00b894 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleIn 0.5s ease-in-out;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

.success-icon i {
    font-size: 40px;
    color: #ffffff;
}

.success-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.success-text {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.success-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    padding: 12px;
    background-color: var(--bg-primary);
    border-radius: 6px;
}

.success-note i {
    color: var(--warning-color);
}

/* ========================================
   Campo de Contraseña con Toggle
   ======================================== */

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-control {
    padding-right: 48px;
}

.btn-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    transition: var(--transition-fast);
}

.btn-toggle-password:hover {
    color: var(--text-primary);
}

/* ========================================
   Indicador de Fortaleza de Contraseña
   ======================================== */

.password-strength {
    margin-top: 8px;
}

.strength-bar {
    height: 4px;
    background-color: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.strength-bar-fill {
    height: 100%;
    width: 0%;
    transition: var(--transition-base);
    border-radius: 2px;
}

.strength-bar-fill.weak {
    width: 33%;
    background-color: var(--error-color);
}

.strength-bar-fill.medium {
    width: 66%;
    background-color: var(--warning-color);
}

.strength-bar-fill.strong {
    width: 100%;
    background-color: var(--success-color);
}

.strength-text {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========================================
   Opciones del Formulario
   ======================================== */

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* Checkbox Personalizado */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: #ffffff;
    font-size: 10px;
}

.checkbox-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.link-forgot {
    font-size: 14px;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-fast);
}

.link-forgot:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ========================================
   Botones
   ======================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
}

.btn-loader {
    display: none;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loader {
    display: inline-block;
}

/* Botones de Social Login */
.btn-social {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-social:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--text-muted);
}

.btn-google:hover {
    border-color: #ea4335;
    color: #ea4335;
}

.btn-microsoft:hover {
    border-color: #00a4ef;
    color: #00a4ef;
}

/* ========================================
   Divider
   ======================================== */

.auth-divider {
    position: relative;
    text-align: center;
    margin: 32px 0;
}

.auth-divider::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--border-color);
}

.auth-divider span {
    position: relative;
    display: inline-block;
    padding: 0 16px;
    background-color: var(--bg-secondary);
    color: var(--text-muted);
    font-size: 13px;
}

/* ========================================
   Mensajes de Alerta
   ======================================== */

.text-danger {
    color: var(--error-color);
    font-size: 14px;
    margin-bottom: 16px;
}

/* ========================================
   Social Login
   ======================================== */

.social-login {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

/* ========================================
   Footer del Formulario
   ======================================== */

.auth-footer {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    font-size: 14px;
    color: var(--text-secondary);
}

.link-primary {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition-fast);
}

.link-primary:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ========================================
   Diseño Responsivo
   ======================================== */

/* Tablets */
@media (max-width: 1024px) {
    .auth-container {
        grid-template-columns: 1fr;
    }

    .auth-branding {
        display: none;
    }

    .auth-logo-mobile {
        display: block;
    }

    .auth-form-container {
        padding: 40px 32px;
    }
}

/* Móviles */
@media (max-width: 640px) {
    .btn-dark-mode {
        width: 44px;
        height: 44px;
        font-size: 18px;
        top: 16px;
        right: 16px;
    }

    .auth-form-container {
        padding: 32px 20px;
    }

    .auth-title {
        font-size: 28px;
    }

    .auth-description {
        font-size: 14px;
    }

    .form-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .social-login {
        grid-template-columns: 1fr;
    }
}
