﻿/* Variables de color - Tema Gracia Divina (Negro y Dorado) */
:root {
    /* Updated palette to Black & Gold */
    --color-primary: #d4af37; /* Dorado Principal */
    --color-secondary: #b4941f; /* Dorado Oscuro para interacciones */
    --color-accent: #f9e076; /* Dorado Claro para brillos */
    --color-background: #050505; /* Fondo casi negro */
    --color-surface: #121212; /* Fondo de tarjeta gris muy oscuro */
    --color-text: #ffffff; /* Texto blanco */
    --color-text-secondary: #a1a1aa; /* Texto secundario gris claro */
    --color-error: #ef4444;
    --color-border: #333333; /* Bordes oscuros */
    /* Sombras adaptadas a modo oscuro */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-background); /* Added background color to body */
}

/* Contenedor principal */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Dark gradient background */
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

/* Decoración de fondo */
.background-decoration {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.decoration-circle {
    position: absolute;
    border-radius: 50%;
    /* Gold tint for background circles */
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(180, 148, 31, 0.05) 100%);
    animation: float 20s ease-in-out infinite;
}

.decoration-circle-1 {
    width: 400px;
    height: 400px;
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.decoration-circle-2 {
    width: 300px;
    height: 300px;
    bottom: -150px;
    left: -150px;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, -30px) scale(1.1);
    }
}

/* Tarjeta de login */
.login-card {
    background: var(--color-surface);
    border-radius: 24px;
    /* Added subtle gold border for elegance */
    border: 1px solid rgba(212, 175, 55, 0.1);
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header del login */
.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    /* Using Gold Primary color */
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em; /* Increased spacing for elegance */
    text-transform: uppercase; /* Uppercase matches logo style */
}

.login-subtitle {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    font-weight: 400;
}

/* Alerta de error */
.alert-error {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--color-error);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Formulario */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.25rem;
    letter-spacing: 0.02em;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    width: 20px;
    height: 20px;
    color: var(--color-text-secondary);
    pointer-events: none;
    transition: color 0.3s ease;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 3rem;
    font-size: 1rem;
    border: 1px solid var(--color-border); /* Thinner border for elegance */
    border-radius: 12px;
    /* Darker input background */
    background: #1e1e1e;
    color: var(--color-text);
    transition: all 0.3s ease;
    outline: none;
}

    .form-input::placeholder {
        color: var(--color-text-secondary);
        opacity: 0.5;
    }

    .form-input:focus {
        /* Gold border on focus */
        border-color: var(--color-primary);
        box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15);
        background: #252525;
    }

        .form-input:focus + .input-icon,
        .input-wrapper:focus-within .input-icon {
            color: var(--color-primary); /* Gold icon on focus */
        }

.form-error {
    font-size: 0.85rem;
    color: var(--color-error);
    margin-top: 0.25rem;
    display: block;
    min-height: 1.2rem;
}

/* Botón principal */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 700; /* Bolder text */
    color: #000000; /* Black text on Gold button for contrast */
    /* Gold Gradient */
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
    position: relative;
    overflow: hidden;
    margin-top: 0.5rem;
}

    .btn-primary::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 100%);
        transform: translateX(-100%);
        transition: transform 0.6s ease;
    }

    .btn-primary:hover::before {
        transform: translateX(100%);
    }

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(212, 175, 55, 0.3);
    }

    .btn-primary:active {
        transform: translateY(0);
        box-shadow: 0 2px 8px rgba(212, 175, 55, 0.2);
    }

.btn-text {
    position: relative;
    z-index: 1;
}

.btn-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.btn-primary:hover .btn-icon {
    transform: translateX(4px);
}

/* Footer del login */
.login-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.footer-text {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Responsive */
@media (max-width: 640px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

    .login-title {
        font-size: 1.75rem;
    }

    .decoration-circle-1,
    .decoration-circle-2 {
        display: none;
    }
}

/* Animación de carga para el botón */
.btn-primary.loading {
    pointer-events: none;
    opacity: 0.7;
}

    .btn-primary.loading .btn-text::after {
        content: "";
        display: inline-block;
        width: 16px;
        height: 16px;
        margin-left: 8px;
        border: 2px solid rgba(0, 0, 0, 0.3); /* Adjusted spinner color for dark button text */
        border-top-color: #000;
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
    }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
/* Botón secundario (Cancelar) */
.btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text); /* Texto blanco o gris claro */
    background-color: transparent; /* Fondo transparente */
    border: 2px solid var(--color-border); /* Borde sutil */
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none; /* Importante para el <a> */
    margin-top: 1rem; /* Separación del botón primario */
}

    .btn-secondary:hover {
        /* Borde dorado sutil al hacer hover */
        border-color: var(--color-primary);
        color: var(--color-primary);
        background-color: rgba(212, 175, 55, 0.05); /* Fondo muy sutil */
        transform: translateY(-1px);
    }

    .btn-secondary .btn-icon {
        color: var(--color-text-secondary); /* Icono por defecto */
    }

    .btn-secondary:hover .btn-icon {
        color: var(--color-primary); /* Icono dorado al hacer hover */
        transform: translateX(-4px);
    }
