/* Colores alineados con la app de escritorio (tema oscuro + acento azul) */
:root {
  --portal-bg: #0f1419;
  --portal-bg-soft: #161d26;
  --portal-card: #161d26;
  --portal-raised: #1c2530;
  --portal-border: #2a3441;
  --portal-text: #f3f4f6;
  --portal-muted: #94a3b8;
  --portal-accent: #3b82f6;
  --portal-accent-hover: #2563eb;
  --portal-brand: #9a7b4f;
  --portal-danger: #f87171;
  --portal-success: #4ade80;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--portal-text);
  background: radial-gradient(ellipse at top, #1a2332 0%, var(--portal-bg) 55%);
}

.portal-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.portal-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--portal-border);
  background: rgba(15, 20, 25, 0.85);
  backdrop-filter: blur(8px);
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--portal-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9375rem;
}

.portal-brand img { display: block; }

.portal-badge {
  font-size: 0.75rem;
  color: var(--portal-brand);
  border: 1px solid rgba(154, 123, 79, 0.45);
  background: rgba(154, 123, 79, 0.12);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
}

.portal-main {
  flex: 1;
  padding: 1.5rem 1.25rem 2rem;
}

.portal-page--center .portal-main {
  display: flex;
  align-items: center;
  justify-content: center;
}

.portal-card {
  width: 100%;
  max-width: 420px;
  background: var(--portal-card);
  border: 1px solid var(--portal-border);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.portal-card--wide { max-width: 560px; }

.portal-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 700;
}

.portal-lead {
  margin: 0 0 1.25rem;
  color: var(--portal-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.portal-field { margin-bottom: 0.9rem; }

.portal-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--portal-muted);
  margin-bottom: 0.35rem;
}

.portal-field input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--portal-border);
  background: var(--portal-bg);
  color: var(--portal-text);
  font: inherit;
  font-size: 0.95rem;
}

.portal-field input:focus {
  outline: none;
  border-color: var(--portal-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.portal-field input.code-input {
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.78rem 1rem;
  border: 0;
  border-radius: 10px;
  background: var(--portal-accent);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.portal-btn:hover { background: var(--portal-accent-hover); }

.portal-btn--ghost {
  width: auto;
  margin-top: 1rem;
  background: transparent;
  border: 1px solid var(--portal-border);
  color: var(--portal-muted);
}

.portal-btn--ghost:hover {
  background: var(--portal-raised);
  color: var(--portal-text);
}

.portal-btn--sm {
  width: auto;
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  background: transparent;
  border: 1px solid var(--portal-border);
  color: var(--portal-muted);
}

.portal-btn--sm:hover {
  background: var(--portal-raised);
  color: var(--portal-text);
}

.portal-err {
  color: var(--portal-danger);
  font-size: 0.875rem;
  margin-bottom: 0.85rem;
}

.portal-hint {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--portal-muted);
  line-height: 1.45;
}

.portal-steps {
  margin: 0 0 1rem;
  padding-left: 1.2rem;
  color: var(--portal-muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.portal-steps code {
  color: #cbd5e1;
  font-size: 0.8125rem;
}

.portal-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.portal-head h1 {
  margin: 0;
  font-size: 1.15rem;
}

.portal-sub {
  color: var(--portal-muted);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.portal-wrap {
  max-width: 560px;
  margin: 0 auto;
}

.portal-card h2 {
  margin: 0;
  font-size: 1rem;
}

.portal-amount {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--portal-danger);
  margin-top: 0.65rem;
}

.portal-ok { color: var(--portal-success); }

.portal-list {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  border: 1px solid var(--portal-border);
  border-radius: 10px;
  overflow: hidden;
}

.portal-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--portal-border);
  font-size: 0.875rem;
}

.portal-list li:last-child { border-bottom: 0; }

.portal-section-title {
  font-size: 0.875rem;
  margin: 1.25rem 0 0.5rem;
}

.portal-foot {
  padding: 1rem 1.25rem 1.25rem;
  text-align: center;
  color: var(--portal-muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--portal-border);
}

@media (max-width: 640px) {
  .portal-brand span { display: none; }
  .portal-top { padding: 0.85rem 1rem; }
}

/* —— Portal residente (anuncios, reparaciones) —— */
.portal-page--resident .portal-main {
  padding-top: 1rem;
}

.portal-wrap--wide { max-width: 680px; }

.portal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 1.25rem 0.75rem;
  border-bottom: 1px solid var(--portal-border);
  background: rgba(15, 20, 25, 0.6);
}

.portal-nav__link {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  color: var(--portal-muted);
  text-decoration: none;
  border: 1px solid transparent;
}

.portal-nav__link:hover {
  color: var(--portal-text);
  background: var(--portal-raised);
}

.portal-nav__link.is-active {
  color: #fff;
  background: var(--portal-accent);
  border-color: rgba(59, 130, 246, 0.5);
}

.portal-nav__link--muted { margin-left: auto; }

.portal-feed { display: flex; flex-direction: column; gap: 1rem; }

.portal-post {
  background: var(--portal-card);
  border: 1px solid var(--portal-border);
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
}

.portal-post__head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.portal-post__head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.portal-post__time {
  font-size: 0.75rem;
  color: var(--portal-muted);
  white-space: nowrap;
}

.portal-post__notes,
.portal-post__body {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: #dbeafe;
}

.portal-post__image {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  margin-top: 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--portal-border);
}

.portal-post__pdf {
  width: 100%;
  height: 420px;
  margin-top: 0.85rem;
  border: 1px solid var(--portal-border);
  border-radius: 10px;
  background: #fff;
}

.portal-link {
  display: inline-block;
  margin-top: 0.65rem;
  color: var(--portal-accent);
  font-size: 0.875rem;
}

