:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;

    --text-dark: #0f172a;
    --text-medium: #334155;
    --text-muted: #64748b;

    --border-color: #dbe3ef;
    --background: #f8fbff;
    --white: #ffffff;

    --shadow-card: 0 30px 80px rgba(15, 23, 42, 0.10);
    --shadow-button: 0 18px 35px rgba(37, 99, 235, 0.28);
}

* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--background);
    color: var(--text-dark);
}

/* =========================================================
   Contenedor principal
   ========================================================= */

.login-wrapper {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 32px 16px;

    background:
        radial-gradient(circle at 95% 5%, rgba(37, 99, 235, 0.13), transparent 28%),
        radial-gradient(circle at 5% 85%, rgba(20, 184, 166, 0.10), transparent 24%),
        linear-gradient(135deg, #f8fbff 0%, #ffffff 48%, #f1f7ff 100%);
}

/* =========================================================
   Figuras decorativas de fondo
   ========================================================= */

.background-shape {
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
    filter: blur(2px);
}

.shape-one {
    width: 340px;
    height: 340px;
    top: -120px;
    right: -90px;
    background: rgba(37, 99, 235, 0.08);
}

.shape-two {
    width: 280px;
    height: 280px;
    bottom: -100px;
    left: -90px;
    background: rgba(20, 184, 166, 0.08);
}

.shape-three {
    width: 180px;
    height: 180px;
    top: 18%;
    left: 18%;
    background: rgba(99, 102, 241, 0.05);
}

/* =========================================================
   Tarjeta de login
   ========================================================= */

.login-card {
    width: 100%;
    max-width: 520px;
    position: relative;
    z-index: 2;

    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(18px);

    border: 1px solid rgba(219, 227, 239, 0.9);
    border-radius: 28px;

    box-shadow: var(--shadow-card);

    padding: 46px 46px 38px;

    animation: cardFadeIn 0.55s ease both;
}

@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* =========================================================
   Encabezado
   ========================================================= */

.login-header {
    margin-bottom: 34px;
}

.login-icon {
    width: 76px;
    height: 76px;
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: linear-gradient(180deg, #eff6ff, #dbeafe);
    border: 1px solid #cfe0ff;

    color: var(--primary-color);
    font-size: 34px;
}

.login-header h1 {
    margin: 0 0 12px;

    font-size: 34px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -1.2px;

    color: var(--text-dark);
}

.login-header p {
    margin: 0;

    color: var(--text-muted);
    font-size: 16px;
    font-weight: 500;
}

/* =========================================================
   Formulario
   ========================================================= */

.form-label {
    color: #1e293b;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 9px;
}

.input-custom {
    width: 100%;
    min-height: 62px;

    border-radius: 16px;
    border: 1px solid var(--border-color);

    background-color: #ffffff;
    color: var(--text-dark);

    font-size: 16px;
    font-weight: 500;

    padding: 16px 18px;

    transition: all 0.22s ease;
}

.input-custom::placeholder {
    color: #94a3b8;
    font-weight: 500;
}

.input-custom:hover {
    border-color: #c7d2fe;
}

.input-custom:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* =========================================================
   Password con ojito
   ========================================================= */

.password-wrapper {
    position: relative;
}

.password-wrapper .input-custom {
    padding-right: 58px;
}

.btn-password-toggle {
    position: absolute;
    top: 50%;
    right: 16px;

    transform: translateY(-50%);

    width: 36px;
    height: 36px;

    border: 0;
    outline: none;
    background: transparent;

    color: #94a3b8;
    font-size: 22px;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    transition: color 0.2s ease, transform 0.2s ease;
}

.btn-password-toggle:hover {
    color: var(--primary-color);
}

.btn-password-toggle:active {
    transform: translateY(-50%) scale(0.94);
}

/* =========================================================
   Opciones
   ========================================================= */

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.form-check-label {
    color: var(--text-medium);
    font-size: 15px;
    font-weight: 500;
}

.form-check-input {
    border-color: var(--border-color);
    cursor: pointer;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.forgot-link {
    color: var(--primary-color);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.forgot-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* =========================================================
   Botón principal
   ========================================================= */

.btn-login {
    width: 100%;
    min-height: 64px;

    border: 0;
    border-radius: 17px;

    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #ffffff;

    font-size: 17px;
    font-weight: 800;

    box-shadow: var(--shadow-button);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease,
        opacity 0.2s ease;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 45px rgba(37, 99, 235, 0.34);
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
}

/* =========================================================
   Footer
   ========================================================= */

.login-footer {
    margin-top: 34px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

/* =========================================================
   Alertas y validaciones
   ========================================================= */

.alert {
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    padding: 14px 16px;
    margin-bottom: 22px;
}

.form-control.is-invalid {
    background-image: none;
}

.invalid-feedback {
    font-size: 13px;
    font-weight: 600;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 992px) {
    .login-card {
        max-width: 500px;
    }
}

@media (max-width: 768px) {
    .login-wrapper {
        padding: 24px 16px;
    }

    .login-card {
        max-width: 460px;
        padding: 38px 30px 32px;
    }

    .login-header h1 {
        font-size: 31px;
    }

    .login-header p {
        font-size: 16px;
    }
}

@media (max-width: 576px) {
    .login-wrapper {
        padding: 22px 14px;
        align-items: center;
    }

    .login-card {
        max-width: 100%;
        padding: 34px 24px 30px;
        border-radius: 24px;
    }

    .login-icon {
        width: 66px;
        height: 66px;
        font-size: 30px;
        margin-bottom: 20px;
    }

    .login-header {
        margin-bottom: 28px;
    }

    .login-header h1 {
        font-size: 29px;
    }

    .login-header p {
        font-size: 15px;
    }

    .input-custom {
        min-height: 58px;
        border-radius: 14px;
        font-size: 15px;
    }

    .btn-login {
        min-height: 60px;
        border-radius: 15px;
    }

    .login-footer {
        margin-top: 30px;
    }
}

@media (max-width: 430px) {
    .login-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .forgot-link {
        white-space: normal;
    }
}

@media (max-width: 360px) {
    .login-card {
        padding: 26px 18px 24px;
        border-radius: 20px;
    }

    .login-header h1 {
        font-size: 24px;
    }

    .login-header p {
        font-size: 14px;
    }

    .form-label {
        font-size: 14px;
    }

    .forgot-link {
        font-size: 14px;
    }

    .input-custom {
        min-height: 54px;
    }

    .btn-login {
        min-height: 56px;
        font-size: 15px;
    }
}

/* Celular horizontal o pantallas con poca altura */
@media (max-height: 680px) and (orientation: landscape) {
    .login-wrapper {
        align-items: flex-start;
        padding-top: 24px;
        padding-bottom: 24px;
        overflow-y: auto;
    }

    .login-card {
        padding-top: 28px;
        padding-bottom: 26px;
    }

    .login-icon {
        width: 58px;
        height: 58px;
        font-size: 26px;
        margin-bottom: 14px;
    }

    .login-header {
        margin-bottom: 22px;
    }

    .login-header h1 {
        font-size: 26px;
        margin-bottom: 8px;
    }

    .login-footer {
        margin-top: 24px;
    }
}

/* =========================================================
   Logo / Marca
   ========================================================= */

.login-brand {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 22px;
}

.login-logo {
    max-width: 170px;
    max-height: 90px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.login-icon-fallback {
    display: none;
}

@media (max-width: 576px) {
    .login-logo {
        max-width: 145px;
        max-height: 78px;
    }
}

@media (max-width: 360px) {
    .login-logo {
        max-width: 125px;
        max-height: 68px;
    }
}