/**
 * Login full-page (estilo split tipo GoPass, marca GoPS).
 */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body.gt-login {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    overflow: hidden;
    display: flex;
    background: #0b0910;
    color: #ece8f4;
    font-family: "DM Sans", system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.login-page {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

/* —— Hero / marca —— */
.login-hero {
    position: relative;
    flex: 0 0 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.85rem 1.15rem;
    padding-top: max(0.85rem, env(safe-area-inset-top));
    background:
        radial-gradient(900px 500px at 18% 0%, rgba(127, 0, 255, 0.28), transparent 55%),
        radial-gradient(700px 400px at 95% 85%, rgba(127, 0, 255, 0.1), transparent 50%),
        linear-gradient(165deg, #05040a 0%, #0b0910 50%, #100e18 100%);
    overflow: hidden;
}

.login-hero::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(127, 0, 255, 0.5), transparent);
}

.login-hero__copy {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
}

.login-hero__logo-link {
    display: block;
    flex: 0 0 auto;
    line-height: 0;
}

.login-hero__logo,
.login-hero__logo.gt-logo {
    display: block;
    width: auto;
    height: 34px;
    max-height: 34px;
    object-fit: contain;
    object-position: left center;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.login-hero__logo-link:hover .login-hero__logo {
    opacity: 0.92;
    transform: scale(1.02);
}

.login-hero__title {
    flex: 0 0 auto;
    margin: 0 0 0 auto;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: #ece8f4;
    text-align: right;
    white-space: nowrap;
}

/* —— Formulario —— */
.login-main {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1.35rem;
    padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
    background: #14101a;
    overflow: auto;
}

.login-main__inner {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.login-alert {
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.4;
    color: #fecaca;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.login-field {
    margin-bottom: 1rem;
    text-align: left;
}

.login-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9a8fb0;
}

.login-field__control {
    position: relative;
    display: flex;
    align-items: center;
}

.login-field__icon {
    position: absolute;
    left: 0.9rem;
    display: flex;
    color: #9a8fb0;
    pointer-events: none;
}

.login-field__control input {
    width: 100%;
    height: 2.85rem;
    margin: 0;
    padding: 0 0.95rem 0 2.65rem;
    border: 1px solid #2e2740;
    border-radius: 12px;
    background: #0b0910;
    color: #ece8f4;
    font: inherit;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.login-field__control--password input {
    padding-right: 2.75rem;
}

.login-field__control input::placeholder {
    color: #665c78;
}

.login-field__control input:focus {
    outline: none;
    border-color: #7f00ff;
    box-shadow: 0 0 0 4px rgba(127, 0, 255, 0.16);
}

.login-pass-toggle {
    position: absolute;
    right: 0.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #9a8fb0;
    cursor: pointer;
}

.login-pass-toggle:hover {
    color: #7f00ff;
    background: rgba(127, 0, 255, 0.1);
}

.login-actions {
    margin-top: 1.25rem;
}

.login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 2.95rem;
    margin: 0;
    padding: 0 1.1rem;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.login-btn--primary {
    color: #ffffff;
    background: #7f00ff;
    box-shadow: 0 10px 28px rgba(127, 0, 255, 0.28);
}

.login-btn--primary:hover {
    background: #5c00c9;
}

.login-btn--primary:active {
    transform: translateY(1px);
}

.login-btn.is-loading,
.login-btn:disabled {
    opacity: 0.72;
    cursor: wait;
    pointer-events: none;
    transform: none;
}

.login-btn--google {
    display: flex;
    width: 100%;
    color: #ece8f4;
    background: #1c1726;
    border: 1px solid #2e2740;
    gap: 0.65rem;
    text-decoration: none;
    margin: 0;
    box-shadow: none;
    box-sizing: border-box;
}

.login-btn--google:hover {
    background: #241e30;
    color: #fff;
    border-color: #3d3552;
}

.login-btn__google-icon {
    flex-shrink: 0;
}

.login-auth {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0;
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
    color: #9a8fb0;
    font-size: 0.8rem;
    width: 100%;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: #2e2740;
    min-width: 1rem;
}

.login-divider span {
    flex: 0 0 auto;
    white-space: nowrap;
}

.login-hint {
    margin: 0.35rem 0 0;
    font-size: 0.85rem;
    color: #9a8fb0;
    line-height: 1.4;
}

.login-lead {
    margin: 0 0 1rem;
    font-size: 0.92rem;
    color: #9a8fb0;
    line-height: 1.45;
}

.login-foot {
    margin: 1.15rem 0 0;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(236, 232, 244, 0.75);
}

.login-foot a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.login-foot a:hover {
    color: #c4a8ff;
}

.login-alert a {
    color: #c4a8ff;
    font-weight: 600;
    margin-left: 0.25rem;
}

.login-alert--ok {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
    color: #86efac;
}

/* Medidor de contraseña (registro) */
.gt-pass-meter {
    margin-top: 0.5rem;
}
.gt-pass-meter__bars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.3rem;
    margin-bottom: 0.35rem;
}
.gt-pass-meter__bars span {
    display: block;
    height: 5px;
    border-radius: 99px;
    background: #2e2740;
    transition: background 0.15s ease;
}
.gt-pass-meter.is-1 .gt-pass-meter__bars span:nth-child(-n+1) { background: #ef4444; }
.gt-pass-meter.is-2 .gt-pass-meter__bars span:nth-child(-n+2) { background: #f59e0b; }
.gt-pass-meter.is-3 .gt-pass-meter__bars span:nth-child(-n+3) { background: #eab308; }
.gt-pass-meter.is-4 .gt-pass-meter__bars span:nth-child(-n+4) { background: #22c55e; }
.gt-pass-meter__label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9a8fb0;
}
.gt-pass-meter.is-1 .gt-pass-meter__label { color: #f87171; }
.gt-pass-meter.is-2 .gt-pass-meter__label { color: #fbbf24; }
.gt-pass-meter.is-3 .gt-pass-meter__label { color: #facc15; }
.gt-pass-meter.is-4 .gt-pass-meter__label { color: #4ade80; }

.gt-pass-match {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.45rem;
    min-height: 1.1rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #9a8fb0;
}
.gt-pass-match__icon {
    flex: 0 0 auto;
    font-size: 0.85rem;
    line-height: 1;
}
.gt-pass-match.is-ok { color: #4ade80; }
.gt-pass-match.is-bad { color: #f87171; }
.login-field__control input.gt-pass-confirm.is-ok {
    border-color: rgba(34, 197, 94, 0.55);
}
.login-field__control input.gt-pass-confirm.is-bad {
    border-color: rgba(239, 68, 68, 0.55);
}

/* —— Desktop split —— */
@media (min-width: 900px) {
    .login-page {
        flex-direction: row;
    }

    .login-hero {
        flex: 1 1 52%;
        height: 100%;
        padding: 2.5rem 3.25rem;
        align-items: center;
        justify-content: center;
    }

    .login-hero::after {
        inset: 0 0 0 auto;
        width: 1px;
        height: auto;
        background: linear-gradient(180deg, transparent, rgba(127, 0, 255, 0.45), transparent);
    }

    .login-hero__copy {
        flex-direction: column;
        align-items: flex-start;
        justify-content: center;
        gap: 1rem;
        width: fit-content;
        max-width: 36rem;
    }

    .login-hero__logo,
    .login-hero__logo.gt-logo {
        width: min(72%, 380px);
        height: auto;
        max-height: none;
    }

    .login-hero__title {
        margin: 0;
        width: 100%;
        font-size: clamp(1.6rem, 2vw, 2rem);
        text-align: left;
    }

    .login-main {
        flex: 1 1 48%;
        height: 100%;
        padding: 3rem 3.5rem;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

    .login-main__inner {
        margin: 0 auto;
        max-width: 400px;
    }
}
