/* ================================================================
   Cabecera, barra inferior (móvil) y pie — rediseño fase 1
   Colores: variables de style.css (claro y oscuro).
================================================================ */

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 300;
  background: var(--primary); color: #fff; padding: .6rem 1rem; border-radius: 10px;
  font-weight: 600;
}
.skip-link:focus { top: .75rem; }

/* ─── Cabecera ──────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.site-header-inner {
  max-width: 1240px; margin: 0 auto; padding: 0 24px;
  height: var(--navbar-h);
  display: flex; align-items: center; gap: 24px;
}
.site-logo { display: flex; flex-shrink: 0; }
.site-logo img { height: 30px; width: auto; }
.site-nav { display: flex; gap: 4px; }
.site-nav-link {
  padding: 10px 16px; border-radius: 999px;
  font-size: 15px; font-weight: 500; color: var(--mid);
  transition: background var(--transition), color var(--transition);
}
.site-nav-link:hover { color: var(--text); background: var(--bg-2); }
.site-nav-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }

.site-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.site-link { padding: 10px 14px; font-size: 15px; font-weight: 600; color: var(--text); }
.btn-pill {
  padding: 11px 20px; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 15px; font-weight: 600;
}
.btn-pill:hover { background: var(--primary-dark); }

.icon-btn {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: var(--text);
}
.icon-btn:hover { background: var(--bg-2); }
.notif-badge {
  position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--pass); color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.notif-badge[hidden] { display: none; }

/* Menú de la cuenta */
.user-menu { position: relative; }
.user-avatar {
  width: 44px; height: 44px; border-radius: 50%; overflow: hidden;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 17px;
  display: grid; place-items: center;
}
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 260px; padding: 8px;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 18px;
  box-shadow: var(--shadow); z-index: 200;
}
.user-menu.open .user-dropdown { display: block; }
.user-dropdown-header { padding: 10px 12px 12px; display: flex; flex-direction: column; }
.user-dropdown-header strong { font-size: 15px; }
.user-dropdown-header span { font-size: 13px; color: var(--muted); }
.user-dropdown a {
  display: block; padding: 10px 12px; border-radius: 10px;
  font-size: 15px; color: var(--text);
}
.user-dropdown a:hover { background: var(--bg-2); }
.user-dropdown a.is-danger { color: var(--pass); }
.user-dropdown hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }

/* ─── Barra inferior (móvil) ────────────────────────────────── */
.bottom-nav { display: none; }

@media (max-width: 768px) {
  .site-header-inner { padding: 0 16px; gap: 12px; }
  .site-nav { display: none; }
  .site-actions .site-link { padding: 10px 8px; }
  .site-actions .btn-pill { display: none; }

  body { padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom)); }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 150;
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--bg-card); border-top: 1px solid var(--border);
  }
  .bottom-nav-link {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    font-size: 11px; font-weight: 500; color: var(--mid);
  }
  .bottom-nav-icon { display: grid; place-items: center; width: 52px; height: 28px; border-radius: 999px; }
  .bottom-nav-link[aria-current="page"] { color: var(--accent-text); font-weight: 700; }
  .bottom-nav-link[aria-current="page"] .bottom-nav-icon { background: var(--accent-soft); }
}

@media (max-width: 640px) { .hide-mobile { display: none; } }

