/* ========================================
   Sistema Sindicato - login
   ======================================== */

/* ========================================
   1. VARIABLES Y CONFIGURACIÓN BASE
   ======================================== */
:root {
    /* Colores principales del sistema */
    --primary-color: #1e3a5f;
    --secondary-color: #2c5282;
    --accent-color: #4a90a4;
    --danger-color: #722f37;
    
    /* Grises */
    --gray-100: #f1f5f9;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-700: #334155;
    --gray-800: #1e293b;
    
    /* Otros */
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

/* ========================================
   2. RESET Y BASE
   ======================================== */
* {
    box-sizing: border-box;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

*:focus {
    outline: none;
}

html {
    font-family: sans-serif;
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
    background: linear-gradient(135deg, #e7e7e7 0%, #e5e5e5 50%, #fdfdfd 100% 100%);
    min-height: 100vh;
}

body {
    margin: 0;
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--gray-800);
    height: 100vh;
    background: transparent;
    -webkit-font-smoothing: antialiased;
}

/* ========================================
   3. TIPOGRAFÍA
   ======================================== */
h2 {
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    margin: 40px 8px 10px 8px;
    color: var(--gray-700);
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

a {
    color: var(--accent-color);
    display: inline-block;
    text-decoration: none;
    font-weight: 400;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--secondary-color);
    text-decoration: none;
}

/* ========================================
   4. ESTRUCTURA PRINCIPAL
   ======================================== */
.wrapper {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    min-height: 100%;
    padding: 20px;
}

.btn-close {
    border: 1px solid;
    background-color: transparent;
    border-radius: 6px;
    position: relative;
    display: inherit;
    left: 97%;
    top: -30px;
}

.btn-close:hover {
    border: 1px dashed;
    background-color: var(--gray-400);
    box-shadow: var(--shadow-xl), 0 0 80px rgba(30, 58, 95, 0.3);
}


#formContent {
    border-radius: 10px;
    background: var(--bg-card);
    padding: 0;
    width: 90%;
    max-width: 450px;
    position: relative;
    box-shadow: var(--shadow-xl), 0 0 60px rgba(30, 58, 95, 0.2);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#formContent:hover {
    box-shadow: var(--shadow-xl), 0 0 80px rgba(30, 58, 95, 0.3);
}

/* ========================================
   5. COMPONENTES DEL FORMULARIO
   ======================================== */

/* Logo */
.logo img {
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.1));
    transition: transform 0.3s ease;
    vertical-align: middle;
    border-style: none;
    height: 100px;
    margin-top: 10px;
    margin-bottom: 0px;

}

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

/* Panel y card */
.panel {
    margin-bottom: 20px;
    background-color: transparent;
    border: none;
}

.card-sign {
    background: transparent;
    box-shadow: none;
    border: none;
}

.card-title-sign {
    padding: 5px 30px 10px;
}

.card-body {
    padding: 1.25rem 2rem;
}

/* ========================================
   6. ELEMENTOS DEL FORMULARIO
   ======================================== */
.form-group {
    margin-bottom: 1rem;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--gray-800);
    background-color: #f6f6f6;
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.3s ease;
}

.form-control:focus {
    color: var(--gray-800);
    background-color: var(--bg-card);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 164, 0.25);
}

.form-control::placeholder {
    color: var(--gray-400);
    opacity: 1;
}

.form-control-lg {
    height: calc(1.5em + 1rem + 2px);
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    line-height: 1.5;
    border-radius: 0.3rem;
}

/* Input group */
.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
}

.input-group > .form-control {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
    margin-bottom: 0;
}

.input-group > .form-control:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--gray-500);
    text-align: center;
    white-space: nowrap;
    background-color: #e9ecef;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    transition: all 0.3s ease;
}

.input-group:focus-within .input-group-text {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background-color: var(--bg-card);
}

#togglePassword {
    cursor: pointer;
    transition: all 0.2s ease;
}

#togglePassword:hover {
    background-color: var(--gray-100);
}

/* ========================================
   7. BOTÓN DE SUBMIT
   ======================================== */
.btn {
    display: inline-block;
    font-weight: 500;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.5rem 2rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
    color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 164, 0.25);
}

.btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* ========================================
   8. ALERTAS
   ======================================== */
.alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 8px;
    font-weight: 500;
}

.alert-danger {
    background-color: #fef2f2;
    border-color: #f8d7da;
    color: var(--danger-color);
}

.d-none {
    display: none !important;
}

/* ========================================
   9. LAYOUT UTILITIES
   ======================================== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -15px;
    margin-left: -15px;
}

.col-sm-4, .col-sm-8 {
    position: relative;
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

.text-center {
    text-align: center !important;
}

.text-end {
    text-align: center !important;
}

.text-uppercase {
    text-transform: uppercase !important;
}

.font-weight-bold {
    font-weight: 700 !important;
}

.m-0 {
    margin: 0 !important;
}

.mt-2 {
    margin-top: 0.5rem !important;
}

.mt-3 {
    margin-top: 1rem !important;
}

.mb-3 {
    margin-bottom: 1rem !important;
}

.me-1 {
    margin-right: 0.25rem !important;
}

.position-relative {
    position: relative !important;
}

.top-5 {
    top: 5px !important;
}

/* ========================================
   10. ICONOS BOXICONS
   ======================================== */


