:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --surface: #ffffff;
  --ink: #202320;
  --muted: #66706a;
  --line: #dfe4dc;
  --accent: #0f766e;
  --accent-2: #b45309;
  --accent-soft: #d9f4ef;
  --shadow: 0 18px 60px rgba(31, 41, 38, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 96px;
  padding: 12px 5vw;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  font-weight: 800;
  flex: 0 0 auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  color: white;
  background: var(--accent);
}

.brand-logo {
  display: block;
  width: 118px;
  height: auto;
}

.nav {
  display: flex;
  gap: 20px;
  margin-left: auto;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav a:hover {
  color: var(--ink);
}

.close-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
}

.auth-open {
  min-height: 40px;
  padding: 0 14px;
}

.dashboard-open {
  min-height: 40px;
  padding: 0 14px;
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  background: var(--accent-soft);
}

.notification-button {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--line));
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 900;
}

.notification-button strong,
#dashboardNotificationBadge {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--accent-2);
  font-size: 0.72rem;
  line-height: 1;
}

.notification-button strong {
  position: absolute;
  top: -7px;
  right: -7px;
}

.auth-status {
  max-width: 180px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dialog .button.secondary {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  background: var(--accent-soft);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  align-items: end;
  gap: 36px;
  min-height: calc(100vh - 72px);
  padding: 9vh 5vw 8vh;
  background:
    linear-gradient(rgba(14, 28, 25, 0.62), rgba(14, 28, 25, 0.38)),
    url("https://images.unsplash.com/photo-1523580846011-d3a5bc25702b?auto=format&fit=crop&w=1800&q=80") center / cover;
  color: white;
}

.hero h1 {
  max-width: 840px;
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5.8rem);
  line-height: 1;
}

.hero p {
  max-width: 680px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.12rem;
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent-2);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #fbbf24;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
}

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

.button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.button.secondary {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  background: var(--accent-soft);
}

.hero .button.secondary {
  color: white;
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.12);
}

.card .button.secondary {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  background: var(--accent-soft);
}

.hero-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(16px);
}

.hero-panel div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.hero-panel strong {
  font-size: 2rem;
}

.search-band,
.promote,
.community,
.publish,
.dashboard-page,
.compatibility {
  padding: 72px 5vw 0;
}

.legal-page {
  padding: 64px 5vw;
}

.legal-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 30px rgba(31, 41, 38, 0.08);
}

.legal-content h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.legal-content h2 {
  margin: 34px 0 10px;
  font-size: 1.22rem;
}

.legal-content p {
  color: var(--muted);
  line-height: 1.75;
}

.legal-updated {
  margin-top: 0;
  font-weight: 800;
}

.is-hidden {
  display: none !important;
}

.section-heading h1,
.section-heading h2 {
  max-width: 760px;
  margin: 0 0 24px;
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.filters,
.publish-form,
.community-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.locked-form {
  position: relative;
}

.locked-form.is-locked form {
  filter: blur(1.2px);
  opacity: 0.78;
  pointer-events: none;
  user-select: none;
}

.auth-gate {
  display: none;
}

.locked-form.is-locked .auth-gate {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 68%, transparent);
  backdrop-filter: blur(4px);
}

.auth-gate h3,
.auth-gate p {
  max-width: 520px;
  margin: 0 auto;
}

.auth-gate p {
  color: var(--muted);
  line-height: 1.55;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.form-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 13px;
  color: var(--ink);
  background: var(--bg);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.content-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  padding: 28px 5vw 0;
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 96px;
  display: grid;
  gap: 20px;
}

.sidebar h2,
.tip h3 {
  margin: 0;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-group button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
}

.chip-group button.active {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tip {
  padding: 18px;
  border-left: 4px solid var(--accent);
  background: var(--surface);
}

.tip p,
.promote-card p,
.compat-grid p {
  color: var(--muted);
  line-height: 1.6;
}

.listings-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.listings-top p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.community-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 24px;
  align-items: start;
}

.promote-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.promote-card {
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 30px rgba(31, 41, 38, 0.08);
}

.promote-card h3,
.promote-card p {
  margin: 0;
}

.promote-card strong {
  color: var(--accent);
  font-size: 2rem;
  line-height: 1;
}

.featured-plan {
  border-color: color-mix(in srgb, var(--accent-2) 55%, var(--line));
  box-shadow: 0 16px 50px rgba(180, 83, 9, 0.18);
}

.community-board {
  min-width: 0;
}

.student-cards {
  display: grid;
  gap: 14px;
}

.student-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 30px rgba(31, 41, 38, 0.08);
}

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

.student-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  color: white;
  background: var(--accent);
  font-weight: 900;
}

.image-avatar {
  object-fit: cover;
}

.profile-preview {
  width: 100%;
  max-height: 220px;
  border-radius: 8px;
  object-fit: cover;
}

.image-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.image-strip img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  object-fit: cover;
}

.student-title {
  min-width: 0;
  margin-right: auto;
}

.student-title h3,
.community-form h3 {
  margin: 0;
}

.student-title p,
.student-card > p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.match-score {
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 900;
  white-space: nowrap;
}

.student-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.student-facts span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  font-size: 0.82rem;
}

.student-facts strong {
  color: var(--ink);
  font-size: 0.95rem;
}

.community-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  position: sticky;
  top: 96px;
}

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 30px rgba(31, 41, 38, 0.08);
}

.card.featured {
  border-color: color-mix(in srgb, var(--accent-2) 70%, var(--line));
  box-shadow: 0 18px 54px rgba(180, 83, 9, 0.18);
}

