/* ============================================
   TEMA BIBLIOTECA DIGITAL
   Estilo clásico, elegante y cálido
   ============================================ */

:root {
    --library-brown: #8B4513;
    --library-dark: #3E2723;
    --library-gold: #D4AF37;
    --library-cream: #F5F5DC;
    --library-parchment: #FAF0E6;
    --library-wood: #6D4C41;
    --library-green: #2E7D32;
    --library-red: #8B0000;
    --library-navy: #1A237E;
    --shadow-soft: 0 4px 20px rgba(62, 39, 35, 0.15);
    --shadow-medium: 0 8px 30px rgba(62, 39, 35, 0.2);
    --shadow-heavy: 0 12px 40px rgba(62, 39, 35, 0.3);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Merriweather', Georgia, serif;
    background: linear-gradient(135deg, #2c1810 0%, #4a2c17 50%, #3e2723 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* ============================================
   FONDO ANIMADO DE BIBLIOTECA
   ============================================ */
.auth-page {
    position: relative;
    overflow: hidden;
}

.library-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.library-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(139, 69, 19, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(212, 175, 55, 0.05) 0%, transparent 50%);
}

.floating-books {
    position: absolute;
    width: 100%;
    height: 100%;
}

.book-float {
    position: absolute;
    font-size: 2rem;
    opacity: 0.08;
    animation: float 6s ease-in-out infinite;
}

.book-float:nth-child(1) { top: 10%; left: 10%; animation-delay: 0s; }
.book-float:nth-child(2) { top: 20%; right: 15%; animation-delay: 1s; }
.book-float:nth-child(3) { top: 60%; left: 5%; animation-delay: 2s; }
.book-float:nth-child(4) { bottom: 20%; right: 10%; animation-delay: 3s; }
.book-float:nth-child(5) { top: 40%; left: 85%; animation-delay: 4s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* ============================================
   CONTENEDOR PRINCIPAL
   ============================================ */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
    z-index: 1;
    gap: 40px;
}

.auth-card {
    background: var(--library-parchment);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-heavy);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    position: relative;
    border: 1px solid rgba(139, 69, 19, 0.2);
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--library-brown), var(--library-gold), var(--library-brown));
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.register-card {
    max-width: 480px;
}

/* ============================================
   HEADER DE LA BIBLIOTECA
   ============================================ */
.library-header {
    text-align: center;
    margin-bottom: 30px;
}

.library-icon {
    font-size: 3.5rem;
    margin-bottom: 10px;
    display: block;
}

.library-title {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: var(--library-dark);
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: 1px;
}

.library-subtitle {
    color: var(--library-wood);
    font-size: 0.95rem;
    font-style: italic;
}

/* ============================================
   FORMULARIOS
   ============================================ */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.form-group.half {
    flex: 1;
}

.form-label {
    font-weight: 600;
    color: var(--library-dark);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.label-icon {
    font-size: 1.1rem;
}

.form-input {
    padding: 12px 14px;
    border: 2px solid #d4c5b5;
    border-radius: var(--border-radius);
    font-family: 'Merriweather', serif;
    font-size: 0.95rem;
    background: #fff;
    transition: var(--transition);
    color: #333;
}

.form-input:focus {
    outline: none;
    border-color: var(--library-brown);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.form-input::placeholder {
    color: #aaa;
    font-style: italic;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

/* Password wrapper */
.password-wrapper {
    position: relative;
}

.password-wrapper .form-input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.6;
    transition: var(--transition);
}

.toggle-password:hover {
    opacity: 1;
}

.password-strength {
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
}

/* ============================================
   OPCIONES DEL FORMULARIO
   ============================================ */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--library-wood);
}

.remember-me input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--library-brown);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    background: #fff;
}

.remember-me input:checked + .checkmark {
    background: var(--library-brown);
    border-color: var(--library-brown);
}

.remember-me input:checked + .checkmark::after {
    content: '✓';
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
}