/* ─── Pie ───────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 48px 24px 32px; }
.site-footer-inner {
  max-width: 1240px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 32px;
}
.site-footer-brand img { height: 27px; width: auto; }
.site-footer-brand p { margin-top: 12px; font-size: 14px; line-height: 1.55; color: var(--mid); max-width: 280px; }
.site-footer-col { display: flex; flex-direction: column; gap: 8px; }
.site-footer-col > a { font-size: 14px; color: var(--mid); padding: 2px 0; }
.site-footer-col > a:hover { color: var(--text); }
.site-footer-title { font-size: 13px; font-weight: 600; color: var(--text); margin-top: 4px; }
.site-footer-choices { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.site-footer-choices a,
.site-footer-choices button {
  font: inherit; font-size: 13px; font-weight: 500; color: var(--mid);
  padding: 7px 12px; min-height: 36px; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; cursor: pointer;
}
.site-footer-choices [aria-current="true"],
.site-footer-choices [aria-pressed="true"] {
  background: var(--accent-soft); color: var(--accent-text); border-color: transparent; font-weight: 600;
}
.site-footer-copy { max-width: 1240px; margin: 32px auto 0; font-size: 13px; color: var(--muted); }

/* Hoja de calendario (se reutiliza en resultados y perfil) */
.cal-tile {
  width: 84px; flex: none; border-radius: 18px; overflow: hidden; text-align: center;
  border: 1px solid var(--border); background: var(--bg-card);
}
.cal-tile-mon { display: block; background: var(--cal-band); color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .08em; padding: 5px 0; }
.cal-tile-day { display: block; font-size: 36px; font-weight: 700; line-height: 1; padding: 10px 0 2px; color: var(--text); }
.cal-tile-dow { display: block; font-size: 13px; font-weight: 600; color: var(--mid); padding-bottom: 10px; }
.cal-tile.is-small { width: 52px; border-radius: 12px; }
.cal-tile.is-small .cal-tile-mon { font-size: 11px; padding: 2px 0; }
.cal-tile.is-small .cal-tile-day { font-size: 22px; padding: 5px 0 6px; }

/* ─── Diálogo de entrar (solo sin sesión) ───────────────────── */
.auth-dialog {
  margin: auto; /* el reset de style.css (* { margin: 0 }) quita el centrado de <dialog> */
  width: min(460px, calc(100vw - 32px)); padding: 28px; border: 0; border-radius: 28px;
  background: var(--bg-card); color: var(--text); box-shadow: 0 30px 80px rgba(2,6,23,.4);
}
.auth-dialog::backdrop { background: rgba(2,6,23,.55); }
.auth-dialog-inner { display: flex; flex-direction: column; gap: 16px; }
.auth-dialog-close {
  position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: var(--bg-2); color: var(--text); display: grid; place-items: center; cursor: pointer;
}
.auth-dialog-plan { display: flex; gap: 14px; align-items: center; padding-right: 48px; }
.auth-dialog-plan img { width: 52px; height: 64px; object-fit: cover; border-radius: 8px; flex: none; }
.auth-dialog-plan img[hidden] { display: none; }
.auth-dialog-plan small { display: block; font-size: 13px; font-weight: 600; color: var(--going); }
:root[data-theme="dark"] .auth-dialog-plan small { color: #93C5FD; }
.auth-dialog-plan strong { display: block; font-size: 14px; line-height: 1.3; }
.auth-dialog-plan span { display: block; font-size: 13px; color: var(--muted); }
.auth-dialog h2 { margin: 4px 0 0; font-size: 26px; line-height: 1.15; font-weight: 700; }
.auth-dialog p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--mid); }
.auth-dialog-row { display: flex; gap: 8px; }
.auth-dialog-row input {
  flex: 1; min-width: 0; font: inherit; font-size: 16px; min-height: 52px; padding: 0 16px;
  border-radius: 14px; border: 1px solid var(--border-light); background: var(--bg-card); color: var(--text);
}
.auth-dialog-row button {
  font: inherit; font-size: 15px; font-weight: 600; min-height: 52px; padding: 0 20px;
  border-radius: 14px; border: 0; background: var(--primary); color: #fff; cursor: pointer;
}
@media (max-width: 768px) {
  .auth-dialog { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 28px 28px 0 0; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
}
.auth-google {
  min-height: 52px; border-radius: 16px; border: 1px solid var(--border-light); background: var(--bg-card);
  color: var(--text); font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 10px;
}
.auth-google:hover { background: var(--bg-2); }
.auth-divider { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.auth-dialog .auth-small { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.auth-dialog .auth-small a { color: var(--accent-text); font-weight: 600; }

/* ─── Aviso breve (showToast, en el pie) ────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 400; transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 14px;
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600; box-shadow: var(--shadow);
}
.toast[hidden] { display: none; }
@media (max-width: 768px) {
  .toast { bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom) + 12px); }
}
