:root {
    --primary-color: #a0244c;
    --primary-hover: #8a1f41;
    --text-light: #f8f9fa;
    --text-dark: #212529;
    --border-radius: 12px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #fce9e9, #faeaea 50%, #ffffff 90%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Contenedor principal */
.login-container {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 1rem;
}

.login-card {
    border-radius: var(--border-radius);
    overflow: hidden;
    border: none;
    box-shadow: var(--box-shadow);
    width: 100%;
}

/* Estructura responsive */
.row.justify-content-center {
    width: 100%;
    margin: 0;
}

.col-lg-8, .col-md-10, .col-12 {
    padding: 0;
}

/* Sección de imagen/QR */
.login-image-container {
    position: relative;
    min-height: 300px;
    background-color: var(--primary-color);
    background-image: linear-gradient(to bottom right, #6d1f37, #8a2a4a);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.qr-reader-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 10;
    display: flex;
    flex-direction: column;
}

.qr-reader-container.active {
    transform: translateX(0);
}

/* Sección de formulario */
.card-body {
    padding: 2.5rem;
}

.card-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: clamp(1.25rem, 3vw, 1.5rem);
}

.form-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-control {
    border: 1px solid #e0e0e0;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(160, 36, 76, 0.25);
}

/* Password container mejorado */
.password-container {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--primary-color);
    z-index: 5;
    padding: 0.5rem;
}

/* Botones */
.btn {
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    padding: 0.75rem;
    font-size: 1rem;
}

.btn-primary-custom {
    background-color: var(--primary-color);
    border: none;
    color: white !important;
}

.btn-primary-custom:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-outline-primary-custom {
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    background: transparent;
}

.btn-outline-primary-custom:hover {
    background-color: var(--primary-color);
    color: white;
}

/* QR Reader */
#qr-reader {
    width: 100%;
    height: 250px;
    margin: 0 auto;
}

.pin-container {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Secciones de PIN */
#first-time-section,
#regular-section,
#reset-section {
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

/* Alertas */
.alert {
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

/* Responsive Design */
@media (max-width: 991.98px) {
    .login-card {
        max-width: 700px;
        margin: 0 auto;
    }
    
    .login-image-container {
        min-height: 250px;
    }
}

@media (max-width: 767.98px) {
    .card-body {
        padding: 1.5rem !important;
    }
    
    .login-card {
        border-radius: var(--border-radius);
    }
    
    .col-md-6 {
        width: 100%;
    }
    
    .login-image-container {
        min-height: 200px;
        order: -1;
    }
    
    #qr-reader {
        height: 200px;
    }
    
    .pin-container {
        padding: 1rem;
    }
}

@media (max-width: 575.98px) {
    .card-body {
        padding: 1.25rem !important;
    }
    
    .btn {
        padding: 0.65rem;
        font-size: 0.9rem;
    }
    
    .form-control {
        padding: 0.65rem 0.9rem;
        font-size: 0.9rem;
    }
    
    #qr-reader {
        height: 180px;
    }
}