/* ============================================================
   Session top bar + auth modal (UI no funcional)
   Se carga después de css.min.css para sobrescribir el offset
   del header fijo (barra de sesión + nav).
   ============================================================ */

:root {
    --w-topbar-h: 40px;
    --w-nav-h: calc(72px + var(--w-topbar-h));
}

/* Nav fija debajo de la barra de sesión */
.w-nav {
    top: var(--w-topbar-h);
    height: 72px;
}

/* === Barra superior de sesión === */
.w-topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--w-topbar-h);
    background: var(--w-ink);
    color: #fff;
    z-index: 1041;
    font-size: 0.8125rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.w-topbar__inner {
    max-width: var(--w-max);
    height: 100%;
    margin: 0 auto;
    padding: 0 var(--w-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--w-md);
}
.w-topbar__note {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.65);
    font-weight: 500;
}
.w-topbar__note i { color: var(--wh-cyan); }
.w-topbar__account {
    display: inline-flex;
    align-items: center;
    gap: var(--w-md);
}
.w-topbar__user {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.85);
}
.w-topbar__user i { color: var(--wh-cyan); }
.w-topbar__link {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--w-dur) var(--w-ease);
}
.w-topbar__link:hover { color: #fff; }
.w-topbar__link--logout { color: rgba(255, 255, 255, 0.5); }
.w-topbar__login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 14px;
    background: var(--w-gradient);
    color: #fff;
    border: 0;
    border-radius: var(--w-r-full);
    font-family: var(--w-font);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(34, 68, 214, 0.35);
    transition: transform var(--w-dur) var(--w-ease), box-shadow var(--w-dur) var(--w-ease);
}
.w-topbar__login:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(34, 68, 214, 0.45);
}

/* === Modal de autenticación === */
.w-modal {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--w-md);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.w-modal.is-open { visibility: visible; opacity: 1; }
.w-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}
.w-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--w-card);
    border-radius: var(--w-r-lg);
    box-shadow: var(--w-shadow-lg);
    transform: translateY(12px) scale(0.98);
    transition: transform 0.25s var(--w-ease);
    overflow: hidden;
    max-height: calc(100vh - var(--w-md) * 2);
    overflow-y: auto;
}
.w-modal.is-open .w-modal__dialog { transform: translateY(0) scale(1); }
.w-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--w-sm);
    padding: var(--w-md) var(--w-md) 0;
}
.w-modal__tabs {
    display: flex;
    gap: 4px;
    background: var(--w-muted-bg);
    border-radius: var(--w-r-full);
    padding: 4px;
}
.w-modal__tab {
    border: 0;
    background: transparent;
    color: var(--w-muted);
    font-family: var(--w-font);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 7px 16px;
    border-radius: var(--w-r-full);
    cursor: pointer;
    transition: background var(--w-dur) var(--w-ease), color var(--w-dur) var(--w-ease), box-shadow var(--w-dur) var(--w-ease);
}
.w-modal__tab.is-active {
    background: #fff;
    color: var(--w-ink);
    box-shadow: var(--w-shadow-xs);
}
.w-modal__close {
    background: transparent;
    border: 1px solid var(--w-hairline);
    color: var(--w-ink);
    width: 36px; height: 36px;
    flex: 0 0 auto;
    cursor: pointer;
    border-radius: var(--w-r-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.w-modal__close:hover { border-color: var(--w-accent); color: var(--w-accent); }
.w-modal__body { padding: var(--w-md); }
.w-modal__panel { display: flex; flex-direction: column; gap: var(--w-sm); }
.w-modal__panel[hidden] { display: none; }
.w-modal__title { text-transform: none; letter-spacing: -0.01em; margin-bottom: 4px; }
.w-modal__error {
    background: #fdecea;
    color: #b3261e;
    border: 1px solid #f5c6c0;
    border-radius: var(--w-r-sm);
    padding: 10px 12px;
    font-size: 0.8125rem;
    line-height: 1.4;
}
.w-modal__error[hidden] { display: none; }

.w-modal__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--w-sm);
    margin: 2px 0;
}
.w-check {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--w-muted);
    font-size: 0.8125rem;
    cursor: pointer;
}
.w-check input { accent-color: var(--w-accent); }
.w-modal__forgot {
    color: var(--w-accent);
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
}
.w-modal__forgot:hover { color: var(--w-accent-dark); }

.w-field { display: flex; flex-direction: column; gap: 6px; }
.w-field__label { font-size: 0.8125rem; font-weight: 600; color: var(--w-ink); }
.w-field__control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid var(--w-hairline);
    border-radius: var(--w-r-sm);
    background: var(--w-canvas);
    transition: border-color var(--w-dur) var(--w-ease), box-shadow var(--w-dur) var(--w-ease);
}
.w-field__control:focus-within {
    border-color: var(--w-accent);
    box-shadow: 0 0 0 3px var(--w-blue-soft);
}
.w-field__control i { color: var(--w-muted); font-size: 0.9375rem; }
.w-field__input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent;
    font-family: var(--w-font);
    font-size: 0.9375rem;
    color: var(--w-ink);
    height: 46px;
    padding: 0;
}
.w-field__input::placeholder { color: #b6b6b6; }

.w-btn--block { width: 100%; }

@media (max-width: 480px) {
    .w-topbar__note { display: none; }
}