.forgot-link {
    color: var(--library-brown);
    text-decoration: none;
    transition: var(--transition);
}

.forgot-link:hover {
    color: var(--library-gold);
    text-decoration: underline;
}

.terms {
    font-size: 0.85rem;
}

/* ============================================
   BOTONES
   ============================================ */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--library-brown), #6D4C41);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #6D4C41, var(--library-brown));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--library-brown);
    border: 2px solid var(--library-brown);
}

.btn-secondary:hover {
    background: var(--library-brown);
    color: white;
}

.btn-library {
    width: 100%;
    padding: 16px;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.btn-icon {
    font-size: 1.2rem;
}

/* ============================================
   ALERTAS
   ============================================ */
.alert {
    padding: 14px 18px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.alert-error {
    background: #ffebee;
    border-left: 4px solid #c62828;
    color: #c62828;
}

.alert-success {
    background: #e8f5e9;
    border-left: 4px solid #2e7d32;
    color: #2e7d32;
}

.alert .icon {
    font-size: 1.2rem;
}

/* ============================================
   FOOTER DEL AUTH
   ============================================ */
.auth-footer {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(139, 69, 19, 0.15);
    color: var(--library-wood);
    font-size: 0.9rem;
}

.auth-link {
    color: var(--library-brown);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.auth-link:hover {
    color: var(--library-gold);
    text-decoration: underline;
}

.registration-closed {
    color: #c62828;
    font-style: italic;
}

.registration-closed-message {
    text-align: center;
    padding: 30px 20px;
}

.registration-closed-message .closed-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.registration-closed-message h2 {
    font-family: 'Cinzel', serif;
    color: var(--library-dark);
    margin-bottom: 10px;
}

.registration-closed-message p {
    color: var(--library-wood);
    margin-bottom: 10px;
}

/* ============================================
   DECORACIÓN DE ESTANTERÍA
   ============================================ */
.library-decoration {
    display: none;
}

@media (min-width: 1024px) {
    .library-decoration {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 0;
    }
    
    .shelf {
        display: flex;
        gap: 4px;
        padding: 0 10px;
        align-items: flex-end;
    }
    
    .shelf-wood {
        width: 200px;
        height: 8px;
        background: linear-gradient(180deg, #8B6914, #6D4C41);
        border-radius: 0 0 4px 4px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
    
    .book-spine {
        width: 28px;
        border-radius: 3px 3px 0 0;
        box-shadow: inset -2px 0 5px rgba(0,0,0,0.2);
        position: relative;
    }
    
    .book-spine::after {
        content: '';
        position: absolute;
        top: 10%;
        left: 50%;
        transform: translateX(-50%);
        width: 60%;
        height: 2px;
        background: rgba(255,255,255,0.3);
        border-radius: 1px;
    }
    
    .book-spine.red { height: 140px; background: linear-gradient(90deg, #8B0000, #A52A2A); }
    .book-spine.green { height: 155px; background: linear-gradient(90deg, #2E7D32, #388E3C); }
    .book-spine.blue { height: 130px; background: linear-gradient(90deg, #1A237E, #283593); }
    .book-spine.gold { height: 145px; background: linear-gradient(90deg, #B8860B, #D4AF37); }
    .book-spine.brown { height: 150px; background: linear-gradient(90deg, #5D4037, #795548); }
    .book-spine.dark-green { height: 135px; background: linear-gradient(90deg, #1B5E20, #2E7D32); }
    .book-spine.burgundy { height: 160px; background: linear-gradient(90deg, #6D1B1B, #8B0000); }
    .book-spine.navy { height: 142px; background: linear-gradient(90deg, #0D1B3E, #1A237E); }
    .book-spine.tan { height: 148px; background: linear-gradient(90deg, #8B7355, #A0826D); }
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .auth-container {
        padding: 15px;
    }
    
    .auth-card {
        padding: 25px;
    }
    
    .library-title {
        font-size: 1.5rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 18px;
    }
    
    .form-options {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    animation: fadeInUp 0.6s ease-out;
}