:root {
  color-scheme: light;
  --ink: #1d1f45;
  --muted: #62615c;
  --line: #e6e3dd;
  --paper: #ffffff;
  --soft: #f6f7f8;
  --accent: #355253;
  --accent-dark: #243b3c;
  --warm: #f0b39e;
  --sun: #f5cc00;
  --green: #287d4f;
  --danger: #b42318;
  --shadow: 0 18px 44px rgba(53, 82, 83, 0.14);
}

* {
  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;
  color: var(--ink);
  background: #fafafa;
}

button,
input,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px clamp(14px, 4vw, 42px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: white;
  font-size: 1.18rem;
  font-weight: 900;
  background: var(--accent);
  border-radius: 8px;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: var(--muted);
  font-size: 0.95rem;
}

.brand strong {
  color: var(--ink);
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1;
}

nav {
  display: flex;
  gap: 10px;
}

nav a,
.primary-link,
button {
  min-height: 36px;
  border-radius: 8px;
}

nav a {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--ink);
  text-decoration: none;
}

nav a:hover {
  background: var(--soft);
}

.hero {
  display: grid;
  min-height: calc(100vh - 72px);
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  align-items: center;
  gap: clamp(28px, 5vw, 80px);
  padding: clamp(28px, 6vw, 76px) clamp(18px, 6vw, 84px);
  background:
    linear-gradient(125deg, rgba(0, 109, 119, 0.1), transparent 48%),
    linear-gradient(180deg, #ffffff 0%, #eef6f7 100%);
}

.hero-media {
  min-height: 420px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(229, 107, 63, 0.22), transparent 26%),
    linear-gradient(140deg, #0f4950, #5ca4a9 54%, #f4d35e);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.calendar-card {
  width: min(78%, 430px);
  padding: 22px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.18);
}

.calendar-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.calendar-top span {
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
}

.calendar-top strong {
  font-size: 2.4rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 20px;
}

.calendar-grid span {
  display: grid;
  height: 62px;
  place-items: center;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 800;
}

.hero-copy {
  max-width: 650px;
}

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

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: 0;
}

h3 {
  margin-bottom: 6px;
  font-size: 1.1rem;
}

.hero-copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1.65;
}

.primary-link,
.submit-button,
.secondary-button,
.danger-button,
.filter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  font-weight: 800;
}

.primary-link,
.submit-button {
  padding: 0 20px;
  color: white;
  background: var(--accent);
}

.primary-link:hover,
.submit-button:hover {
  background: var(--accent-dark);
}

.section {
  padding: clamp(46px, 7vw, 88px) clamp(18px, 6vw, 84px);
}

.schedule-section,
.compact-section {
  padding-top: clamp(18px, 3vw, 34px);
  padding-bottom: clamp(18px, 3vw, 34px);
}

.section-heading {
  margin-bottom: 14px;
}

.section-heading.compact {
  margin-bottom: 18px;
}

.section-heading.compact h2 {
  font-size: 1.55rem;
}

.schedule-tools {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter {
  flex: 0 0 auto;
  padding: 0 12px;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
}

.filter.is-active,
.filter:hover {
  color: var(--ink);
  background: var(--sun);
  border-color: var(--sun);
}

.timetable-wrap {
  margin-bottom: 0;
  overflow-x: auto;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #fbf6ec;
  box-shadow: var(--shadow);
}

.timetable {
  display: grid;
  min-width: 990px;
  grid-template-columns: 104px repeat(9, minmax(98px, 1fr));
  border-top: 1px solid var(--accent);
  border-left: 1px solid var(--accent);
}

.time-head,
.day-head,
.time-cell,
.slot-cell,
.break-cell {
  border-right: 1px solid var(--accent);
  border-bottom: 1px solid var(--accent);
}

.time-head,
.day-head,
.time-cell,
.break-cell {
  background: #f6eadc;
}

.day-head {
  display: grid;
  min-height: 50px;
  place-items: center;
  align-content: center;
  gap: 2px;
  padding: 8px;
}

.day-head strong {
  font-size: 1.12rem;
}

.day-head span {
  font-size: 0.82rem;
  font-weight: 800;
}

.time-cell {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  padding: 8px;
  font-weight: 900;
}

.slot-cell {
  display: grid;
  min-height: 52px;
  align-content: stretch;
  gap: 4px;
  padding: 5px;
  background: #fbf6ec;
}

.break-cell {
  grid-column: span 9;
  display: grid;
  min-height: 30px;
  place-items: center;
  color: var(--accent);
  background: #f6eadc;
  font-size: 1rem;
  font-weight: 900;
}

.subject-chip {
  display: grid;
  min-height: 20px;
  place-items: center;
  padding: 4px 6px;
  color: #061018;
  border: 1px solid rgba(0, 0, 0, 0.28);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 900;
  text-align: center;
}

.subject-mat-acad-manana,
.subject-mat-acad-tarde {
  background: #f0b39e;
}

.subject-mat-ccss-manana,
.subject-mat-ccss-tarde {
  color: white;
  background: #355253;
}

.subject-fisica-manana {
  background: #f5cc00;
}

.subject-quimica-primera,
.subject-quimica-media {
  background: #ffffff;
}

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

.course-card,
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 26px rgba(23, 33, 43, 0.06);
}

