/* Reset y variables */
:root {
    --primary: #8C1636;
    --primary-light: #BF7589;
    --primary-lighter: #D9A9B6;
    --white: #F2F2F2;
    --black: #0D0D0D;
    --shadow: rgba(140, 22, 54, 0.15);
    --shadow-hover: rgba(140, 22, 54, 0.25);
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Playfair Display', serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background: var(--white);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

/* Contenedor principal */
.login-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* Card de login */
.login-card {
    background: white;
    border-radius: 32px;
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 
        0 20px 60px var(--shadow),
        0 0 0 1px rgba(140, 22, 54, 0.05);
    position: relative;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 30px 80px var(--shadow-hover),
        0 0 0 1px rgba(140, 22, 54, 0.08);
}

/* Header */
.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-wrapper {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(140, 22, 54, 0.08), rgba(191, 117, 137, 0.08));
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.logo-wrapper:hover {
    transform: scale(1.05);
    background: linear-gradient(135deg, rgba(140, 22, 54, 0.12), rgba(191, 117, 137, 0.12));
}

.logo-icon {
    width: 50px;
    height: 50px;
}

.login-header h1 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--primary-light);
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Formulario */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--black);
    letter-spacing: 0.3px;
    text-transform: uppercase;
    opacity: 0.7;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: 14px;
    border: 2px solid rgba(140, 22, 54, 0.1);
    transition: all 0.3s ease;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(140, 22, 54, 0.1);
}

.input-icon {
    position: absolute;
    left: 16px;
    color: rgba(140, 22, 54, 0.4);
    transition: color 0.3s ease;
}

.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

.input-wrapper input {
    width: 100%;
    padding: 16px 48px 16px 48px;
    border: none;
    background: transparent;
    font-size: 15px;
    font-family: var(--font-primary);
    color: var(--black);
    outline: none;
}

.input-wrapper input::placeholder {
    color: rgba(13, 13, 13, 0.3);
}

.toggle-password {
    position: absolute;
    right: 16px;
    background: none;
    border: none;
    color: rgba(13, 13, 13, 0.3);
    cursor: pointer;
    padding: 4px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.toggle-password:hover {
    color: var(--primary);
    background: rgba(140, 22, 54, 0.05);
}

/* Opciones del formulario */
.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    margin: 4px 0 0;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--black);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.remember-me:hover {
    opacity: 1;
}

.remember-me input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(140, 22, 54, 0.2);
    border-radius: 6px;
    position: relative;
    transition: all 0.3s ease;
}

.remember-me input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.remember-me input:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: 700;
}

.forgot-password {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    font-size: 14px;
}

.forgot-password:hover {
    color: var(--primary);
}

/* Botón de login */
.login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), #a01a3f);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.login-btn::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.6s ease;
}

.login-btn:hover::before {
    left: 100%;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(140, 22, 54, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn svg {
    transition: transform 0.3s ease;
}

.login-btn:hover svg {
    transform: translateX(4px);
}

/* Mensaje de error */
.error-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fff5f5;
    border-radius: 10px;
    border: 1px solid #fecaca;
    color: #dc2626;
    font-size: 14px;
    animation: shake 0.4s ease;
}

.error-message svg {
    flex-shrink: 0;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Footer */
.login-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(13, 13, 13, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 13px;
    color: rgba(13, 13, 13, 0.4);
}

.login-footer a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.login-footer a:hover {
    color: var(--primary);
}

.separator {
    opacity: 0.3;
}

/* Decoración de fondo */
.login-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.decoration-circle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.decoration-circle.circle-1 {
    width: 500px;
    height: 500px;
    top: -200px;
    right: -100px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-lighter));
    opacity: 0.1;
    animation-delay: 0s;
}

.decoration-circle.circle-2 {
    width: 300px;
    height: 300px;
    bottom: -100px;
    left: -100px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    opacity: 0.08;
    animation-delay: -5s;
}

.decoration-circle.circle-3 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--primary-lighter) 0%, transparent 70%);
    opacity: 0.05;
    animation-delay: -10s;
}

@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); }
}

/* Responsive */
@media (max-width: 640px) {
    .login-card {
        padding: 32px 24px;
        border-radius: 24px;
    }

    .login-header h1 {
        font-size: 24px;
    }

    .form-options {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .decoration-circle.circle-1 {
        width: 300px;
        height: 300px;
        top: -100px;
        right: -50px;
    }

    .decoration-circle.circle-2 {
        width: 200px;
        height: 200px;
        bottom: -50px;
        left: -50px;
    }
}

/* Spinner para loading */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px 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); }
}

/* Mejoras para autocompletado */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 30px var(--white) inset !important;
    -webkit-text-fill-color: var(--black) !important;
    border-color: var(--primary) !important;
}