/* TekLive+ public authentication — Operación precisa */

.auth-layout {
    --auth-paper: #f3f1ea;
    --auth-paper-strong: #e9e6dc;
    --auth-ink: #171915;
    --auth-ink-soft: #343730;
    --auth-muted: #64675f;
    --auth-line: rgba(23, 25, 21, .16);
    --auth-surface: #fffdf8;
    --auth-blue: #435ca7;
    --auth-blue-dark: #2f447f;
    --auth-lime: #c9f45c;
    --auth-display: "Bahnschrift", "Aptos Display", "Segoe UI", sans-serif;
    --auth-body: "Aptos", "Segoe UI", sans-serif;
    --auth-mono: "Cascadia Mono", "Consolas", monospace;
    display: grid;
    grid-template-columns: minmax(380px, 43%) minmax(0, 57%);
    min-height: 100vh;
    min-height: 100dvh;
    color: var(--auth-ink);
    background: var(--auth-paper);
    font-family: var(--auth-body);
    line-height: 1.55;
}

/* Cuando el sidebar está activo, usar el color del sidebar */
.auth-layout.sidebar-active {
    --auth-blue: var(--ws-blue, #435ca7);
    --auth-blue-dark: var(--ws-blue-dark, #2f447f);
}

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

.auth-layout a,
.auth-layout button,
.auth-layout input {
    font-family: inherit;
}

.auth-layout :focus-visible {
    outline: 3px solid var(--auth-blue);
    outline-offset: 3px;
}

.auth-layout ::selection {
    color: #fff;
    background: var(--auth-blue);
}

.auth-layout svg {
    flex-shrink: 0;
}

.auth-left {
    position: sticky;
    top: 0;
    display: flex;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    min-height: 660px;
    flex-direction: column;
    justify-content: space-between;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: clamp(32px, 4vw, 64px);
    color: #f3f1e9;
    background-color: var(--auth-ink);
    background-image:
        linear-gradient(rgba(243, 241, 233, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(243, 241, 233, .055) 1px, transparent 1px);
    background-size: 38px 38px;
    scrollbar-color: rgba(201, 244, 92, .55) transparent;
    scrollbar-width: thin;
}

.auth-left::before {
    position: absolute;
    inset-block: 0;
    left: 0;
    width: 8px;
    background: var(--auth-lime);
    content: "";
}

.auth-left::after {
    position: absolute;
    top: clamp(90px, 13vh, 150px);
    right: clamp(28px, 4vw, 62px);
    width: 84px;
    height: 84px;
    border-top: 1px solid rgba(243, 241, 233, .18);
    border-right: 1px solid rgba(243, 241, 233, .18);
    content: "";
}

.auth-left-content,
.auth-left-footer {
    position: relative;
    z-index: 1;
}

.auth-left-content,
.auth-left-body,
.auth-testimonial {
    flex-shrink: 0;
}

.auth-left::-webkit-scrollbar {
    width: 7px;
}

.auth-left::-webkit-scrollbar-track {
    background: transparent;
}

.auth-left::-webkit-scrollbar-thumb {
    border: 2px solid var(--auth-ink);
    border-radius: 999px;
    background: rgba(201, 244, 92, .55);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    color: inherit;
    text-decoration: none;
}

.auth-brand-logo {
    display: block;
    width: 144px;
    height: auto;
}

.auth-left .auth-brand {
    margin-bottom: clamp(44px, 8vh, 88px);
}

.auth-left-body {
    max-width: 480px;
    margin-bottom: clamp(34px, 6vh, 64px);
}

.auth-edition,
.auth-kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-family: var(--auth-mono);
    font-size: .7rem;
    line-height: 1.4;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.auth-edition {
    color: rgba(243, 241, 233, .62);
}

.auth-edition span {
    padding: 5px 7px;
    border: 1px solid rgba(243, 241, 233, .18);
    background: rgba(243, 241, 233, .06);
    color: #f3f1e9;
    font-size: .66rem;
}

.auth-left-body h2 {
    margin: 20px 0 18px;
    color: #f3f1e9;
    font-family: var(--auth-display);
    font-size: clamp(2.55rem, 4.2vw, 4.4rem);
    font-weight: 700;
    line-height: .96;
    letter-spacing: 0;
}

.auth-left-body > p:not(.auth-edition) {
    max-width: 410px;
    margin: 0;
    color: rgba(243, 241, 233, .68);
    font-size: 1rem;
}

.auth-capabilities {
    display: grid;
    margin: 32px 0 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid rgba(243, 241, 233, .14);
}

.auth-capabilities li {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 12px;
    padding: 13px 0;
    border-bottom: 1px solid rgba(243, 241, 233, .14);
}

.auth-capabilities li > span {
    padding-top: 2px;
    color: var(--auth-lime);
    font-family: var(--auth-mono);
    font-size: .68rem;
}

.auth-capabilities strong,
.auth-capabilities small {
    display: block;
}

.auth-capabilities strong {
    color: #f3f1e9;
    font-size: .88rem;
    font-weight: 650;
}

.auth-capabilities small {
    margin-top: 2px;
    color: rgba(243, 241, 233, .52);
    font-size: .76rem;
    line-height: 1.4;
}

.auth-testimonial {
    max-width: 480px;
    padding-top: 18px;
    border-top: 1px solid rgba(243, 241, 233, .18);
}

.auth-testimonial-label {
    margin: 0 0 12px;
    color: var(--auth-lime);
    font-family: var(--auth-mono);
    font-size: .65rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.auth-testimonial .testimonial-text {
    margin: 0 0 16px;
    color: rgba(243, 241, 233, .76);
    font-size: .86rem;
    font-style: normal;
    line-height: 1.55;
}

.auth-testimonial .testimonial-author {
    display: flex;
    align-items: center;
    gap: 11px;
}

.auth-testimonial .author-avatar {
    display: flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(243, 241, 233, .2);
    background: var(--auth-blue);
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
}

.auth-testimonial .author-info {
    display: flex;
    flex-direction: column;
}

.auth-testimonial .author-name {
    color: #f3f1e9;
    font-size: .78rem;
    font-weight: 650;
}

.auth-testimonial .author-role {
    color: rgba(243, 241, 233, .48);
    font-size: .68rem;
}

.auth-left-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid rgba(243, 241, 233, .14);
    color: rgba(243, 241, 233, .42);
    font-family: var(--auth-mono);
    font-size: .66rem;
}

.auth-left-links {
    display: flex;
    gap: 18px;
}

.auth-left-links a {
    color: rgba(243, 241, 233, .56);
    text-decoration: none;
}

.auth-left-links a:hover {
    color: #f3f1e9;
}

.auth-right {
    display: flex;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    flex-direction: column;
    align-items: center;
    padding-inline: clamp(32px, 7vw, 112px);
    background-color: var(--auth-paper);
    background-image:
        linear-gradient(rgba(23, 25, 21, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(23, 25, 21, .045) 1px, transparent 1px);
    background-size: 48px 48px;
}

.auth-mobile-bar {
    display: none;
}

.auth-right-inner {
    width: min(100%, 520px);
    max-width: 520px;
    margin-block: auto;
    padding-block: clamp(48px, 8vh, 88px);
}

.auth-header {
    margin-bottom: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--auth-line);
}

.auth-kicker {
    color: var(--auth-muted);
}

.auth-kicker span {
    padding: 5px 7px;
    border: 1px solid var(--auth-line);
    background: var(--auth-surface);
    color: var(--auth-ink);
    font-size: .66rem;
}

.auth-header h1 {
    margin: 22px 0 12px;
    color: var(--auth-ink);
    font-family: var(--auth-display);
    font-size: clamp(2.45rem, 4vw, 3.65rem);
    font-weight: 700;
    line-height: .96;
    letter-spacing: 0;
}

.auth-header > p:last-child {
    max-width: 440px;
    margin: 0;
    color: var(--auth-muted);
    font-size: .98rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.auth-form-register {
    gap: 16px;
}

.auth-form-section {
    display: grid;
    grid-template-columns: 30px auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 20px;
    border-top: 1px solid var(--auth-line);
    color: var(--auth-muted);
}

.auth-form-section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.auth-form-section-index {
    padding: 3px 5px;
    border: 1px solid var(--auth-line);
    background: var(--auth-surface);
    color: var(--auth-ink);
    font-family: var(--auth-mono);
    font-size: .63rem;
    text-align: center;
}

.auth-form-section strong {
    color: var(--auth-ink);
    font-size: .82rem;
    font-weight: 700;
}

.auth-form-section small {
    justify-self: end;
    color: var(--auth-muted);
    font-family: var(--auth-mono);
    font-size: .64rem;
    text-align: right;
}

.auth-layout .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-layout .form-label {
    color: var(--auth-ink-soft);
    font-family: var(--auth-mono);
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .025em;
}

.auth-layout .form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.auth-layout .form-link {
    color: var(--auth-blue);
    font-size: .76rem;
    font-weight: 650;
    text-decoration: none;
}

.auth-layout .form-link:hover {
    color: var(--auth-blue-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-layout .input-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

.auth-layout .input-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-50%);
    color: var(--auth-muted);
    pointer-events: none;
}

.auth-layout .input-icon svg {
    display: block;
    width: 17px;
    height: 17px;
}

.auth-layout .input-wrapper:focus-within .input-icon {
    color: var(--auth-blue);
}

.auth-layout .form-input {
    display: block;
    width: 100%;
    min-height: 52px;
    padding: 13px 16px 13px 47px;
    border: 1px solid var(--auth-line);
    border-radius: 3px;
    outline: none;
    background: var(--auth-surface);
    color: var(--auth-ink);
    font-size: .93rem;
    line-height: 1.45;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.auth-layout .form-input.has-toggle {
    padding-right: 48px;
}

.auth-layout .form-input:hover {
    border-color: rgba(23, 25, 21, .32);
}

.auth-layout .form-input:focus {
    border-color: var(--auth-blue);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(67, 92, 167, .12);
}

.auth-layout .form-input::placeholder {
    color: #8c8f86;
}

.auth-layout .input-toggle {
    position: absolute;
    z-index: 1;
    top: 50%;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--auth-muted);
    cursor: pointer;
}

.auth-layout .input-toggle:hover {
    color: var(--auth-blue);
}

.auth-layout .input-toggle svg {
    display: block;
    width: 18px;
    height: 18px;
}

.auth-layout .form-checkbox {
    flex-direction: row;
}

.auth-layout .checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--auth-muted);
    font-size: .79rem;
    line-height: 1.45;
    cursor: pointer;
}

.auth-layout .checkbox-label input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.auth-layout .checkbox-custom {
    display: flex;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    border: 1px solid var(--auth-line);
    border-radius: 3px;
    background: var(--auth-surface);
}

.auth-layout .checkbox-label input:checked + .checkbox-custom {
    border-color: var(--auth-blue);
    background: var(--auth-blue);
}

.auth-layout .checkbox-label input:checked + .checkbox-custom::after {
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    content: "";
    transform: rotate(45deg) translate(-1px, -1px);
}

.auth-layout .checkbox-label a {
    color: var(--auth-blue);
    font-weight: 650;
}

.auth-layout .form-hint {
    margin: -1px 0 0;
    color: var(--auth-muted);
    font-size: .7rem;
    line-height: 1.5;
}

.auth-layout .btn-auth {
    display: flex;
    width: 100%;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 22px;
    border: 1px solid var(--auth-blue);
    border-radius: 3px;
    background: var(--auth-blue);
    color: #fff;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.auth-layout .btn-auth:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: var(--auth-blue-dark);
    background: var(--auth-blue-dark);
}

.auth-layout .btn-auth:disabled {
    cursor: not-allowed;
    opacity: .62;
}

.auth-layout .btn-auth svg {
    width: 17px;
    height: 17px;
}

.auth-form-login .btn-auth,
.auth-form-register .btn-auth {
    margin-top: 4px;
}

.auth-layout .btn-location {
    display: flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: 1px solid var(--auth-line);
    border-radius: 3px;
    background: transparent;
    color: var(--auth-blue);
    font-size: .82rem;
    font-weight: 650;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease;
}

.auth-layout .btn-location:hover:not(:disabled) {
    border-color: var(--auth-blue);
    background: rgba(67, 92, 167, .06);
}

.auth-layout .btn-location:disabled {
    cursor: not-allowed;
    opacity: .6;
}

.auth-layout .btn-location svg {
    width: 17px;
    height: 17px;
}

.auth-layout .location-detected {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid rgba(29, 45, 22, .2);
    border-radius: 3px;
    background: rgba(201, 244, 92, .22);
    color: #31451d;
    font-size: .77rem;
    font-weight: 600;
}

.auth-layout .location-pin,
.auth-layout .location-pin svg {
    display: flex;
    width: 15px;
    height: 15px;
}

.auth-layout .location-error,
.auth-layout .auth-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 13px;
    border: 1px solid rgba(182, 61, 46, .24);
    border-radius: 3px;
    background: rgba(182, 61, 46, .07);
    color: #9f3529;
    font-size: .78rem;
    line-height: 1.5;
}

.auth-layout .auth-error svg {
    width: 17px;
    height: 17px;
    margin-top: 1px;
}

.auth-layout .auth-footer-inline {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    color: var(--auth-muted);
    font-size: .79rem;
}

.auth-layout .auth-footer-inline a {
    color: var(--auth-blue);
    font-weight: 650;
}

.auth-layout .auth-footer-inline a:hover {
    color: var(--auth-blue-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.auth-footer-register {
    justify-content: center;
    margin-top: 2px;
}

.auth-layout .btn-spinner {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin .8s linear infinite;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (min-width: 1024px) and (max-height: 900px) {
    .auth-left {
        padding-block: 32px;
    }

    .auth-left .auth-brand {
        margin-bottom: 34px;
    }

    .auth-left-body {
        margin-bottom: 28px;
    }

    .auth-left-body h2 {
        margin-block: 16px 14px;
    }

    .auth-capabilities {
        margin-top: 24px;
    }

    .auth-capabilities li {
        padding-block: 11px;
    }

    .auth-left-footer {
        margin-top: 24px;
        padding-top: 15px;
    }
}

@media (max-width: 1023px) {
    .auth-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .auth-left {
        display: none;
    }

    .auth-right {
        min-height: 100vh;
        min-height: 100dvh;
        align-items: stretch;
        padding-inline: clamp(20px, 6vw, 56px);
    }

    .auth-mobile-bar {
        display: flex;
        width: min(100%, 520px);
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        margin-inline: auto;
        padding-block: 20px;
        border-bottom: 1px solid var(--auth-line);
    }

    .auth-mobile-bar .auth-brand-logo {
        width: 128px;
    }

    .auth-back-link {
        color: var(--auth-muted);
        font-family: var(--auth-mono);
        font-size: .68rem;
        text-decoration: none;
    }

    .auth-back-link:hover {
        color: var(--auth-blue);
    }

    .auth-right-inner {
        margin: 0 auto;
        padding-block: 38px 54px;
    }
}

@media (max-width: 639px) {
    .auth-right {
        padding-inline: 20px;
    }

    .auth-right-inner {
        padding-top: 30px;
    }

    .auth-header {
        margin-bottom: 28px;
        padding-top: 14px;
    }

    .auth-kicker {
        align-items: flex-start;
        flex-wrap: wrap;
        row-gap: 7px;
    }

    .auth-header h1 {
        margin-top: 19px;
        font-size: clamp(2.2rem, 11vw, 2.9rem);
    }

    .auth-header > p:last-child {
        font-size: .9rem;
    }

    .auth-form,
    .auth-form-register {
        gap: 15px;
    }

    .auth-form-section {
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 4px 9px;
        padding-top: 17px;
    }

    .auth-form-section-index {
        grid-row: span 2;
        align-self: start;
        margin-top: 1px;
    }

    .auth-form-section small {
        grid-column: 2;
        justify-self: start;
        text-align: left;
    }

    .auth-form-section strong {
        align-self: end;
    }

    .auth-layout .form-input {
        min-height: 50px;
        font-size: .9rem;
    }

    .auth-layout .form-label-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .auth-mobile-bar {
        padding-block: 17px;
    }

    .auth-footer-inline {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-layout .btn-auth {
        transition: none;
    }

    .auth-layout .btn-spinner {
        animation-duration: 1.8s;
    }
}
