/* General Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Arial', sans-serif;
    height: 100vh;
    background: linear-gradient(-45deg, #eaf4fc, #0353a1, #002855, #013e7d);
    background-size: 400% 400%;
    animation: gradientBG 6s ease infinite;
    color: #002855;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.login-container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 38px;
    padding-bottom: 38px;
    box-sizing: border-box;
}

.login-form.register-form {
    border-radius: 32px;
    max-width: 740px;
    min-width: 400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    box-shadow: none;
}

/* Cards de registro */
.registro-card {
    background: #f7fbff;
    border-radius: 26px;
    box-shadow: 0 4px 18px #3078c224;
    padding: 38px 36px 32px 36px;
    display: flex;
    flex-direction: column;
    gap: 13px;
    width: 100%;
    min-width: 0;
    margin-bottom: 28px;
    text-align: center;
    align-items: center;
}

.registro-card h3 {
    color: #0353a1;
    font-size: 1.15rem;
    margin-bottom: 13px;
    font-weight: 700;
    letter-spacing: 1px;
}

.logo {
    width: 250px;
    /* o 300px, o el tamaño que quieras */
    max-width: 100%;
    margin-bottom: 40px;
    display: block;
}

h2 {
    margin-bottom: 22px;
    margin-top: 0;
    font-size: 1rem;
    color: #7e8294;
    font-weight: 400;
    letter-spacing: 0.5px;
}

h1 {
    margin-bottom: 6px;
    font-size: 1.6rem;
    font-weight: 400;
    color: #013e7d;
    letter-spacing: 0.5px;
}


.input-group {
    position: relative;
    width: 100%;
    margin-bottom: 22px;
}

.input-group input {
    width: 100%;
    padding: 14px 44px 14px 40px;
    border: 1.5px solid #dde5ec;
    border-radius: 30px;
    font-size: 1rem;
    background: #f8fafc;
    color: #002855;
    transition: border-color 0.25s, box-shadow 0.25s;
    box-shadow: 0 1.5px 5px rgba(33, 52, 123, 0.03);
}

.input-group input:focus {
    border-color: #3078c2;
    box-shadow: 0 0 0 2px #0353a132;
    outline: none;
}

/* Íconos de la izquierda */
.input-group i.fa-envelope,
.input-group i.fa-lock,
.input-group i.fa-user,
.input-group i.fa-building,
.input-group i.fa-briefcase,
.input-group i.fa-id-badge,
.input-group i.fa-user-tag,
.input-group i.fa-phone,
.input-group i.fa-mobile-screen {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #0353a1;
    font-size: 1.13em;
    z-index: 2;
    pointer-events: none;
}

/* Contraseñas: padding y el ojo */
.input-group input[type="password"] {
    padding-left: 38px;
    padding-right: 38px;
}

.toggle-password {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #0353a1;
    font-size: 1.22em;
    z-index: 3;
    background: transparent;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    padding: 0;
    line-height: 1;
    user-select: auto;
    transition: color 0.15s;
}

.toggle-password:hover,
.toggle-password:focus {
    color: #013e7d;
}

/* Input de email */
.input-group input[type="email"] {
    padding-left: 38px;
}

/* Red para los mensajes de error */
#telefono-error,
#password-error {
    color: #c21c1c;
    font-size: .97em;
    margin-bottom: 10px;
    display: none;
    text-align: left;
    width: 100%;
}

/* Grids para campos dobles */
.registro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 34px;
    width: 100%;
    margin-bottom: 0;
}

.registro-grid>div {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* El campo contraseña ocupa todo el ancho debajo */
.input-full {
    margin-top: 20px;
    width: 100%;
}

/* Responsive: una sola columna en móvil */
@media (max-width: 80%) {
    .login-form.register-form {
        max-width: 98vw;
        min-width: 0;
    }

    .logo {
        width: 250px;
    }

    .registro-card {
        padding: 18px 2vw 12px 2vw;
    }

    .registro-grid {
        grid-template-columns: 1fr;
        gap: 14px 0;
    }
}

hr {
    background-color: rgb(62, 84, 183);
    width: 95%;
    height: 0.5px;
    border: none;
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(90deg, #0353a1 0%, #3078c2 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 1.09rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
    box-shadow: 0 1.5px 4px rgba(33, 52, 123, 0.09);
    transition: background 0.3s, transform 0.2s;
    position: relative;
}

.btn-login:hover {
    background: linear-gradient(90deg, #013e7d 0%, #3078c2 100%);
    transform: translateY(-2px) scale(1.025);
}

.btn-login .spinner {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    border: 3px solid white;
    border-radius: 50%;
    border-top: 3px solid #0353a1;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    display: none;
}

.btn-login.loading .spinner {
    display: block;
}

@keyframes spin {
    0% {
        transform: translateY(-50%) rotate(0deg);
    }

    100% {
        transform: translateY(-50%) rotate(360deg);
    }
}

/* Bloque: Redes sociales */
.social-login {
    margin-top: 18px;
    text-align: center;
    width: 100%;
}

.social-login p {
    font-size: 0.97rem;
    color: #002855;
    margin-bottom: 8px;
    font-weight: 600;
    letter-spacing: 0.4px;
}

.social-login a {
    margin: 0 9px;
    color: #0353a1;
    font-size: 1.45rem;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.23s, color 0.23s;
    border-radius: 50%;
    padding: 4px;
}

.social-login a:hover {
    transform: scale(1.18) rotate(8deg);
    color: #fff;
    background: linear-gradient(90deg, #3078c2 0%, #0353a1 100%);
    box-shadow: 0 3px 14px #3078c225;
}

/* Registro */
.register-link {
    margin-top: 22px;
    width: 100%;
    text-align: center;
    font-size: 1rem;
}

.register-link a {
    color: #0353a1;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
}

.register-link a:hover {
    color: #013e7d;
}

.register-link a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0%;
    height: 2px;
    background: #013e7d;
    transition: width 0.3s ease;
}

.register-link a:hover::after {
    width: 100%;
}

/* SOLO los íconos de la izquierda tienen pointer-events: none */
.input-group i:not(.fa-eye):not(.fa-eye-slash) {
    pointer-events: none;
}

/* Para el padding-bottom extra en alertas SweetAlert */
.swal2-popup {
    border-radius: 25px !important;
}

.btn-persona {
    border: 1.5px solid #dde5ec;
    color: #757575;
    background-color: white;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
    height: 54px;

    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.btn-persona:hover {
    border-color: #3078c2 !important;
    color: #0353a1 !important;
}

.btn-check:checked+.btn-persona {
    background: linear-gradient(90deg, #0353a1 0%, #3078c2 100%);
    color: #fff;
    border-color: #0353a1;
    font-weight: 500;
    box-shadow: 0 0 0 0.15rem rgba(13, 110, 253, 0.25);
}

.icon-left,
.icon-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    color: inherit;
    color: #0353a1 !important;
}

.icon-left {
    left: 1rem;
}

.icon-right {
    right: 1rem;
}

.btn-check:checked+.btn-persona:hover {
    color: white !important;
}

/* ----  */
.btn-check:checked + label .icon-left,
.btn-check:checked + label .icon-right {
    color: white !important;
    transition: all 0.3s ease;
}

.fade-in {
    animation: fadein 0.6s ease;
}
@keyframes fadein {
    from { opacity: 0; transform: translateY(18px);}
    to { opacity: 1; transform: none;}
}
