:root {
    --sw-navy-950: #061426;
    --sw-navy-900: #0a192f;
    --sw-navy-850: #0d223c;
    --sw-navy-800: #102a46;
    --sw-blue-600: #0078e8;
    --sw-blue-500: #0084ff;
    --sw-blue-400: #21a0ff;
    --sw-cyan-400: #2bd9ff;

    --sw-surface: #ffffff;
    --sw-text: #102033;
    --sw-muted: #66788d;
    --sw-border: #dce6ef;

    --sw-radius-sm: 12px;
    --sw-radius-md: 18px;
    --sw-radius-lg: 28px;

    --sw-shadow:
        0 28px 70px rgba(7, 27, 50, 0.2);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Poppins', sans-serif;
    color: var(--sw-text);
    background:
        radial-gradient(circle at 12% 12%,
            rgba(0, 132, 255, 0.13),
            transparent 32%),
        radial-gradient(circle at 88% 85%,
            rgba(43, 217, 255, 0.1),
            transparent 30%),
        var(--sw-navy-950);
}

button,
input {
    font: inherit;
}

/* =========================================================
   ESTRUCTURA GENERAL
   ========================================================= */

.login-shell {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(360px, 0.95fr) minmax(480px, 1.05fr);
}

/* =========================================================
   PANEL DE MARCA
   ========================================================= */

.login-brand-panel {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: clamp(48px, 7vw, 100px);
    color: #ffffff;
    background:
        linear-gradient(145deg,
            var(--sw-navy-950) 0%,
            var(--sw-navy-900) 48%,
            #063864 100%);
}

.login-brand-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg,
            rgba(255, 255, 255, 0.035) 0,
            transparent 45%);
    pointer-events: none;
}

.login-info a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    transition: color .2s ease, border-color .2s ease;
    border-bottom: 1px solid transparent;
}

.login-info a:hover {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.login-info a:focus-visible {
    outline: none;
    border-bottom-color: #2563eb;
}

.brand-panel-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 620px;
}

.brand-logo {
    display: block;
    width: auto;
    height: auto;
}

.brand-logo-desktop {
    max-width: 250px;
    margin-bottom: 70px;
    border-radius: 15px;
}

.brand-copy {
    max-width: 540px;
}

.brand-eyebrow,
.login-kicker {
    display: inline-block;
    color: var(--sw-cyan-400);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.brand-copy h1 {
    margin: 18px 0 20px;
    max-width: 540px;
    font-size: clamp(2.45rem, 4.6vw, 4.6rem);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.brand-copy p {
    max-width: 510px;
    margin: 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 1rem;
    line-height: 1.8;
}

.brand-features {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 48px;
}

.brand-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 15px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.86);
    background: rgba(255, 255, 255, 0.055);
    backdrop-filter: blur(8px);
    font-size: 0.78rem;
}

.brand-feature i {
    color: var(--sw-cyan-400);
    font-size: 1rem;
}

.brand-decoration {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.brand-decoration-one {
    right: -170px;
    bottom: -190px;
    width: 480px;
    height: 480px;
    border: 1px solid rgba(43, 217, 255, 0.14);
}

.brand-decoration-two {
    right: -70px;
    bottom: -95px;
    width: 290px;
    height: 290px;
    background: rgba(0, 132, 255, 0.11);
    filter: blur(1px);
}

/* =========================================================
   PANEL DEL FORMULARIO
   ========================================================= */

.login-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: clamp(28px, 6vw, 80px);
    background:
        radial-gradient(circle at 85% 15%,
            rgba(33, 160, 255, 0.14),
            transparent 34%),
        linear-gradient(145deg,
            #07172a 0%,
            #0a1f38 52%,
            #0d2f52 100%);
}

.login-card {
    width: 100%;
    max-width: 500px;
    padding: clamp(34px, 5vw, 54px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--sw-radius-lg);
    background: rgba(10, 25, 47, 0.84);
    box-shadow: var(--sw-shadow);
    backdrop-filter: blur(18px);
}

.login-header {
    margin-bottom: 38px;
}

.brand-logo-mobile {
    display: none;
    max-width: 205px;
    margin: 0 auto 30px;
    border-radius: 15px;
}

.login-header h2 {
    margin: 11px 0 8px;
    color: #ffffff;
    font-size: clamp(1.9rem, 3vw, 2.45rem);
    font-weight: 700;
    letter-spacing: -0.035em;
}

.login-header p {
    margin: 0;
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.94rem;
    line-height: 1.7;
}

/* =========================================================
   CAMPOS
   ========================================================= */

.form-label {
    margin-bottom: 9px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.82rem;
    font-weight: 600;
}

.sw-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.sw-input-icon {
    position: absolute;
    left: 17px;
    z-index: 2;
    display: flex;
    align-items: center;
    color: #8394a6;
    pointer-events: none;
}

.sw-input-group .form-control {
    width: 100%;
    min-height: 54px;
    padding: 13px 50px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--sw-radius-sm) !important;
    color: var(--sw-text);
    background: rgba(255, 255, 255, 0.97);
    font-size: 0.92rem;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease;
}