.portal-post__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--portal-border);
}

.portal-inline-form { margin: 0; }

.portal-action-btn {
  border: 1px solid var(--portal-border);
  background: var(--portal-raised);
  color: var(--portal-text);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.portal-action-btn.is-liked {
  border-color: rgba(244, 63, 94, 0.5);
  color: #fda4af;
}

.portal-action-meta { font-size: 0.8125rem; color: var(--portal-muted); }

.portal-comments {
  list-style: none;
  margin: 0.85rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.portal-comments li {
  background: var(--portal-bg);
  border: 1px solid var(--portal-border);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  font-size: 0.875rem;
}

.portal-comments p { margin: 0.35rem 0 0; }

.portal-comment-time {
  font-size: 0.7rem;
  color: var(--portal-muted);
  margin-left: 0.35rem;
}

.portal-comment-form {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.portal-comment-form textarea,
.portal-form textarea,
.portal-form select {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--portal-border);
  background: var(--portal-bg);
  color: var(--portal-text);
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
}

.portal-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.portal-tabs__link {
  flex: 1;
  text-align: center;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--portal-border);
  color: var(--portal-muted);
  text-decoration: none;
  font-size: 0.875rem;
}

.portal-tabs__link.is-active {
  background: var(--portal-accent);
  border-color: rgba(59, 130, 246, 0.5);
  color: #fff;
}

.portal-repairs {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.portal-repair {
  border: 1px solid var(--portal-border);
  border-left-width: 4px;
  border-radius: 10px;
  padding: 0.85rem;
  background: var(--portal-bg);
}

.portal-repair--recibido { border-left-color: #fbbf24; }
.portal-repair--en_revision { border-left-color: #38bdf8; }
.portal-repair--resuelto { border-left-color: #4ade80; }

.portal-repair__head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
}

.portal-badge-status {
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--portal-raised);
  color: var(--portal-muted);
}

.portal-repair__meta {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  color: var(--portal-muted);
}

.portal-repair__desc {
  margin: 0.65rem 0 0;
  font-size: 0.875rem;
  line-height: 1.5;
}

.portal-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.portal-photo-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--portal-border);
}

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

.portal-demo-banner {
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px dashed rgba(251, 191, 36, 0.55);
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
  font-size: 0.8125rem;
  line-height: 1.45;
}

.portal-demo-banner--inline {
  max-width: 680px;
  margin: 0 auto 0.75rem;
}

.portal-building-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.portal-building-link {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--portal-border);
  background: var(--portal-raised);
  color: var(--portal-text);
  text-decoration: none;
}

.portal-building-link:hover {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.08);
}

.portal-building-link .muted {
  font-size: 0.8125rem;
  color: var(--portal-muted);
}

/* —— Amenidades / calendario —— */
.portal-amenity-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0;
}

.portal-amenity-tab {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--portal-border);
  background: var(--portal-raised);
  color: var(--portal-text);
  font-size: 0.8125rem;
  cursor: pointer;
}

.portal-amenity-tab.is-active {
  background: var(--portal-accent);
  border-color: rgba(59, 130, 246, 0.55);
  color: #fff;
}

.portal-cal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.portal-cal-sub {
  font-size: 0.8125rem;
  color: var(--portal-muted);
  margin-top: 0.2rem;
}

.portal-cal-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
}

.portal-cal-nav-btn {
  padding: 0.35rem 0.65rem;
  min-width: auto;
}

.portal-cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--portal-muted);
  margin-bottom: 0.65rem;
}

.portal-cal-legend .dot {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 4px;
  margin-right: 0.25rem;
  vertical-align: middle;
}

.dot-free { background: #fff; border: 1px solid var(--portal-border); }
.dot-pending { background: #fef3c7; border: 1px solid #fbbf24; }
.dot-busy { background: #fee2e2; border: 1px solid #f87171; }

.portal-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--portal-muted);
  margin-bottom: 0.25rem;
}

.portal-cal-cells {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
}

.portal-cal-cell {
  min-height: 3.4rem;
  border-radius: 10px;
  border: 1px solid var(--portal-border);
  background: var(--portal-card);
  padding: 0.25rem;
  text-align: left;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.portal-cal-cell--empty {
  border: none;
  background: transparent;
  min-height: 0;
  cursor: default;
}

.portal-cal-cell--libre:hover {
  border-color: rgba(59, 130, 246, 0.45);
}

.portal-cal-cell--ocupado,
.portal-cal-cell--pendiente,
.portal-cal-cell--pasado {
  cursor: not-allowed;
  opacity: 0.85;
}

.portal-cal-cell--ocupado { background: rgba(248, 113, 113, 0.15); border-color: rgba(248, 113, 113, 0.45); }
.portal-cal-cell--pendiente { background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.45); }
.portal-cal-cell--pasado { opacity: 0.45; }

.portal-cal-cell.is-selected {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.25);
}

.portal-cal-cell.is-today .portal-cal-daynum {
  background: #2563eb;
  color: #fff;
  border-radius: 999px;
}

.portal-cal-daynum {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
}

.portal-cal-tag {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1.2;
}

.portal-day-panel {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--portal-border);
  background: var(--portal-raised);
}

.portal-my-requests {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--portal-border);
}

.portal-my-requests h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.portal-request-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.portal-request-list li {
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 0.875rem;
}

.portal-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(4px);
}

.portal-modal[hidden] {
  display: none;
}

.portal-modal__card {
  width: min(420px, 100%);
  border-radius: 14px;
  border: 1px solid var(--portal-border);
  background: var(--portal-card);
  padding: 1.15rem;
}

.portal-modal__card h3 {
  margin: 0 0 0.35rem;
}

.portal-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
