﻿:root {
    color-scheme: dark;

    --accent: #ffd700;
    --accent-hover: #e7c300;

    --bg-a: #062a46;
    --bg-b: #08141d;
    --bg-c: #173026;

    --card-dark: rgba(8, 14, 18, .46);
    --card-light: rgba(255, 255, 255, .46);

    --heading: #ffffff;
    --text: #c7d0d6;
    --muted: #929da5;
    --label: #f4f6f7;

    --input-bg: rgba(255, 255, 255, .08);
    --input-border: rgba(255, 255, 255, .18);
    --input-text: #ffffff;
    --placeholder: rgba(255, 255, 255, .42);

    --link-dark: #ffd700;
    --link-light: #0b5f96;

    --danger: #ff3b4d;
    --success: #35c66b;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg-b);
}

body {
    margin: 0;
}

button,
input,
select {
    font: inherit;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

body.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    overflow-x: hidden;
    color: var(--text);
    font-family: "Work Sans", system-ui, sans-serif;
    background:
        radial-gradient(circle at 10% 16%, rgba(0, 117, 197, .26), transparent 33%),
        radial-gradient(circle at 88% 82%, rgba(255, 215, 0, .06), transparent 30%),
        linear-gradient(135deg, var(--bg-a) 0%, var(--bg-b) 50%, var(--bg-c) 100%);
}

.auth-shell {
    width: min(980px, 100%);
    min-height: 610px;
    display: grid;
    grid-template-columns: minmax(420px, 54%) minmax(320px, 46%);
    gap: 18px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 26px;
    background: rgba(8, 14, 18, .58);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .38);
    backdrop-filter: blur(22px) saturate(118%);
    -webkit-backdrop-filter: blur(22px) saturate(118%);
}

.login-panel {
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 34px 28px 26px;
    background: rgba(8, 14, 18, .18);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 26px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    padding: 5px;
    border: 1px solid rgba(255, 215, 0, .34);
    border-radius: 12px;
    background: rgba(255, 215, 0, .12);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .22);
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand strong {
    max-width: 280px;
    overflow: hidden;
    color: var(--heading);
    font: 800 18px/1.2 Manrope, sans-serif;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login-card-content {
    width: min(100%, 420px);
    margin: auto;
}

.panel-heading {
    margin-bottom: 10px;
}

.panel-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.status-dot {
    display: none;
}

.login-panel h1 {
    margin: 0 0 8px;
    color: var(--heading);
    font: 800 clamp(34px, 4vw, 46px)/1.05 Manrope, sans-serif;
    letter-spacing: -.035em;
}

.auth-subtitle {
    max-width: 370px;
    margin: 0 0 26px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.55;
}

.login-form {
    display: grid;
    gap: 17px;
}

.auth-field {
    display: grid;
    gap: 7px;
}

.auth-label {
    margin-left: 1px;
    color: var(--label);
    font-size: 11px;
    font-weight: 800;
}

.auth-input-wrapper {
    position: relative;
}

.auth-input-wrapper input {
    width: 100%;
    min-height: 46px;
    padding: 12px 45px 12px 14px;
    color: var(--input-text);
    caret-color: var(--accent);
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 8px;
    outline: none;
    transition: border-color .2s, box-shadow .2s, background .2s;
}

.auth-input-wrapper input::placeholder {
    color: var(--placeholder);
}

.auth-input-wrapper input:hover {
    background: rgba(255, 255, 255, .10);
}

.auth-input-wrapper input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, .12);
    box-shadow: 0 0 0 4px rgba(255, 215, 0, .12);
}

.material-symbols-outlined {
    font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
}

.input-icon {
    position: absolute;
    right: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, .62);
    font-size: 18px;
    pointer-events: none;
}

.password-toggle {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: rgba(255, 255, 255, .68);
    background: transparent;
    cursor: pointer;
}

.password-toggle:hover,
.password-toggle:focus-visible {
    color: var(--accent);
    background: rgba(255, 215, 0, .09);
    outline: none;
}

.auth-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
}

.remember-me input {
    width: 15px;
    height: 15px;
    accent-color: var(--accent);
}

.forgot-link,
.register-link a {
    color: var(--link-dark);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.forgot-link:hover,
.register-link a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.primary-button {
    min-height: 47px;
    border: 0;
    border-radius: 8px;
    color: #272100;
    background: var(--accent);
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(255, 215, 0, .16);
}

.primary-button:hover {
    background: var(--accent-hover);
}

.primary-button:disabled {
    opacity: .72;
    cursor: wait;
}

.register-link {
    margin-top: 1px;
    padding-top: 17px;
    border-top: 1px solid rgba(255, 255, 255, .09);
    text-align: center;
}

.register-link p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.auth-language-switcher {
    margin-top: 18px;
    display: flex;
    justify-content: center;
}

.language-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-width: 154px;
    min-height: 38px;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    background: rgba(255, 255, 255, .055);
}

