.student-page { min-height: 100vh; }
.student-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 68px; padding: 12px max(24px, calc((100% - 1120px) / 2));
  background: var(--ink); color: var(--on-dark);
}
.student-top .brand { margin: 0; }
.student-top > .btn { background: var(--ink-3); color: var(--on-dark); border-color: var(--on-dark-muted); }
.student-main { max-width: 1168px; margin: 0 auto; padding: 32px 24px 48px; }
.student-page :where(h1, h2, h3) { font-family: var(--font-display); line-height: 1.15; }
.student-page :where(h1) { font-size: clamp(2.25rem, 6vw, 4.4rem); letter-spacing: -.055em; overflow-wrap: anywhere; }
.student-page h2 { font-size: clamp(1.35rem, 3.3vw, 1.8rem); letter-spacing: -.029em; }
.student-page h3 { font-size: 1.1rem; letter-spacing: -.014em; overflow-wrap: anywhere; }
.student-page p { line-height: 1.5; }
.student-page small { line-height: 1.45; }
.student-muted, .student-empty { color: var(--muted); }
.student-empty { padding: 8px 0; }
.student-hero {
  min-height: 235px; display: grid; align-content: end; gap: 12px; padding: clamp(24px, 6vw, 54px);
  background: linear-gradient(90deg, rgb(10 18 14 / .95), rgb(10 18 14 / .54) 62%, rgb(10 18 14 / .32)),
    var(--ink-3) url('/login-arena.webp') center 57% / cover no-repeat;
  color: var(--on-dark); border-radius: 20px;
}
.student-hero p { max-width: 42ch; }
.student-section { display: grid; gap: 14px; }
.student-hero + .student-section, .student-section + .student-section { margin-top: 26px; }
.student-arena-grid, .student-plan-grid, .student-court-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 238px), 1fr)); gap: 12px;
}
.student-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: clamp(16px, 3.5vw, 26px); box-shadow: var(--shadow-card); }
.student-arena-card { display: grid; gap: 12px; justify-items: start; }
.student-arena-mark {
  display: grid; place-items: center; width: 44px; height: 44px;
  color: var(--ink); background: var(--lime-tint); border-radius: 12px;
  font-weight: 700; letter-spacing: .04em;
}
.student-arena-head { display: grid; gap: 12px; margin-block: 4px 24px; }
.student-page .student-arena-head button { justify-self: start; padding-inline: 0; }
.student-nav {
  display: flex; width: fit-content; max-width: 100%; flex-wrap: wrap; gap: 4px;
  padding: 4px; margin-bottom: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--sand);
}
.student-nav button {
  min-height: 40px; padding: 7px 13px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); font-weight: 600;
}
.student-nav button:hover { background: var(--surface); color: var(--ink); }
.student-nav button[aria-current] { background: var(--ink-3); color: var(--on-dark); }
.student-view > .student-card + .student-card { margin-top: 12px; }
.student-card > .btn { justify-self: start; }
.student-meta { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; color: var(--muted); }
.student-badge {
  display: inline-flex; align-items: center; padding: 4px 9px; border-radius: var(--r-pill);
  background: var(--block-bg); color: var(--block); white-space: nowrap; font-size: .77rem; font-weight: 700;
}
.student-badge[data-status="ok"], .student-badge[data-status="paid"] { background: var(--paid-bg); color: var(--paid-ink); }
.student-badge[data-status="pending"], .student-badge[data-status="awaiting_card"] { background: var(--pend-bg); color: var(--pend-ink); }
.student-badge[data-status="blocked"], .student-badge[data-status="declined"], .student-badge[data-status="late"] { background: var(--danger-bg); color: var(--danger); }
.student-rows { margin: 0; padding: 0; list-style: none; }
.student-rows li {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px 14px; padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}
.student-rows li:last-child { border-bottom: 0; }
.student-rows li small { display: block; margin-top: 3px; color: var(--muted); }
.student-row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.student-date { max-width: 216px; }
.student-court { background: var(--canvas); border: 1px solid var(--border); padding: 16px; border-radius: 12px; }
.student-court h3 + p { margin-top: 4px; }
.student-slots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.student-plan { display: grid; gap: 7px; align-content: start; }
.student-plan .btn { justify-self: start; margin-top: 6px; }
.student-profile { display: grid; gap: 14px; max-width: 560px; }
.student-profile .btn { justify-self: start; }
.student-page .field input, .student-page .field select { max-width: 100%; min-width: 0; }

