/* ===================================
   ESTILOS LOGIN MODERNO - SAMICHAY ZRE
   =================================== */

/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* ===================================
   BACKGROUND
   =================================== */
.background-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

#background {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        rgba(0, 123, 255, 0.8) 0%, 
        rgba(0, 86, 179, 0.9) 100%);
    z-index: -1;
}

/* ===================================
   WRAPPER PRINCIPAL
   =================================== */
.login-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    padding: 1px;
    position: relative;
    z-index: 1;
}

/* ===================================
   HEADER / LOGO
   =================================== */
.login-header {
    text-align: center;
    margin-bottom: 1px;
    animation: fadeInDown 0.8s ease-out;
}

.logo-container {
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.logo-container i {
    font-size: 2.2rem;
    margin-bottom: 5px;
    display: block;
    animation: pulse 2s infinite;
}

.logo-container h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 3px;
    letter-spacing: 1px;
}

.logo-container p {
    font-size: 0.85rem;
    opacity: 0.95;
    font-weight: 300;
}

/* ===================================
   CONTENEDOR DEL FORMULARIO
   =================================== */
.login-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 380px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.login-container.show {
    opacity: 1;
    transform: translateY(0);
}

/* ===================================
   HEADER DEL FORMULARIO
   =================================== */
.form-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    padding: 1px px;
    text-align: center;
}

.form-header h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-header p {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 300;
}

/* ===================================
   CONTENIDO DEL FORMULARIO
   =================================== */
.form-content {
    padding: 1px 20px 30px;
}

/* ===================================
   ALERTAS
   =================================== */
.alert {
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    animation: shake 0.5s;
}

.alert-error {
    background: #fee;
    color: #c33;
    border-left: 4px solid #c33;
}

.alert i {
    font-size: 1rem;
}

/* ===================================
   GRUPOS DE FORMULARIO
   =================================== */
.form-group {
    margin-bottom: 1px;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.form-group label i {
    color: #007bff;
    font-size: 0.95rem;
}

/* ===================================
   INPUTS
   =================================== */
.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: #333;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-group input.filled {
    background: white;
}

.form-group input::placeholder {
    color: #adb5bd;
}

/* ===================================
   PASSWORD WRAPPER
   =================================== */
.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #6c757d;
    transition: color 0.3s;
    z-index: 10;
    pointer-events: all;
}

.toggle-password:hover {
    color: #007bff;
}

/* El input no debe tapar el icono del ojo */
.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
    padding-right: 44px;
}

/* ===================================
   SELECT
   =================================== */
.select-wrapper {
    position: relative;
}

.select-wrapper select {
    width: 100%;
    padding: 12px 36px 12px 14px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #f8f9fa;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.select-wrapper select:focus {
    outline: none;
    border-color: #007bff;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.select-wrapper i {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    pointer-events: none;
    transition: transform 0.3s;
    font-size: 0.85rem;
}

.select-wrapper select:focus + i {
    transform: translateY(-50%) rotate(180deg);
}

/* ===================================
   CAPTCHA
   =================================== */
.captcha-group {
    margin-bottom: 18px;
}

.captcha-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

.captcha-image {
    flex-shrink: 0;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    overflow: hidden;
    background: white;
    padding: 4px;
}

.captcha-image img {
    display: block;
    width: 100px;
    height: auto;
}

.captcha-container input {
    flex: 1;
}

/* ===================================
   OPCIONES DEL FORMULARIO
   =================================== */
.form-options {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 2px;
}

.recovery-link {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #007bff;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s;
}

.recovery-link:hover {
    color: #0056b3;
    gap: 7px;
}

.recovery-link i {
    font-size: 0.85rem;
}

/* ===================================
   BOTÓN DE ENVÍO
   =================================== */
.btn-login {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.5);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login i {
    transition: transform 0.3s;
}

.btn-login:hover i {
    transform: translateX(5px);
}

/* ===================================
   FOOTER
   =================================== */
.login-footer {
    margin-top: 15px;
    text-align: center;
    color: white;
    font-size: 0.8rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease-out 0.3s both;
}

/* ===================================
   ANIMACIONES
   =================================== */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
@media (max-width: 768px) {
    .login-header {
        margin-bottom: 20px;
    }
    
    .logo-container i {
        font-size: 2.5rem;
    }
    
    .logo-container h1 {
        font-size: 1.8rem;
    }
    
    .logo-container p {
        font-size: 0.9rem;
    }
    
    .login-container {
        max-width: 100%;
    }
    
    .form-header {
        padding: 25px 20px;
    }
    
    .form-header h2 {
        font-size: 1.5rem;
    }
    
    .form-content {
        padding: 25px 20px;
    }
    
    .captcha-container {
        flex-direction: column;
        align-items: stretch;
    }
    
    .captcha-image {
        text-align: center;
    }
    
    .captcha-image img {
        margin: 0 auto;
    }
}

@media (max-width: 480px) {
    .login-wrapper {
        padding: 15px;
    }
    
    .logo-container h1 {
        font-size: 1.5rem;
    }
    
    .form-header h2 {
        font-size: 1.3rem;
    }
    
    .form-content {
        padding: 20px 15px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
}

/* ===================================
   MODO OSCURO (opcional)
   =================================== */
@media (prefers-color-scheme: dark) {
    .login-container {
        background: #1a1a1a;
    }
    
    .form-header {
        background: linear-gradient(135deg, #0056b3 0%, #003d82 100%);
    }
    
    .form-group label {
        color: #e1e8ed;
    }
    
    .form-group input[type="text"],
    .form-group input[type="password"],
    .select-wrapper select {
        background: #2a2a2a;
        border-color: #3a3a3a;
        color: #e1e8ed;
    }
    
    .form-group input:focus,
    .select-wrapper select:focus {
        background: #333;
        border-color: #007bff;
    }
}

/* ===================================
   IMPRESIÓN
   =================================== */
@media print {
    .background-wrapper,
    .overlay,
    .login-footer {
        display: none;
    }
}
/* Toggle password: button sin estilos de browser */
button.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #6c757d;
    transition: color 0.3s;
    z-index: 10;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

button.toggle-password:hover {
    color: #007bff;
}

button.toggle-password:focus {
    outline: none;
}