/* ========================================
   11. ANIMACIONES MEJORADAS PARA FIREFOX
   ======================================== */

/* Fade In Down */
.fadeInDown {
    animation-name: fadeInDown;
    animation-duration: 1s;
    animation-fill-mode: both;
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes fadeInDown {
    0% {
        opacity: 0;
        transform: translate3d(0, -100%, 0);
    }
    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Fade In secuencial mejorado - Compatible con Firefox */
.fadeIn {
    opacity: 0;
    transform: translateY(20px);
    animation-name: fadeInUp;
    animation-duration: 0.8s;
    animation-fill-mode: forwards;
    animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform;
}

.fadeIn.first {
    animation-delay: 0.2s;
}

.fadeIn.second {
    animation-delay: 0.4s;
}

.fadeIn.third {
    animation-delay: 0.6s;
}

.fadeIn.fourth {
    animation-delay: 0.8s;
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Fallback para navegadores que no soportan will-change */
@supports not (will-change: opacity) {
    .fadeIn {
        backface-visibility: hidden;
        perspective: 1000px;
    }
}

/* Optimización específica para Firefox */
@-moz-document url-prefix() {
    .fadeIn {
        animation-duration: 0.6s;
        animation-timing-function: ease-out;
    }
    
    .fadeIn.first {
        animation-delay: 0.1s;
    }
    
    .fadeIn.second {
        animation-delay: 0.3s;
    }
    
    .fadeIn.third {
        animation-delay: 0.5s;
    }
    
    .fadeIn.fourth {
        animation-delay: 0.7s;
    }
}

/* Shake para errores */
.shake {
    animation: shake 0.3s;
    animation-iteration-count: 1;
    animation-timing-function: ease-in-out;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    50% { transform: translateX(10px); }
    75% { transform: translateX(-10px); }
    100% { transform: translateX(0); }
}

/* ========================================
   12. RESPONSIVE
   ======================================== */

/* Columnas para desktop */
@media (min-width: 576px) {
    .col-sm-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
    
    .col-sm-8 {
        flex: 0 0 66.666667%;
        max-width: 66.666667%;
    }
}

/* Tablets y pantallas medianas */
@media (max-width: 768px) and (min-width: 577px) {
    body {
        font-size: 14px;
    }
    
    #formContent {
        width: 90%;
        max-width: 500px;
    }
    
    .card-body {
        padding: 1.5rem 1.5rem;
    }
    
    h2 {
        font-size: 15px;
    }
    
    .btn-primary {
        width: 100%;
        padding: 0.75rem;
    }
}

/* Móviles - quita todas las restricciones de ancho */
@media (max-width: 576px) {
    .wrapper {
        padding: 10px;
        min-height: 100vh;
    }
    
    #formContent {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
        border: none;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    #formContent:hover {
        transform: none;
        box-shadow: none;
    }
    
    .card-body {
        padding: 1.5rem 1.25rem;
    }
    
    h2 {
        font-size: 16px;
        margin: 30px 10px 15px 10px;
    }
    
    .logo img {
        height: 150px;
        margin-bottom: 0px;
    }
    
    .text-6 {
        font-size: 1.5em !important;
    }
    
    .form-control-lg {
        font-size: 16px;
        padding: 0.75rem 1rem;
        height: 50px;
    }
    
    .input-group-text {
        padding: 0.75rem 1rem;
    }
    
    .btn-primary {
        padding: 1rem;
        font-size: 16px;
        width: 100%;
    }
    
    .form-group {
        margin-bottom: 1.5rem;
    }
}

/* Móviles pequeños con algo de padding */
@media (max-width: 380px) {
    .wrapper {
        padding: 0;
    }
    
    .card-body {
        padding: 1.25rem 1rem;
    }
}

/* Orientación horizontal */
@media (orientation: landscape) and (max-height: 600px) {
    #formContent {
        min-height: auto;
        width: 90%;
        max-width: 450px;
        border-radius: 10px;
        box-shadow: var(--shadow-xl);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .wrapper {
        padding: 10px;
    }
    
    h2 {
        margin: 20px 5px 10px 5px;
    }
    
    .logo img {
        height: 100px;
        margin-bottom: 0px;
        margin-top: 10px;
    }
    
    .form-group {
        margin-bottom: 0.75rem;
    }
    
    .form-control-lg {
        height: 40px;
        padding: 0.5rem 0.8rem;
    }
    
    .btn-primary {
        padding: 0.6rem;
    }
}

/* ========================================
   13. COMPATIBILIDAD Y MEJORAS FINALES
   ======================================== */

/* Prevenir zoom en iOS */
@media (max-width: 768px) {
    input[type="text"],
    input[type="password"],
    .form-control {
        font-size: 16px;
    }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .fadeIn {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* Copyright text */
.text-center.mt-3.mb-3 {
    color: var(--gray-500);
    font-size: 0.875rem;
}