.language-icon {
    color: var(--muted);
    font-size: 18px;
    pointer-events: none;
}

.language-menu select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    padding: 8px 24px 8px 0;
    border: 0;
    outline: 0;
    color: var(--text);
    background: transparent;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
    cursor: pointer;
}

.language-menu select option {
    color: #f7f8f9;
    background: #11191f;
    text-transform: none;
}

.language-arrow {
    position: absolute;
    right: 10px;
    color: var(--muted);
    font-size: 18px;
    pointer-events: none;
}

.auth-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    padding: 11px 13px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
}

.auth-alert-icon {
    flex: 0 0 auto;
    font-size: 21px;
    font-variation-settings: "FILL" 1, "wght" 600, "GRAD" 0, "opsz" 24;
}

.auth-alert.error {
    color: #ff5c6b;
    background: rgba(255, 59, 77, .13);
    border-color: rgba(255, 59, 77, .48);
    box-shadow: inset 4px 0 0 var(--danger);
}

.auth-alert.success {
    color: #77e39d;
    background: rgba(53, 198, 107, .13);
    border-color: rgba(53, 198, 107, .42);
    box-shadow: inset 4px 0 0 var(--success);
}

.auth-brand-panel {
    min-width: 0;
    min-height: 574px;
    overflow: hidden;
    border-radius: 22px;
    background: #c7d7e7;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .30);
}

.auth-brand-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center center;
}

