/* ======================================
   SUPERCLICK
   ESTRUCTURA GENERAL, LOGIN Y PANEL
====================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: "Inter", Arial, sans-serif;
    color: var(--color-text);
    background: linear-gradient(180deg, #f8fafc, #eef5f1);
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font: inherit;
}

.login-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    overflow: hidden;
}

.login-page::before,
.login-page::after {
    content: "";
    position: fixed;
    border-radius: 50%;
    background: var(--color-primary-light);
    pointer-events: none;
}

/* Una vez hay sesión activa, #panel (no .login-card) puede
   crecer a cualquier alto según el contenido de cada pantalla
   — con position:absolute estos círculos quedaban anclados a
   ese alto variable en vez de al viewport, y en pantallas
   cortas (ej. la cesta con pocos productos) el círculo de
   abajo terminaba flotando sobre botones reales. */
body.panel-activo .login-page::before,
body.panel-activo .login-page::after {
    display: none;
}

.login-page::before {
    width: 420px;
    height: 420px;
    top: -180px;
    left: -160px;
    opacity: 0.85;
}

.login-page::after {
    width: 360px;
    height: 360px;
    right: -140px;
    bottom: -160px;
    opacity: 0.65;
}

.login-card {
    position: relative;
    z-index: 2;
    width: min(440px, 100%);
    padding: 44px;
    border: 1px solid var(--color-border);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-large);
    text-align: center;
    backdrop-filter: blur(16px);
}

.login-card h1 {
    margin-bottom: 8px;
    color: var(--color-primary);
    font-size: clamp(36px, 7vw, 48px);
    font-weight: 800;
    letter-spacing: -2px;
}

.logo-icon {
    width: 72px;
    height: 72px;
    display: block;
    margin: 0 auto 18px;
    border-radius: 22px;
    object-fit: cover;
    box-shadow: var(--shadow-medium);
}

.welcome {
    margin-bottom: 7px;
    color: var(--color-primary-dark);
    font-size: 18px;
    font-weight: 700;
}

.slogan {
    margin-bottom: 30px;
    color: var(--color-text-secondary);
    font-size: 15px;
    line-height: 1.6;
}

.login-card h2 {
    margin: 28px 0 22px;
    font-size: 22px;
}

.login-card input {
    width: 100%;
    min-height: 52px;
    padding: 14px 16px;
    margin-bottom: 14px;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    background: #f8fafc;
    color: var(--color-text);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.login-card input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(23, 107, 67, 0.13);
}

.login-card button {
    width: 100%;
    min-height: 52px;
    padding: 14px 18px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    font-weight: 700;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}

.login-card button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.login-card button.boton-google {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: white;
    color: #3c4043;
    font-weight: 500;
    border: 1px solid var(--color-border);
}

.login-card button.boton-google:hover {
    box-shadow: var(--shadow-medium);
}