.featured-ribbon {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  padding: 8px 10px;
  border-radius: 8px;
  color: #1f1300;
  background: #fbbf24;
  font-size: 0.78rem;
  font-weight: 900;
}

.card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--line);
}

.card-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.price {
  color: var(--accent);
  font-size: 1.45rem;
  font-weight: 900;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.interest-box {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.interest-box strong {
  font-size: 0.9rem;
}

.mini-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mini-list span {
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface);
  font-size: 0.78rem;
  font-weight: 700;
}

.interest-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button.small {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.85rem;
}

.tag {
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--muted);
  background: var(--bg);
  font-size: 0.78rem;
  font-weight: 700;
}

.complete-tag {
  color: #7c2d12;
  background: #ffedd5;
}

.check-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.check-option input {
  width: 18px;
  height: 18px;
}

.publish-form {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.wide {
  grid-column: 1 / -1;
}

.compat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 72px;
}

.compat-grid article {
  padding: 22px;
  border-top: 4px solid var(--accent);
  background: var(--surface);
}

.compat-grid h3 {
  margin: 0;
}

.dialog {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.group-dialog {
  width: min(680px, calc(100vw - 32px));
}

.dashboard-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.dashboard-menu,
.dashboard-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
  box-shadow: 0 8px 30px rgba(31, 41, 38, 0.08);
}

.dashboard-menu {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 10px;
  align-self: start;
}

.dashboard-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: var(--bg);
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.dashboard-menu button.active {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dashboard-view h3 {
  margin-top: 0;
}

.profile-form {
  display: grid;
  gap: 14px;
}

.dashboard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-tabs button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--muted);
  background: var(--bg);
  cursor: pointer;
}

.dashboard-tabs button.active {
  color: var(--ink);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.conversation-list {
  display: grid;
  gap: 10px;
  max-height: 460px;
  overflow: auto;
}

.conversation-item,
.notification-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.notification-list {
  display: grid;
  gap: 10px;
  max-height: 520px;
  overflow: auto;
}

.notification-item.unread {
  border-color: color-mix(in srgb, var(--accent-2) 55%, var(--line));
  background: color-mix(in srgb, var(--accent-2) 10%, var(--bg));
}

.notification-item h3,
.notification-item p {
  margin: 0;
}

.notification-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.reply-box {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.reply-box textarea {
  min-height: 76px;
}

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

.conversation-head h3,
.conversation-item p {
  margin: 0;
}

.conversation-item p {
  color: var(--muted);
  line-height: 1.45;
}

.unread-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-2);
}

.group-summary {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  background: var(--bg);
}

.group-summary p {
  margin: 0;
  color: var(--muted);
}

.chat-window {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.chat-message {
  display: grid;
  gap: 4px;
  padding: 10px;
  border-radius: 8px;
  background: var(--surface);
}

.chat-message strong {
  font-size: 0.86rem;
}

.chat-message p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.invite-panel,
.request-panel {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: 8px;
  background: var(--accent-soft);
}

.invite-panel p,
.request-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.invite-code {
  min-height: 22px;
  color: var(--accent);
  font-weight: 900;
}

.dialog::backdrop {
  background: rgba(0, 0, 0, 0.48);
}

.dialog form {
  display: grid;
  gap: 16px;
}

.close-button {
  justify-self: end;
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 28px 5vw;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links a {
  color: var(--muted);
  font-weight: 800;
}

.footer-links a:hover {
  color: var(--accent);
}

@media (max-width: 980px) {
  .hero,
  .content-grid,
  .dashboard-layout,
  .community-layout {
    grid-template-columns: 1fr;
  }

  .filters,
  .publish-form,
  .community-form,
  .promote-grid,
  .compat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar {
    position: static;
  }

  .community-form {
    position: static;
  }

  .dashboard-menu {
    position: static;
  }
}

@media (max-width: 680px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(142px, 1fr) repeat(4, auto);
    align-items: center;
    min-height: auto;
    gap: 8px;
    padding: 10px 4vw;
    flex-wrap: wrap;
  }

  .brand {
    grid-column: 1;
    min-width: 142px;
    overflow: hidden;
  }

  .brand-logo {
    width: min(138px, 40vw);
    flex: 0 0 auto;
  }

  .notification-button {
    width: 36px;
    height: 36px;
  }

  .auth-open,
  .dashboard-open,
  #headerLogout {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.86rem;
  }

  .dashboard-open {
    font-size: 0;
  }

  .dashboard-open::before {
    content: "Panel";
    font-size: 0.82rem;
  }

  #headerLogout {
    font-size: 0;
    width: 48px;
    padding: 0;
  }

  #headerLogout::before {
    content: "Salir";
    font-size: 0.78rem;
  }

  .nav {
    grid-column: 1 / -1;
    order: initial;
    width: 100%;
    gap: 14px;
    font-size: 0.86rem;
    white-space: nowrap;
    overflow-x: auto;
    margin-left: 0;
    padding: 2px 0 4px;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    flex: 0 0 auto;
  }

  .hero {
    min-height: 720px;
    padding: 56px 4vw 36px;
  }

  .search-band,
  .promote,
  .community,
  .publish,
  .dashboard-page,
  .compatibility,
  .legal-page,
  .content-grid,
  .footer {
    padding-left: 4vw;
    padding-right: 4vw;
  }

  .legal-content {
    padding: 24px;
  }

  .filters,
  .publish-form,
  .community-form,
  .promote-grid,
  .cards,
  .student-facts,
  .compat-grid {
    grid-template-columns: 1fr;
  }

  .listings-top,
  .footer {
    align-items: stretch;
    flex-direction: column;
  }
}