.course-card {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  padding: 18px;
}

.course-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.tag {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: var(--accent-dark);
  background: #dff2f0;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
}

.course-card h3 {
  min-height: 52px;
}

.meta-list {
  display: grid;
  gap: 9px;
  margin: 12px 0 16px;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.meta-list strong {
  color: var(--ink);
}

.note {
  margin-top: auto;
  padding: 10px;
  color: #6b3b16;
  background: #fff2df;
  border: 1px solid #f4c98b;
  border-radius: 8px;
  font-size: 0.92rem;
}

.signup-band {
  background: #f6f7f8;
}

.signup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.6fr);
  gap: 18px;
}

.panel {
  padding: clamp(14px, 2vw, 22px);
}

form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 800;
}

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

input:focus,
textarea:focus {
  outline: 3px solid rgba(0, 109, 119, 0.18);
  border-color: var(--accent);
}

.group-picker {
  display: grid;
  gap: 12px;
  padding-top: 8px;
}

.group-picker p,
.fine-print {
  color: var(--muted);
  line-height: 1.5;
}

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

.group-option {
  position: relative;
  display: grid;
  min-height: 96px;
  gap: 4px;
  padding: 12px 12px 12px 38px;
  background: #fbfdfe;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.group-option input {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 18px;
  height: 18px;
}

.group-option:has(input:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 109, 119, 0.14);
}

.group-option span {
  color: var(--muted);
  font-size: 0.84rem;
}

.capacity-meter {
  display: block;
  width: 100%;
  height: 8px;
  margin-top: 4px;
  overflow: hidden;
  background: #ece6dc;
  border-radius: 999px;
}

.capacity-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--sun), var(--accent));
  border-radius: inherit;
}

.group-option .capacity-text {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}

.group-option strong {
  line-height: 1.25;
}

.submit-button {
  width: 100%;
}

.form-status {
  min-height: 24px;
  margin: 0;
  color: var(--green);
  font-weight: 800;
}

.price-lines {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.price-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.price-line span {
  color: var(--muted);
}

.total-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px;
  color: white;
  background: var(--accent);
  border-radius: 8px;
}

.total-box strong {
  font-size: 1.45rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(29, 31, 69, 0.42);
}

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

.modal {
  width: min(100%, 460px);
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.modal h2 {
  margin-bottom: 14px;
  font-size: 1.8rem;
}

.confirmation-details {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.confirmation-details dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.confirmation-details dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.confirmation-details dt {
  color: var(--muted);
  font-weight: 800;
}

.confirmation-details dd {
  margin: 0;
  text-align: right;
  font-weight: 800;
}

.confirmation-details ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.registry-actions {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.search-field {
  min-width: min(100%, 320px);
}

.search-field input {
  min-height: 42px;
}

.secondary-button,
.danger-button {
  padding: 0 14px;
  border: 1px solid var(--line);
}

.secondary-button {
  color: var(--ink);
  background: white;
}

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

.small-button {
  min-height: 32px;
  padding: 0 10px;
  font-size: 0.86rem;
}

.table-wrap {
  overflow-x: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.paid-row td {
  background: #e4f3ea;
}

.unpaid-row td {
  background: #fde8e5;
}

.search-hit td {
  box-shadow: inset 0 0 0 2px var(--sun);
}

.payment-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-right: 8px;
  padding: 0 9px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
}

.empty-row {
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1050px) {
  .schedule-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero,
  .signup-layout {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  nav {
    width: 100%;
    justify-content: space-between;
  }

  nav a {
    padding: 0 8px;
  }

  .hero-media {
    min-height: 310px;
  }

  .calendar-card {
    width: 90%;
  }

  .schedule-grid,
  .group-options {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.35rem;
  }
}