.sw-input-group .form-control::placeholder {
    color: #a0adba;
}

.sw-input-group .form-control:hover {
    border-color: rgba(33, 160, 255, 0.42);
    background: #ffffff;
}

.sw-input-group .form-control:focus {
    border-color: var(--sw-blue-400);
    outline: 0;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(33, 160, 255, 0.16);
}

.password-toggle {
    position: absolute;
    right: 9px;
    z-index: 2;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 0;
    border-radius: 10px;
    color: #718397;
    background: transparent;
    cursor: pointer;
    transition:
        color 0.2s ease,
        background-color 0.2s ease;
}

.password-toggle:hover {
    color: var(--sw-blue-500);
    background: rgba(0, 132, 255, 0.08);
}

/* =========================================================
   BOTÓN PRINCIPAL
   ========================================================= */

.btn-sw-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 54px;
    margin-top: 7px;
    padding: 13px 20px;
    border: 0;
    border-radius: var(--sw-radius-sm);
    color: #ffffff;
    background:
        linear-gradient(135deg,
            var(--sw-blue-500) 0%,
            var(--sw-cyan-400) 100%);
    box-shadow: 0 14px 28px rgba(0, 112, 224, 0.26);
    font-size: 0.94rem;
    font-weight: 600;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.btn-sw-primary:hover,
.btn-sw-primary:focus {
    color: #ffffff;
    filter: brightness(1.05);
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(0, 112, 224, 0.34);
}

.btn-sw-primary:active {
    transform: translateY(0);
}

/* =========================================================
   INSTALACIÓN PWA
   ========================================================= */

.install-container {
    margin-top: 30px;
}

.install-container[hidden] {
    display: none !important;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 18px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.12);
}

.btn-install-app {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    min-height: 66px;
    padding: 11px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 15px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    text-align: left;
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        transform 0.2s ease;
}

.btn-install-app:hover,
.btn-install-app:focus {
    border-color: rgba(43, 217, 255, 0.38);
    color: #ffffff;
    background: rgba(0, 132, 255, 0.13);
    transform: translateY(-1px);
}

.install-icon {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 12px;
    color: var(--sw-cyan-400);
    background: rgba(0, 132, 255, 0.12);
    font-size: 1.15rem;
}

.install-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.install-copy strong {
    font-size: 0.85rem;
    font-weight: 600;
}

.install-copy small {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.7rem;
}

.install-arrow {
    color: var(--sw-cyan-400);
}

.ios-install-help {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 15px;
    border: 1px solid rgba(43, 217, 255, 0.22);
    border-radius: 15px;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(0, 132, 255, 0.09);
}

.ios-install-help>i {
    margin-top: 1px;
    color: var(--sw-cyan-400);
    font-size: 1.15rem;
}

.ios-install-help p {
    margin: 0;
    font-size: 0.76rem;
    line-height: 1.65;
}

/* =========================================================
   PIE
   ========================================================= */

.login-footer {
    margin-top: 38px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.11);
    text-align: center;
}

.login-footer p {
    margin: 0 0 11px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.76rem;
    line-height: 1.6;
}

.login-footer a {
    color: var(--sw-cyan-400);
    font-weight: 600;
    text-decoration: none;
}

.login-footer a:hover {
    text-decoration: underline;
}

.login-footer>span {
    color: rgba(255, 255, 255, 0.38);
    font-size: 0.68rem;
}

/* =========================================================
   TABLET HORIZONTAL / LAPTOP PEQUEÑA
   ========================================================= */

@media (max-width: 1199.98px) {
    .login-shell {
        grid-template-columns: minmax(330px, 0.85fr) minmax(440px, 1.15fr);
    }

    .login-brand-panel {
        padding: 56px;
    }

    .brand-logo-desktop {
        max-width: 220px;
        margin-bottom: 52px;
    }

    .brand-copy h1 {
        font-size: clamp(2.4rem, 4vw, 3.4rem);
    }

    .login-form-panel {
        padding: 42px;
    }

    .login-card {
        padding: 42px;
    }
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 991.98px) {
    .login-shell {
        grid-template-columns: minmax(280px, 0.72fr) minmax(420px, 1.28fr);
    }

    .login-brand-panel {
        padding: 42px 36px;
    }

    .brand-logo-desktop {
        max-width: 195px;
        margin-bottom: 44px;
    }

    .brand-copy h1 {
        margin-top: 15px;
        font-size: 2.55rem;
    }

    .brand-copy p {
        font-size: 0.9rem;
        line-height: 1.7;
    }

    .brand-features {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        margin-top: 36px;
    }

    .brand-feature {
        width: fit-content;
    }

    .login-form-panel {
        padding: 32px;
    }

    .login-card {
        max-width: 470px;
        padding: 36px 32px;
    }
}

