/* Estilos generales */
body {
    background: linear-gradient(135deg, #2c3e50 0%, #1a2530 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #2c3e50;
    margin: 0;
    padding: 15px;
}

/* Contenedor principal */
.nk-auth-body {
    max-width: 460px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

/* Tarjeta del formulario */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.card-inner {
    padding: 2.5rem;
}

/* Encabezado */
.nk-block-head {
    text-align: center;
    margin-bottom: 2rem;
}

.nk-block-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.nk-block-des p {
    color: #7f8c8d;
    font-size: 0.95rem;
}

/* Formulario */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
    color: #2c3e50;
}

.form-control {
    height: 48px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

/* Select personalizado */
.select2-container--default .select2-selection--single {
    height: 48px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0;
    display: flex;
    align-items: center;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    width: 100%;
    padding: 0 1rem;
    line-height: 48px;
    color: #2c3e50;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 46px;
    right: 10px;
}

/* Asegurar que el select2 tome el ancho completo */
.select2-container {
    width: 100% !important;
}

/* Ajustar el dropdown */
.select2-dropdown {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.select2-results__option {
    padding: 8px 16px;
}

.select2-results__option--highlighted {
    background-color: #f8f9fa;
    color: #2c3e50;
}

/* Botón de registro */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    width: 100%;
    height: 48px;
    font-size: 0.95rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

/* Checkbox personalizado */
.custom-checkbox {
    padding-left: 1.5rem;
}

.custom-control-input:checked ~ .custom-control-label::before {
    background-color: #667eea;
    border-color: #667eea;
}

.custom-control-label {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.custom-control-label a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.custom-control-label a:hover {
    text-decoration: underline;
}

/* Enlace de inicio de sesión */
.form-note-s2 {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.form-note-s2 a {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
}

.form-note-s2 a:hover {
    text-decoration: underline;
}

/* Footer */
.nk-footer {
    margin-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

.nk-footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.nk-footer a:hover {
    color: white;
    text-decoration: underline;
}

.nav-link {
    padding: 0.5rem 1rem;
}

/* Logo */
.brand-logo {
    margin-bottom: 0.5rem;
    padding-top: 1rem;
}

.brand-logo img {
    max-height: 60px;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.brand-logo img:hover {
    transform: scale(1.05);
}

/* Efectos de carga y hover */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    animation: fadeIn 0.6s ease-out forwards;
}

/* Responsive */
@media (max-width: 575.98px) {
    .card-inner {
        padding: 1.5rem;
    }
    
    .nk-block-title {
        font-size: 1.5rem;
    }
    
    .form-control {
        height: 44px;
    }
}

/* Efecto de foco en los campos */
.form-control-wrap {
    position: relative;
}

.form-control-wrap:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: #667eea;
    transition: width 0.3s ease;
}

.form-control:focus + .form-control-wrap:after {
    width: 100%;
}

/* Mejoras en el selector de visibilidad de contraseña */
.passcode-switch {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    cursor: pointer;
    z-index: 2;
}

.passcode-switch:hover {
    color: #667eea;
}

/* Mensajes de error */
.invalid-feedback {
    font-size: 0.8rem;
    color: #e74c3c;
    margin-top: 0.25rem;
    display: block;
}

/* Efecto de carga en el botón */
.btn-loading {
    position: relative;
    pointer-events: none;
    color: transparent !important;
}

.btn-loading:after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-right-color: transparent;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}