.boton-google-icono {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.login-card button.boton-facebook {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #1877F2;
    color: white;
    font-weight: 500;
    border: 1px solid #1877F2;
}

.login-card button.boton-facebook:hover {
    box-shadow: var(--shadow-medium);
}

.boton-facebook-icono {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ======================================
   PANTALLA DE LOGIN — estructura tipo "Login"
   (solo #vistaLogin; el resto de vistas de la
   tarjeta — registro, olvidé contraseña, etc. —
   no se tocan)
====================================== */

.login-card:has(#vistaLogin:not([hidden])) h1,
.login-card:has(#vistaLogin:not([hidden])) .logo-icon,
.login-card:has(#vistaLogin:not([hidden])) .welcome,
.login-card:has(#vistaLogin:not([hidden])) .slogan,
.login-card:has(#vistaRegistro:not([hidden])) h1,
.login-card:has(#vistaRegistro:not([hidden])) .logo-icon,
.login-card:has(#vistaRegistro:not([hidden])) .welcome,
.login-card:has(#vistaRegistro:not([hidden])) .slogan {
    display: none;
}

#vistaLogin,
#vistaRegistro {
    text-align: left;
}

.login-card h2.login-titulo {
    margin: 0 0 28px;
    color: var(--color-primary-dark);
    font-size: clamp(30px, 6vw, 38px);
    font-weight: 800;
    letter-spacing: -1px;
}

.campo-con-etiqueta {
    margin-bottom: 16px;
}

.campo-con-etiqueta label {
    display: block;
    margin-bottom: 6px;
    color: var(--color-text);
    font-size: 13px;
    font-weight: 600;
}

.campo-con-etiqueta input {
    margin-bottom: 0;
}

.campo-password-caja {
    position: relative;
}

.olvido-password {
    margin: 0 0 22px;
    text-align: right;
}

.olvido-password .enlace-alternar {
    width: auto;
    min-height: 0;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    color: var(--color-primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}

.olvido-password .enlace-alternar:hover {
    text-decoration: underline;
}

.login-card button.boton-login-principal {
    border-radius: 999px;
    background: var(--color-primary-dark);
}

.separador-o {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 18px;
    color: var(--color-text-secondary);
    font-size: 13px;
}

.separador-o::before,
.separador-o::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.fila-social {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 8px;
}

.login-card button.boton-social {
    width: 52px;
    height: 52px;
    min-height: 0;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--color-border);
    box-shadow: none;
}

.login-card button.boton-social svg {
    width: 22px;
    height: 22px;
}

.login-card button.boton-social-facebook {
    background: #1877F2;
    border-color: #1877F2;
}

.campo-password {
    position: relative;
}

.campo-password input {
    padding-right: 46px;
}

.login-card .campo-password button.alternar-password {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 14px;
    width: 46px;
    min-height: 0;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0;
    background-color: transparent;
    background-image: none;
    box-shadow: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: var(--color-text-secondary);
}

.login-card .campo-password button.alternar-password svg {
    width: 20px;
    height: 20px;
}

.alternar-modo-auth {
    margin-top: 18px;
    color: var(--color-text-secondary);
    font-size: 14px;
}

.alternar-modo-auth .enlace-alternar {
    width: auto;
    min-height: 0;
    padding: 0;
    margin: 0 0 0 4px;
    border: none;
    background: none;
    color: var(--color-primary);
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

/* Agrupa "¿No tienes cuenta?" y "¿Eres empleado...?" como un bloque
   aparte, separado del botón/login social por una línea sutil, para
   que no se lean como dos avisos sueltos al mismo nivel de importancia. */
.enlaces-auth-secundarios {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);
    text-align: center;
}

.enlaces-auth-secundarios .alternar-modo-auth {
    margin-top: 0;
}

.enlaces-auth-secundarios .alternar-modo-auth-menor {
    margin-top: 6px;
    font-size: 12px;
}

.enlaces-auth-secundarios .alternar-modo-auth-menor .enlace-alternar {
    font-size: 12px;
    font-weight: 600;
}

.checkbox-terminos {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
    text-align: left;
    color: var(--color-text-secondary);
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
}

.checkbox-terminos input {
    width: auto;
    min-height: 0;
    margin: 2px 0 0;
    flex-shrink: 0;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.checkbox-terminos a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: underline;
}

.login-legal-enlaces {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border);

    color: var(--color-text-secondary);
    font-size: 12px;
    line-height: 1.6;
    text-align: center;
}

.login-legal-enlaces a {
    color: var(--color-text-secondary);
    text-decoration: underline;
}

#mensajeRegistro {
    min-height: 22px;
    margin-top: 14px;
    color: var(--color-error);
    font-size: 14px;
    font-weight: 600;
}

#mensaje {
    min-height: 22px;
    margin-top: 14px;
    color: var(--color-error);
    font-size: 14px;
    font-weight: 600;
}

#mensajeOlvido,
#mensajeRestablecer {
    min-height: 22px;
    margin-top: 14px;
    color: var(--color-error);
    font-size: 14px;
    font-weight: 600;
}

#panel {
    width: min(1180px, calc(100% - 40px));
    min-height: calc(100vh - 48px);
    margin: 24px auto;
    padding: 32px;
    border: 1px solid var(--color-border);
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow-large);
    backdrop-filter: blur(14px);
}

#tituloPanel {
    margin-bottom: 24px;
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.cerrar-sesion {
    width: 100%;
    min-height: 48px;
    margin-top: 30px;
    border: none;
    border-radius: 13px;
    background: #fee2e2;
    color: var(--color-error);
    font-weight: 700;
    cursor: pointer;
}

.cerrar-sesion:hover {
    background: #fecaca;
}

@media (max-width: 750px) {
    .login-page { padding: 18px; }
    .login-card { padding: 34px 24px; border-radius: 22px; }
    #panel {
        width: 100%;
        min-height: 100vh;
        margin: 0;
        padding: 22px 18px;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }
}