.student-notice { padding: 12px 14px; margin-bottom: 14px; border-radius: 10px; background: var(--paid-bg); color: var(--paid-ink); }
.student-notice.is-error { background: var(--danger-bg); color: var(--danger); }
.student-dialog {
  width: min(calc(100% - 32px), 540px); max-height: min(calc(100dvh - 32px), 760px); margin: auto;
  border: 1px solid var(--border); border-radius: 18px; padding: clamp(16px, 5vw, 26px);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop);
}
.student-dialog::backdrop { background: rgb(10 18 14 / .66); }
.student-dialog form { display: grid; gap: 14px; }
.student-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.student-dialog-head .btn { flex-shrink: 0; }
.student-dialog h2 { overflow-wrap: anywhere; padding-top: 5px; }
.student-dialog .student-notice { margin: 0; }
.student-dialog fieldset { min-width: 0; margin: 0; padding: 10px; border: 1px solid var(--border); border-radius: 10px; }
.student-weekly { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.student-checkbox { display: flex; align-items: center; gap: 7px; min-height: 38px; }

@media (max-width: 640px) {
  .student-top { min-height: 62px; padding-inline: 16px; }
  .student-main { padding: 16px 16px 32px; }
  .student-nav { width: 100%; }
  .student-nav button { flex: 1 1 auto; }
}
@media (max-width: 420px) {
  .student-weekly { grid-template-columns: 1fr; }
}

/* Portal do aluno */
.student-page {
  --student-green: #166348;
  --student-mist: #e6f2eb;
  --student-line: #dce5de;
  background: #f3f6f2;
}
.student-page .btn:not(.login-submit) { border-color: #cedbd2; border-radius: 10px; }
.student-page .btn.primary { background: var(--student-green); border-color: var(--student-green); color: white; }
.student-page .btn.primary:hover { background: #104e39; border-color: #104e39; }
.student-page .btn.link { border-color: transparent; color: var(--student-green); }
.student-page .student-top > .btn { border-color: rgb(255 255 255 / .26); }
.student-page .btn svg, .student-search svg, .student-shortcut svg, .student-nav svg { width: 20px; height: 20px; }
.student-top { background: #11261e; }
.student-top .brand-tld { opacity: .7; }

/* Shared login layout and palette from the staff sign-in. */
@media (min-width: 741px) {
  html:has(body[data-student-view="auth"]) { scrollbar-gutter: stable; }
}
.student-page[data-student-view="auth"] { background: var(--canvas); }
.student-top:has(#student-signout[hidden]), .student-page[data-student-view="auth"] .student-main > .student-notice { display: none; }
.student-page[data-student-view="auth"] .student-main { max-width: none; padding: 0; }
.student-auth .login-photo { height: calc(100dvh - 36px); align-self: start; }
.student-auth .login-form small { margin-top: -9px; color: var(--muted); }
.student-auth .login-form [aria-invalid="true"] { border-color: var(--danger); }
.student-auth-mode { margin-top: 18px; color: var(--muted); font-size: .91rem; }
.student-auth-mode button {
  min-height: 36px; padding: 0 4px; border: 0; background: transparent;
  color: var(--paid-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px;
}
.student-auth-staff {
  display: inline-block; margin-top: 12px; color: var(--muted); font-size: .82rem;
  text-decoration: underline; text-underline-offset: 3px;
}

@media (min-width: 741px) and (max-height: 820px) {
  .student-auth .login-content { grid-template-rows: auto 1fr; padding-block: 18px; }
  .student-auth .login-panel { align-self: center; padding-block: 16px; }
  .student-auth .login-form { margin-top: 22px; gap: 12px; }
}

.student-hero {
  min-height: 252px; align-content: center;
  background: linear-gradient(90deg, #10281f 0%, rgb(16 40 31 / .94) 28%, rgb(16 40 31 / .57) 70%),
    #10281f url('/login-arena.webp') center 54% / cover no-repeat;
}
.student-page .student-hero h1 { color: #fff; font-size: clamp(2.2rem, 5.35vw, 4.2rem); }
.student-hero p { color: #f0f7ee; font-size: 1.05rem; }
.student-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.student-search {
  display: flex; align-items: center; gap: 9px; width: min(100%, 300px); padding: 0 12px;
  border: 1px solid var(--student-line); border-radius: 10px; background: white; color: var(--muted);
}
.student-search:focus-within { outline: 2px solid var(--student-green); outline-offset: 2px; }
.student-search input { min-width: 0; width: 100%; min-height: 42px; border: 0; outline: none; background: transparent; }
.student-arena-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 255px), 1fr)); }
.student-card { border-color: var(--student-line); }
.student-arena-card { grid-template-columns: auto 1fr; align-items: center; align-content: center; gap: 12px 14px; }
.student-arena-card .btn { grid-column: 1 / -1; justify-self: stretch; justify-content: space-between; color: var(--student-green); }
.student-arena-mark { color: #164b35; background: var(--student-mist); }

.student-arena-head { margin: 0 0 20px; gap: 8px; }
.student-arena-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.student-arena-identity h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
.student-arena-identity .student-arena-mark { flex-shrink: 0; width: 50px; height: 50px; }
.student-layout { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: 18px; align-items: start; }
.student-nav {
  display: grid; width: 100%; gap: 4px; margin: 0; padding: 6px;
  background: var(--surface); border-color: var(--student-line);
}
.student-nav button { display: flex; align-items: center; gap: 10px; min-height: 44px; border-radius: 9px; text-align: left; }
.student-nav button:hover { background: #f3f7f3; }
.student-nav button[aria-current] { background: var(--student-mist); color: #104a34; }
.student-view { min-width: 0; }

.student-welcome {
  border-radius: 18px; padding: clamp(20px, 4vw, 36px);
  background: linear-gradient(95deg, #10392e 15%, rgb(16 57 46 / .95) 54%, rgb(16 57 46 / .28)),
    #10392e url('/login-arena.webp') center 58% / cover no-repeat;
  color: #f7fbf7;
}
.student-welcome > div { display: grid; gap: 8px; justify-items: start; }
.student-page .student-welcome :is(h2, h3) { color: white; }
.student-welcome h2 { font-size: clamp(1.8rem, 4vw, 2.65rem); }
.student-welcome p { color: #d2f5dd; margin-top: 8px; }
.student-welcome h3 { font-size: clamp(1.15rem, 3vw, 1.5rem); }
.student-welcome .btn.primary { margin-top: 10px; background: #d5f75a; border-color: #d5f75a; color: #142b20; }
.student-welcome .btn.primary:hover { background: #e6fd8d; border-color: #e6fd8d; }
.student-shortcuts { display: grid; gap: 12px; margin-top: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.student-shortcut {
  display: grid; grid-template-columns: 1fr auto; align-content: start; gap: 7px 8px;
  text-align: left; color: #10281f; min-height: 130px;
}
.student-shortcut:hover { border-color: #79ab90; background: #f9fcf9; }
.student-shortcut strong { grid-column: 1 / -1; font-size: 1.02rem; }
.student-shortcut small { grid-column: 1 / -1; color: var(--muted); }
.student-shortcut > svg { grid-row: 1; grid-column: 2; align-self: center; color: var(--student-green); }
.student-shortcut-icon { display: grid; place-items: center; width: 36px; height: 36px; color: var(--student-green); background: var(--student-mist); border-radius: 9px; }

.student-date-strip { display: flex; gap: 8px; overflow-x: auto; min-width: 0; padding: 4px; margin: -4px; }
.student-date-strip button {
  flex: 0 0 auto; min-width: 56px; min-height: 56px; display: grid; place-content: center; gap: 2px; text-align: center;
  border: 1px solid var(--student-line); border-radius: 10px; background: #f4f7f4; color: #2b4e3b;
}
.student-date-strip button[aria-pressed="true"] { background: var(--student-green); border-color: var(--student-green); color: white; }
.student-date-strip small, .student-day-card small { text-transform: capitalize; }
.student-lesson-rows li {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px 12px;
  margin: 0 0 8px; padding: 9px 10px; border: 1px solid var(--student-line); border-radius: 12px;
  background: #fafcf9;
}
.student-lesson-rows li:last-child { border-bottom: 1px solid var(--student-line); }
.student-day-card {
  display: grid; align-content: center; justify-items: center; min-height: 49px;
  border-radius: 9px; background: var(--student-mist); color: #164b35;
}
.student-day-card small { margin: 0; color: inherit; }
.student-lesson-detail { overflow-wrap: anywhere; }
.student-lesson-detail > strong { font-weight: 650; }
.student-view .student-court, .student-view .student-plan { background: #f5f8f3; border-color: var(--student-line); }

@media (max-width: 700px) {
  .student-page[data-student-view="arena"] .student-main { padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .student-layout { display: block; }
  .student-nav {
    position: fixed; z-index: 5; inset: auto 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)); border-radius: 0; border: 0; border-top: 1px solid var(--student-line);
    box-shadow: 0 -6px 20px rgb(16 40 31 / .08);
  }
  .student-nav button { display: grid; justify-items: center; align-content: center; gap: 3px; text-align: center; font-size: .73rem; padding: 4px 2px; }
  .student-shortcuts { grid-template-columns: 1fr; }
  .student-shortcut { min-height: 0; grid-template-columns: 36px 1fr auto; align-items: center; gap: 3px 12px; }
  .student-shortcut strong { grid-column: 2; }
  .student-shortcut small { grid-column: 2; }
  .student-shortcut-icon { grid-row: 1 / 3; }
  .student-shortcut > svg { grid-row: 1 / 3; grid-column: 3; }
}
@media (max-width: 440px) {
  .student-hero { min-height: 200px; padding: 24px; }
  .student-hero p { font-size: .95rem; }
  .student-lesson-rows li { grid-template-columns: 45px minmax(0, 1fr); }
  .student-lesson-rows li > .btn { grid-column: 2; justify-self: start; }
}