/* Tema claro */
@media (prefers-color-scheme: light) {
    :root {
        color-scheme: light;
        --heading: #0d1720;
        --text: #4a5862;
        --muted: #6a7780;
        --label: #24323b;
        --input-bg: rgba(255, 255, 255, .78);
        --input-border: rgba(23, 48, 64, .20);
        --input-text: #111a21;
        --placeholder: rgba(17, 26, 33, .42);
    }

    body.auth-page {
        background:
            radial-gradient(circle at 10% 16%, rgba(0, 117, 197, .12), transparent 33%),
            radial-gradient(circle at 88% 82%, rgba(255, 215, 0, .10), transparent 30%),
            linear-gradient(135deg, #d8edf8 0%, #f6fafc 50%, #e2eee8 100%);
    }

    .auth-shell {
        background: rgba(255, 255, 255, .56);
        border-color: rgba(22, 47, 62, .14);
        box-shadow: 0 30px 80px rgba(29, 56, 72, .16);
    }

    .login-panel {
        background: rgba(255, 255, 255, .16);
    }

    .input-icon,
    .password-toggle {
        color: rgba(17, 26, 33, .58);
    }

    .forgot-link,
    .register-link a {
        color: var(--link-light);
    }

    .forgot-link:hover,
    .register-link a:hover {
        color: #084a76;
    }

    .language-menu {
        border-color: rgba(23, 48, 64, .14);
        background: rgba(255, 255, 255, .64);
    }

    .language-menu select option {
        color: #111a21;
        background: #ffffff;
    }

    .register-link {
        border-top-color: rgba(23, 48, 64, .11);
    }
}

/* Móvil: la imagen es solo fondo */
@media (max-width: 820px) {
    html,
    body {
        min-height: 100%;
    }

    body.auth-page {
        position: relative;
        display: block;
        min-height: 100svh;
        padding: 0;
        overflow-x: hidden;
        background: #071722;
    }

    body.auth-page::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 0;
        background:
            linear-gradient(
                180deg,
                rgba(5, 20, 31, .28) 0%,
                rgba(5, 20, 31, .48) 30%,
                rgba(5, 20, 31, .68) 65%,
                rgba(5, 20, 31, .80) 100%
            ),
            url("../img/logint.webp") center top / cover no-repeat;
        pointer-events: none;
    }

    .auth-shell {
        position: relative;
        z-index: 1;
        display: block;
        width: 100%;
        min-height: 100svh;
        padding: 16px 12px 20px;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .auth-brand-panel,
    .auth-brand-image {
        display: none;
    }

    .login-panel {
        width: min(100%, 680px);
        margin: 0 auto;
        padding: 22px 18px 24px;
        border: 1px solid rgba(255, 255, 255, .10);
        border-radius: 22px;
        background: var(--card-dark);
        box-shadow: 0 20px 45px rgba(0, 0, 0, .18);
        backdrop-filter: blur(16px) saturate(112%);
        -webkit-backdrop-filter: blur(16px) saturate(112%);
    }

    .login-card-content {
        width: 100%;
        max-width: none;
    }

    .auth-actions {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Móvil claro */
@media (max-width: 820px) and (prefers-color-scheme: light) {
    body.auth-page {
        background: #eef5f8;
    }

    body.auth-page::before {
        background:
            linear-gradient(
                180deg,
                rgba(255, 255, 255, .28) 0%,
                rgba(255, 255, 255, .44) 30%,
                rgba(246, 249, 251, .62) 64%,
                rgba(246, 249, 251, .76) 100%
            ),
            url("../img/logint.webp") center top / cover no-repeat;
    }

    .login-panel {
        border-color: rgba(20, 45, 60, .10);
        background: var(--card-light);
        box-shadow: 0 20px 45px rgba(29, 56, 72, .10);
    }
}

@media (max-width: 520px) {
    .auth-shell {
        padding: 12px 8px 16px;
    }

    .login-panel {
        padding: 20px 16px 22px;
        border-radius: 18px;
    }

    .brand strong {
        font-size: 16px;
    }

    .login-panel h1 {
        font-size: 34px;
    }

    .language-menu {
        width: min(100%, 240px);
    }
}


/* =========================================================
   TEMA MANUAL: html.light / html.dark
   Estas reglas tienen prioridad sobre prefers-color-scheme.
   ========================================================= */

html.dark {
    color-scheme: dark;
}

html.dark body.auth-page {
    color: #c7d0d6;
    background:
        radial-gradient(circle at 10% 16%, rgba(0, 117, 197, .26), transparent 33%),
        radial-gradient(circle at 88% 82%, rgba(255, 215, 0, .06), transparent 30%),
        linear-gradient(135deg, #062a46 0%, #08141d 50%, #173026 100%);
}

html.dark .auth-shell {
    background: rgba(8, 14, 18, .58);
    border-color: rgba(255, 255, 255, .12);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .38);
}

html.dark .login-panel {
    background: rgba(8, 14, 18, .18);
}

html.dark .brand strong,
html.dark .login-panel h1 {
    color: #ffffff;
}

html.dark .auth-subtitle,
html.dark .language-menu select {
    color: #c7d0d6;
}

html.dark .panel-heading p,
html.dark .remember-me,
html.dark .register-link p,
html.dark .language-icon,
html.dark .language-arrow {
    color: #929da5;
}

html.dark .auth-label {
    color: #f4f6f7;
}

html.dark .auth-input-wrapper input {
    color: #ffffff;
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .18);
}

html.dark .auth-input-wrapper input::placeholder {
    color: rgba(255, 255, 255, .42);
}

html.dark .input-icon,
html.dark .password-toggle {
    color: rgba(255, 255, 255, .68);
}

html.dark .forgot-link,
html.dark .register-link a {
    color: #ffd700;
}

html.dark .language-menu {
    border-color: rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .055);
}

html.dark .language-menu select option {
    color: #f7f8f9;
    background: #11191f;
}

html.light {
    color-scheme: light;
}

html.light body.auth-page {
    color: #4a5862;
    background:
        radial-gradient(circle at 10% 16%, rgba(0, 117, 197, .12), transparent 33%),
        radial-gradient(circle at 88% 82%, rgba(255, 215, 0, .10), transparent 30%),
        linear-gradient(135deg, #d8edf8 0%, #f6fafc 50%, #e2eee8 100%);
}

html.light .auth-shell {
    background: rgba(255, 255, 255, .56);
    border-color: rgba(22, 47, 62, .14);
    box-shadow: 0 30px 80px rgba(29, 56, 72, .16);
}

html.light .login-panel {
    background: rgba(255, 255, 255, .16);
}

html.light .brand strong,
html.light .login-panel h1 {
    color: #0d1720;
}

html.light .auth-subtitle,
html.light .language-menu select {
    color: #4a5862;
}

html.light .panel-heading p,
html.light .remember-me,
html.light .register-link p,
html.light .language-icon,
html.light .language-arrow {
    color: #6a7780;
}

html.light .auth-label {
    color: #24323b;
}

html.light .auth-input-wrapper input {
    color: #111a21;
    background: rgba(255, 255, 255, .78);
    border-color: rgba(23, 48, 64, .20);
}

html.light .auth-input-wrapper input::placeholder {
    color: rgba(17, 26, 33, .42);
}

html.light .input-icon,
html.light .password-toggle {
    color: rgba(17, 26, 33, .58);
}

html.light .forgot-link,
html.light .register-link a {
    color: #0b5f96;
}

html.light .forgot-link:hover,
html.light .register-link a:hover {
    color: #084a76;
}

html.light .language-menu {
    border-color: rgba(23, 48, 64, .14);
    background: rgba(255, 255, 255, .64);
}

html.light .language-menu select option {
    color: #111a21;
    background: #ffffff;
}

html.light .register-link {
    border-top-color: rgba(23, 48, 64, .11);
}

/* Móvil con tema manual */
@media (max-width: 820px) {
    html.dark body.auth-page {
        background: #071722;
    }

    html.dark body.auth-page::before {
        background:
            linear-gradient(
                180deg,
                rgba(5, 20, 31, .28) 0%,
                rgba(5, 20, 31, .48) 30%,
                rgba(5, 20, 31, .68) 65%,
                rgba(5, 20, 31, .80) 100%
            ),
            url("../img/logint.webp") center top / cover no-repeat;
    }

    html.dark .login-panel {
        background: rgba(8, 14, 18, .46);
        border-color: rgba(255, 255, 255, .10);
    }

    html.light body.auth-page {
        background: #eef5f8;
    }

    html.light body.auth-page::before {
        background:
            linear-gradient(
                180deg,
                rgba(255, 255, 255, .28) 0%,
                rgba(255, 255, 255, .44) 30%,
                rgba(246, 249, 251, .62) 64%,
                rgba(246, 249, 251, .76) 100%
            ),
            url("../img/logint.webp") center top / cover no-repeat;
    }

    html.light .login-panel {
        background: rgba(255, 255, 255, .46);
        border-color: rgba(20, 45, 60, .10);
        box-shadow: 0 20px 45px rgba(29, 56, 72, .10);
    }
}


/* =========================================================
   MARCA CLICABLE V20
   Dos enlaces reales: logo y nombre.
   Funciona en claro/oscuro, móvil/PC.
   ========================================================= */
.brand {
    position: relative;
    z-index: 100;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    min-height: 44px;
    margin-bottom: 26px;
    border-radius: 12px;
}

.brand-logo-link,
.brand-name-link {
    position: relative;
    z-index: 101;
    display: inline-flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    pointer-events: auto !important;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.brand-logo-link {
    flex: 0 0 auto;
    border-radius: 12px;
}

.brand-name-link {
    min-height: 44px;
}

.brand-logo-link:focus-visible,
.brand-name-link:focus-visible {
    outline: 3px solid rgba(255, 215, 0, .42);
    outline-offset: 4px;
    border-radius: 10px;
}

.brand-mark,
.brand strong {
    transition:
        color .18s ease,
        border-color .18s ease,
        background .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
}

/* Oscuro */
html.dark .brand-name-link strong {
    color: #ffffff;
}

html.dark .brand-logo-link:hover .brand-mark,
html.dark .brand-logo-link:focus-visible .brand-mark,
html.dark .brand-logo-link:active .brand-mark {
    border-color: #ffd700;
    background: rgba(255, 215, 0, .18);
    box-shadow:
        0 10px 24px rgba(0, 0, 0, .26),
        0 0 0 3px rgba(255, 215, 0, .10);
}

html.dark .brand-name-link:hover strong,
html.dark .brand-name-link:focus-visible strong,
html.dark .brand-name-link:active strong {
    color: #ffd700;
}

/* Claro */
html.light .brand-name-link strong {
    color: #0d1720;
}

html.light .brand-logo-link:hover .brand-mark,
html.light .brand-logo-link:focus-visible .brand-mark,
html.light .brand-logo-link:active .brand-mark {
    border-color: #0b5f96;
    background: rgba(11, 95, 150, .10);
    box-shadow:
        0 10px 24px rgba(29, 56, 72, .16),
        0 0 0 3px rgba(11, 95, 150, .10);
}

html.light .brand-name-link:hover strong,
html.light .brand-name-link:focus-visible strong,
html.light .brand-name-link:active strong {
    color: #0b5f96;
}

/* Tema automático */
@media (prefers-color-scheme: dark) {
    html:not(.light):not(.dark) .brand-name-link strong {
        color: #ffffff;
    }
}

@media (prefers-color-scheme: light) {
    html:not(.light):not(.dark) .brand-name-link strong {
        color: #0d1720;
    }
}

/* Ninguna capa decorativa puede bloquear logo o nombre */
body.auth-page::before,
body.auth-page::after,
.auth-shell::before,
.auth-shell::after,
.login-panel::before,
.login-panel::after {
    pointer-events: none !important;
}

@media (max-width: 820px) {
    .brand,
    .brand-logo-link,
    .brand-name-link {
        position: relative;
        z-index: 200;
        pointer-events: auto !important;
    }
}