/* =========================================================
   TABLET VERTICAL
   ========================================================= */

@media (max-width: 850px) {
    .login-shell {
        display: block;
        min-height: 100vh;
    }

    .login-brand-panel {
        display: none;
    }

    .login-form-panel {
        min-height: 100vh;
        padding:
            max(38px, env(safe-area-inset-top)) 32px max(32px, env(safe-area-inset-bottom));
        background:
            radial-gradient(circle at 80% 10%,
                rgba(33, 160, 255, 0.17),
                transparent 32%),
            linear-gradient(160deg,
                #061426 0%,
                #0a192f 48%,
                #0d3155 100%);
    }

    .login-card {
        display: flex;
        min-height: calc(100vh - max(38px, env(safe-area-inset-top)) - max(32px, env(safe-area-inset-bottom)));
        max-width: 560px;
        margin: 0 auto;
        flex-direction: column;
        padding: 32px;
        border-color: rgba(255, 255, 255, 0.1);
        background: rgba(8, 27, 49, 0.66);
        box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
    }

    .brand-logo-mobile {
        display: block;
    }

    .login-header {
        text-align: center;
    }

    .login-header p {
        max-width: 410px;
        margin-right: auto;
        margin-left: auto;
    }

    .login-footer {
        margin-top: auto;
    }
}

/* =========================================================
   MÓVIL
   ========================================================= */

@media (max-width: 767.98px) {
    body {
        background:
            radial-gradient(circle at 80% 10%,
                rgba(33, 160, 255, 0.18),
                transparent 32%),
            linear-gradient(160deg,
                #061426 0%,
                #0a192f 48%,
                #0d3155 100%);
    }

    .login-shell {
        display: block;
        min-height: 100vh;
        background: transparent;
    }

    .login-brand-panel {
        display: none;
    }

    .login-form-panel {
        display: block;
        min-height: 100vh;
        padding:
            max(30px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom));
        background: transparent;
    }

    .login-card {
        display: flex;
        min-height: calc(100vh - max(30px, env(safe-area-inset-top)) - max(24px, env(safe-area-inset-bottom)));
        max-width: none;
        flex-direction: column;
        padding: 18px 6px 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }

    .login-header {
        margin-bottom: 33px;
        text-align: center;
    }

    .brand-logo-mobile {
        display: block;
        max-width: 205px;
        margin-bottom: 30px;
    }

    .login-header h2 {
        font-size: 1.85rem;
    }

    .login-header p {
        max-width: 350px;
        margin-right: auto;
        margin-left: auto;
    }

    .login-body {
        width: 100%;
    }

    .form-label {
        font-size: 0.8rem;
    }

    .sw-input-group .form-control {
        min-height: 54px;
        background: rgba(255, 255, 255, 0.97);
    }

    .btn-sw-primary {
        min-height: 54px;
        color: var(--sw-navy-950);
    }

    .btn-sw-primary:hover,
    .btn-sw-primary:focus {
        color: var(--sw-navy-950);
    }

    .login-footer {
        margin-top: auto;
        padding-top: 32px;
        padding-bottom: 5px;
        border-top-color: rgba(255, 255, 255, 0.1);
    }
}

/* =========================================================
   MÓVILES PEQUEÑOS
   ========================================================= */

@media (max-width: 420px) {
    .login-form-panel {
        padding-right: 18px;
        padding-left: 18px;
    }

    .brand-logo-mobile {
        max-width: 185px;
    }

    .login-header h2 {
        font-size: 1.7rem;
    }

    .login-header p {
        font-size: 0.88rem;
    }

    .sw-input-group .form-control {
        padding-right: 46px;
        padding-left: 46px;
        font-size: 0.88rem;
    }

    .login-footer p {
        font-size: 0.72rem;
    }
}

/* =========================================================
   MÓVILES BAJOS
   ========================================================= */

@media (max-width: 767.98px) and (max-height: 720px) {
    .login-form-panel {
        padding-top: 18px;
    }

    .brand-logo-mobile {
        max-width: 170px;
        margin-bottom: 18px;
    }

    .login-header {
        margin-bottom: 22px;
    }

    .login-header h2 {
        font-size: 1.5rem;
    }

    .login-header p {
        font-size: 0.82rem;
    }

    .sw-input-group .form-control,
    .btn-sw-primary {
        min-height: 50px;
    }

    .install-container {
        margin-top: 22px;
    }

    .login-footer {
        margin-top: 24px;
        padding-top: 20px;
    }
}

/* =========================================================
   ACCESIBILIDAD
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}