﻿:root {
    --primary-color: #1769a8;
    --secondary-color: #0f4f83;
    --error-color: #f44336;
    --bg-transparent: rgba(44, 62, 80, 0.75);
}

/* ----------- RESET ----------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

html, body {
    height: 100%;
    font-family: 'Open Sans',sans-serif;
    position: relative;
}

/* ----------- BACKGROUND ----------- */
body::before {
    content: "";
    position: fixed; /* evita “saltos” al hacer scroll en iOS */
    inset: 0;
    background: url('/img/Fondo.png') no-repeat center;
    background-size: cover;
    opacity: .8;
    z-index: -1;
}

/* ----------- LAYOUT ----------- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem; /* RESPONSIVE: añade respiración en XS */
    animation: slideIn .8s ease-out both;
}

.login-box {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(310px, 1.08fr) minmax(340px, .92fr);
    min-height: 570px;
    background: #fff;
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 20px;
    box-shadow: 0 28px 80px rgba(9, 30, 52, .34), 0 4px 20px rgba(9, 30, 52, .14);
    padding: 0;
    width: 100%;
    max-width: 100px;
    text-align: left;
    transition: transform .25s ease, box-shadow .25s ease;
}

.login-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 34px 90px rgba(9, 30, 52, .38), 0 8px 26px rgba(9, 30, 52, .16);
}

.login-info-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 3rem 3rem 2.8rem;
    color: #fff;
    background: linear-gradient(145deg, rgba(11, 45, 74, .98), rgba(18, 75, 113, .96));
}

.login-info-content,
.login-secure-badge {
    position: relative;
    z-index: 1;
}

.login-eyebrow {
    display: block;
    margin-bottom: 1.4rem;
    color: rgba(255,255,255,.72);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

.login-info-panel h1 {
    margin: 0 0 1rem;
    color: #fff;
    font-size: clamp(3.8rem, 7vw, 4.8rem);
    font-weight: 800;
    letter-spacing: .02em;
    line-height: .95;
}

.login-info-panel p {
    max-width: 330px;
    margin: 0;
    color: rgba(255,255,255,.84);
    font-size: 1.02rem;
    line-height: 1.75;
}

.login-secure-badge {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    align-self: flex-start;
    padding: .78rem 1.05rem;
    color: #f8fbff;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 999px;
    background: rgba(255,255,255,.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.15);
    font-size: .9rem;
    font-weight: 700;
}

.login-secure-badge i {
    color: #a8d8ff;
    font-size: 1.1rem;
}

.login-form-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3.2rem 3rem;
    text-align: center;
    background: linear-gradient(180deg, #fff, #f7fafc);
}

/* ----------- LOGO & TEXT ----------- */
.login-box .logo img {
    max-width: 210px;
    height: auto !important;
    margin-bottom: 2rem;
    border-radius: 14px !important;
    box-shadow: 0 16px 35px rgba(9, 30, 52, .12);
}

.login-box .logo h2 {
    margin: 0 0 .65rem;
    color: #0f2942;
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
}

.login-box .logo p {
    min-height: 1.4rem;
    margin: 0 0 1.65rem;
    color: #64748b;
    font-size: .95rem;
    font-weight: 500;
    letter-spacing: 0
}

/* ----------- FORM ----------- */
.login-box .form-group {
    margin-bottom: 1.25rem;
    position: relative
}

.login-box .form-group .form-control {
    width: 100%;
    min-height: 54px;
    padding: 15px 16px 15px 44px;
    color: #10263f;
    border: 1px solid #d7e4ed;
    border-radius: 14px;
    font-size: .98rem;
    font-weight: 600;
    background: #fbfdff;
    box-shadow: 0 10px 24px rgba(15, 42, 70, .05);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.login-box .form-group .form-control::placeholder {
    color: transparent;
}

.login-box .form-group .form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(23, 105, 168, .14), 0 12px 28px rgba(15, 42, 70, .08);
}

.login-box .form-group label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    color: #5e7084;
    font-size: .94rem;
    font-weight: 700;
    transition: color .2s ease, opacity .2s ease;
    pointer-events: none;
}

.login-box .form-group .form-control:focus + label,
.login-box .form-group .form-control:not(:placeholder-shown) + label {
    color: var(--primary-color);
}

.login-box .form-group .form-control:not(:placeholder-shown) + label {
    opacity: 0;
}

.login-box .form-group label i {
    color: var(--primary-color);
    font-size: 1.05rem;
}

/* ----------- BUTTONS ----------- */
.login-box .btn-success {
    min-height: 54px;
    margin-top: .3rem;
    background: linear-gradient(135deg, #1c74b7, #0f4f83) !important;
    border: 0 !important;
    border-radius: 14px !important;
    box-shadow: 0 16px 28px rgba(15, 79, 131, .26);
    font-weight: 700 !important;
    letter-spacing: .01em;
    width: 100%; /* RESPONSIVE: ocupa toda la fila en XS */
    transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.login-box .btn-success:hover,
.login-box .btn-success:focus {
    box-shadow: 0 18px 32px rgba(15, 79, 131, .34);
    filter: brightness(1.03);
    transform: translateY(-1px);
}

.login-box .btn-success:active {
    transform: translateY(0);
    box-shadow: 0 10px 20px rgba(15, 79, 131, .24);
}

.login-box form > p {
    color: #6b7280;
    font-size: .82rem;
    margin-bottom: 0;
}

/* ----------- LOADER ----------- */
#loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.95);
    transition: opacity .6s ease;
    opacity: 1;
}

#loader-overlay .spinner-border {
    width: 4rem;
    height: 4rem;
    color: var(--primary-color)
}

#loader-overlay p {
    font-weight: 600;
    margin-top: 1.5rem;
    font-size: 1.1rem
}

/* ----------- MODAL ANIMATIONS ----------- */
@keyframes slideIn {
    from {
        transform: translateY(-100px);
        opacity: 0
    }

    to {
        transform: translateY(0);
        opacity: 1
    }
}

@keyframes slideOut {
    to {
        transform: translateY(100px);
        opacity: 0
    }
}

.modal.fade .modal-dialog {
    transform: scale(.8);
    opacity: 0;
    transition: .3s ease-out
}

.modal.show .modal-dialog {
    transform: scale(1);
    opacity: 1
}

/* ----------- BREAKPOINTS ----------- */
/*  ≥576 px (SM) */
@media (min-width:576px) {
    .login-box {
        max-width: 980px
    }
}

/*  ≥768 px (MD – tablets apaisadas) */
@media (min-width:768px) {
    .login-box {
        max-width: 980px;
        padding: 0
    }

    .login-box .logo img {
        max-width: 210px
    }
}

/*  ≥992 px (LG – laptops) */
@media (min-width:992px) {
    .login-box {
        max-width: 980px
    }
}

/*  ≥1200 px (XL – desktops grandes) */
@media (min-width:1200px) {
    .login-box {
        max-width: 980px
    }
}

@media (max-width:767.98px) {
    .login-box {
        display: block;
        max-width: 430px;
        min-height: 0
    }

    .login-info-panel {
        display: none
    }

    .login-form-panel {
        padding: 2.4rem 1.8rem 2rem
    }
}

/* XS <576 px (móviles) —­se coloca al final para ser más específico */
@media (max-width:575.98px) {
    html {
        font-size: 15px
    }
    /* tipografía ligeramente menor */
    .login-box {
        border-radius: 14px;
        padding: 0
    }

    .login-box .logo img {
        max-width: 180px
    }
}
