/* =============================================
   북클래스 — 수업 일정·신청 페이지
   기준: docs/DESIGN.md 3장, docs/design/Classes.dc.html · MobileClasses.dc.html · MobileApply.dc.html
   공통 색·버튼·메뉴·FAQ·푸터는 style.css
   ============================================= */

:root {
  --st-open: #005F3D;      /* 모집 중 */
  --st-open-bg: #EAF4EF;
  --st-open-line: #C2DFD1;
  --st-wait: #F5C84C;      /* 대기 접수 */
  --st-wait-ink: #3D2E00;
  --st-wait-bg: #FFFBEF;
  --st-wait-line: #F0DCA0;
  --st-wait-btn: #D9A92A;
  --st-closed: #ECE7DA;    /* 마감 */
  --st-closed-ink: #5E594F;
  --st-closed-bg: #F5F3EE;
  --st-closed-line: #E4E4E0;
  --cell-line: #F0EBDF;
}

/* ── 소개 (초록 띠) ── */
.cl-intro { background: var(--green); color: #fff; }
.cl-intro-inner { padding: 72px 32px 64px; display: flex; flex-direction: column; gap: 20px; }
.cl-intro-eyebrow { font-size: 14px; font-weight: 700; color: var(--yellow); letter-spacing: 0.04em; }
.cl-intro-title { font-weight: 800; font-size: 48px; line-height: 1.3; letter-spacing: -0.02em; }
.cl-intro-sub { font-size: 17px; line-height: 1.75; color: var(--green-soft); max-width: 640px; }
.cl-intro-btns { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 6px; }
.cl-intro-btns .btn { min-height: 52px; padding: 0 24px; font-size: 16px; font-weight: 800; }
.cl-intro-link { display: inline-flex; align-items: center; min-height: 52px; padding: 0 8px; color: #fff; font-weight: 600; }
.cl-intro-link:hover { color: var(--yellow); }

/* 모바일 전용 탭 */
.cl-tabs { display: none; }

/* ── 학교급 섹션 ── */
.cl-section { padding: 72px 0 40px; scroll-margin-top: 80px; }
.cl-section + .cl-section { border-top: 1px solid var(--line); }
.cl-inner { display: flex; flex-direction: column; }

.cl-info { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.cl-card { flex: 2 1 520px; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 32px; }
.cl-card-top { display: flex; align-items: center; gap: 10px; }
.cl-card-top .level-badge { font-size: 14px; padding: 6px 14px; }
.cl-card-sub { font-size: 14px; color: var(--sub); }
.cl-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 22px; font-weight: 700; font-size: 22px; color: var(--title); }
.cl-flow i { font-style: normal; color: #B9B19E; }
.cl-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 22px; font-size: 14px; line-height: 1.75; color: var(--body); }
.cl-h3 { font-weight: 800; color: var(--title); margin-bottom: 4px; }

.cl-fee { flex: 1 1 300px; min-width: 0; background: var(--green-deep); color: #fff; border-radius: 24px; padding: 32px; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
.cl-fee-label { font-size: 14px; font-weight: 700; color: var(--yellow); }
.cl-fee-main { font-weight: 800; font-size: 28px; line-height: 1.4; }
.cl-fee-price { border-top: 1px solid rgba(255, 255, 255, 0.18); padding-top: 16px; font-size: 16px; color: var(--green-soft); }

/* ── 일정 머리 ── */
.cl-sched-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 64px; }
.cl-h2 { font-weight: 700; font-size: 32px; color: var(--title); letter-spacing: -0.02em; }
.cl-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 14px; font-weight: 600; }
.cl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.lg-open { background: var(--st-open); }
.lg-wait { background: var(--st-wait); }
.lg-closed { background: var(--st-closed); border: 1px solid var(--line-strong); }
.cl-notes { margin: 18px 0 0; padding: 20px 24px 20px 40px; background: var(--bg-beige); border-radius: 16px; font-size: 14px; line-height: 1.9; color: var(--body); }
.cl-notes b { font-weight: 700; color: var(--title); }
.cl-mobile-hint { display: none; }

/* ── 시간표 (PC) ── */
.cl-schedule { display: flex; flex-direction: column; gap: 36px; margin-top: 36px; }
.cl-loading, .cl-empty, .cl-error { padding: 24px; border-radius: 16px; background: var(--bg-beige); color: var(--sub); font-size: 15px; }
.cl-error a { color: var(--green); font-weight: 700; }
.cl-grade { display: flex; flex-direction: column; gap: 14px; }
.cl-grade-title { margin: 0; font-size: 20px; font-weight: 800; color: var(--title); }
.cl-table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.cl-table { min-width: 940px; display: flex; flex-direction: column; }
.cl-row { display: grid; grid-template-columns: 84px repeat(7, minmax(0, 1fr)); }
.cl-corner { padding: 14px; border-bottom: 1px solid var(--line); }
.cl-corner::before { content: '시간'; font-size: 13px; font-weight: 700; color: var(--mute); }
.cl-day { padding: 14px; text-align: center; font-size: 14px; font-weight: 800; border-bottom: 1px solid var(--line); background: var(--green-lt); color: var(--green); }
.cl-day.is-sat { background: var(--blue-lt); color: var(--blue); }
.cl-day.is-sun { background: var(--red-lt); color: var(--red); }
.cl-time { padding: 14px; font-size: 15px; font-weight: 800; color: var(--title); border-bottom: 1px solid var(--cell-line); display: flex; align-items: flex-start; }
.cl-cell { padding: 8px; min-height: 104px; border-bottom: 1px solid var(--cell-line); border-left: 1px solid var(--cell-line); display: flex; flex-direction: column; gap: 6px; }
.cl-row:last-child .cl-time, .cl-row:last-child .cl-cell { border-bottom: 0; }

.cl-slot { flex: 1; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; gap: 10px; border: 1px solid; }
.cl-badge { align-self: flex-start; font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.cl-slot-btn { min-height: 44px; border-radius: 10px; font: 700 13px 'Noto Sans KR', sans-serif; white-space: nowrap; cursor: pointer; background: #fff; padding: 0 4px; }
.cl-chip { display: none; }

.st-open { background: var(--st-open-bg); border-color: var(--st-open-line); }
.st-open .cl-badge { background: var(--st-open); color: #fff; }
.st-open .cl-slot-btn { color: var(--st-open); border: 1.5px solid var(--st-open); }
.st-open .cl-slot-btn:hover { background: var(--st-open); color: #fff; }
.st-wait { background: var(--st-wait-bg); border-color: var(--st-wait-line); }
.st-wait .cl-badge { background: var(--st-wait); color: var(--st-wait-ink); }
.st-wait .cl-slot-btn { color: var(--st-wait-ink); border: 1.5px solid var(--st-wait-btn); }
.st-wait .cl-slot-btn:hover { background: var(--st-wait); }
.st-closed { background: var(--st-closed-bg); border-color: var(--st-closed-line); }
.st-closed .cl-badge { background: var(--st-closed); color: var(--st-closed-ink); }
.st-closed .cl-slot-btn { background: transparent; color: var(--st-closed-ink); border: 1.5px solid var(--line-strong); }
.cl-badge.b-st-open { background: var(--st-open); color: #fff; }
.cl-badge.b-st-wait { background: var(--st-wait); color: var(--st-wait-ink); }
.cl-badge.b-st-closed { background: var(--st-closed); color: var(--st-closed-ink); }

.footer-admin { color: inherit; }

/* ── 반 정보 창 / 마감 안내 창 ── */
.cl-overlay { position: fixed; inset: 0; background: rgba(20, 35, 27, 0.45); z-index: 200; }
.cl-sheet {
  position: fixed; z-index: 210; background: #fff; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(440px, 100%); border-radius: 24px 24px 0 0; padding: 12px 20px 28px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.15); max-height: 90vh; overflow-y: auto; word-break: keep-all;
}
.cl-sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line-mid); margin: 0 auto 14px; }
.cl-sheet-body { display: flex; flex-direction: column; gap: 14px; }
.cl-sheet-title { font-size: 22px; font-weight: 800; color: var(--title); }
.cl-sheet-body p { font-size: 15px; line-height: 1.7; color: var(--body); }
.cl-sheet-btns { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.cl-btn {
  min-height: 54px; display: inline-flex; align-items: center; justify-content: center; padding: 0 22px;
  border-radius: 14px; border: 0; font: 800 16px 'Noto Sans KR', sans-serif; text-decoration: none; cursor: pointer;
}
.cl-btn-solid { background: var(--green); color: #fff; }
.cl-btn-solid:hover { background: var(--green-dark); color: #fff; }
.cl-btn-line { background: #fff; color: var(--body); border: 1px solid var(--line-mid); }
.cl-btn-kakao { background: var(--yellow); color: var(--yellow-ink); }
.cl-btn-kakao:hover { color: var(--yellow-ink); }
.cl-btn-text { min-height: 48px; background: #fff; color: var(--body); border: 1px solid var(--line-mid); font-weight: 700; font-size: 15px; }

/* ── 신청 패널 (PC 오른쪽 480px · 모바일 전체 화면) ── */
.cl-panel {
  position: fixed; z-index: 210; top: 0; right: 0; bottom: 0; width: min(480px, 100%);
  background: #fff; overflow-y: auto; box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
  display: flex; flex-direction: column; word-break: keep-all;
}
.cl-panel-head { padding: 20px 20px 22px 24px; background: var(--green); color: #fff; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; position: sticky; top: 0; z-index: 1; }
.cl-panel-kicker { font-size: 14px; font-weight: 700; color: var(--yellow); }
.cl-panel-title { font-size: 22px; font-weight: 800; margin: 6px 0 8px; }
.cl-panel-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--green-soft); }
.cl-panel-meta .cl-badge { background: #fff; color: var(--green); padding: 3px 9px; }
.cl-panel-meta .cl-badge.is-wait { background: var(--yellow); color: var(--yellow-ink); }
.cl-icon-btn { width: 44px; height: 44px; flex: none; border: 0; border-radius: 10px; background: transparent; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.cl-icon-btn:hover { background: rgba(255, 255, 255, 0.12); }

.cl-form { padding: 24px 24px 32px; display: flex; flex-direction: column; gap: 20px; }
.cl-field { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.cl-field > label, .cl-field > legend { font-size: 14px; font-weight: 700; color: var(--title); padding: 0; margin-bottom: 0; }
.cl-field > legend { margin-bottom: 8px; }
.cl-field em, .cl-consent em { color: var(--red); font-style: normal; }
.cl-opt { font-weight: 500; color: var(--mute); }
.cl-form input[type=text], .cl-form input[type=tel], .cl-form input[type=email], .cl-form select, .cl-form textarea {
  min-height: 50px; padding: 0 14px; border: 1.5px solid var(--line-mid); border-radius: 12px;
  font: 400 16px 'Noto Sans KR', sans-serif; background: #fff; color: var(--title); width: 100%;
}
#fGrade { border-color: var(--green); font-weight: 600; }
.cl-form textarea { padding: 12px 14px; resize: vertical; }
.cl-form input:focus, .cl-form select:focus, .cl-form textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(0, 95, 61, 0.12); }
.cl-form .is-invalid { border-color: var(--red) !important; }
.cl-help { font-size: 13px; color: var(--sub); }
.cl-err { display: none; font-size: 13px; color: var(--red); }
.cl-err.show { display: block; }
.cl-days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.cl-days label { position: relative; }
.cl-days input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.cl-days span { min-height: 44px; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--line-mid); border-radius: 10px; font-size: 15px; font-weight: 700; color: var(--body); background: #fff; }
.cl-days input:checked + span { border-color: var(--green); background: var(--green); color: #fff; }
.cl-days input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.cl-time-range { display: flex; align-items: center; gap: 8px; }
.cl-time-range select { flex: 1 1 0; min-width: 0; }
.cl-time-range span { font-size: 15px; color: var(--mute); flex: none; }
.cl-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cl-privacy { padding: 16px; border-radius: 14px; background: var(--bg-beige); font-size: 13px; line-height: 1.75; color: var(--body); display: flex; flex-direction: column; gap: 2px; }
.cl-privacy-title { font-weight: 800; color: var(--title); margin-bottom: 4px; }
.cl-consent { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; font-weight: 700; color: var(--title); cursor: pointer; }
.cl-consent input { width: 22px; height: 22px; accent-color: var(--green); margin: 0; }
.cl-form-error { padding: 12px 14px; border-radius: 12px; background: var(--red-lt); color: #8A1C13; font-size: 14px; }
.cl-submit { min-height: 56px; border: 0; border-radius: 14px; background: var(--green); color: #fff; font: 800 17px 'Noto Sans KR', sans-serif; cursor: pointer; }
.cl-submit:hover:not(:disabled) { background: var(--green-dark); }
.cl-submit:disabled { opacity: 0.6; cursor: wait; }

/* ── 신청 완료 ── */
.cl-done { padding: 48px 28px 28px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; flex: 1 1 auto; }
.cl-done-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--green-lt); color: var(--green); display: flex; align-items: center; justify-content: center; }
.cl-done-title { font-size: 22px; font-weight: 800; color: var(--title); }
.cl-done-class { padding: 6px 14px; border-radius: 999px; background: var(--bg-beige); font-size: 14px; font-weight: 700; color: var(--green); }
.cl-done-class:empty { display: none; }
.cl-done-text { font-size: 15px; line-height: 1.75; color: var(--body); white-space: pre-line; }
.cl-done-btns { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }

/* =============================================
   모바일 (768px 이하): 칸에는 색깔과 시간만
   ============================================= */
@media (max-width: 768px) {
  .cl-intro-inner { padding: 32px 16px 28px; gap: 10px; }
  .cl-intro-eyebrow { font-size: 13px; letter-spacing: 0; }
  .cl-intro-title { font-size: 26px; line-height: 1.4; }
  .cl-intro-sub { font-size: 14px; line-height: 1.7; }
  .cl-intro-btns { display: none; }

  .cl-tabs {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
    position: sticky; top: 68px; z-index: 40; background: var(--bg); padding: 12px 16px; border-bottom: 1px solid var(--line);
  }
  .cl-tab { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 12px; background: #fff; border: 1px solid var(--line-mid); color: var(--body); text-decoration: none; font-weight: 700; font-size: 15px; }
  .cl-tab.is-on { background: var(--green); border-color: var(--green); color: #fff; font-weight: 800; }

  .cl-section { padding: 20px 0 24px; scroll-margin-top: 136px; }
  .cl-section + .cl-section { padding-top: 32px; }
  .cl-inner.wrap { padding: 0 16px; }
  .cl-info { gap: 0; }
  .cl-card { flex-basis: 100%; border-radius: 18px; padding: 20px; }
  .cl-card-top .level-badge { font-size: 13px; padding: 4px 12px; }
  .cl-card-sub { font-size: 13px; }
  .cl-flow { margin-top: 12px; font-size: 17px; font-weight: 800; gap: 6px; }
  .cl-two { display: none; }
  .cl-card-desc { margin-top: 6px; font-size: 14px; line-height: 1.7; color: var(--sub); }
  .cl-card-foot { border-top: 1px solid #EFEAE0; margin-top: 14px; padding-top: 12px; font-size: 14px; line-height: 1.6; color: var(--body); }
  .cl-fee { display: none; }

  .cl-sched-head { margin-top: 32px; flex-direction: column; align-items: flex-start; gap: 10px; }
  .cl-h2 { font-weight: 800; font-size: 20px; }
  .cl-legend { gap: 12px; font-size: 13px; }
  .lg { width: 12px; height: 12px; border-radius: 3px; }
  .cl-notes { margin-top: 12px; padding: 14px 14px 14px 30px; border-radius: 14px; font-size: 13px; line-height: 1.8; }
  .cl-notes .pc-li { display: none; }
  .cl-mobile-hint { display: block; margin: 14px 0 0; font-size: 13px; font-weight: 700; color: var(--green); }

  .cl-schedule { gap: 20px; margin-top: 20px; }
  .cl-grade { gap: 10px; }
  .cl-grade-title { font-size: 16px; }
  .cl-table-scroll { overflow: visible; border-radius: 14px; padding: 6px; }
  .cl-table { min-width: 0; gap: 4px; }
  .cl-row { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
  .cl-row > .cl-time, .cl-row > .cl-corner { display: none; }
  .cl-day { padding: 8px 0; border-radius: 8px; font-size: 13px; border-bottom: 0; }
  .cl-cell { min-height: 44px; padding: 0; border: 0; gap: 3px; }
  .cl-slot { display: none; }
  .cl-chip {
    display: block; width: 100%; min-height: 44px; padding: 0; border: 0; border-radius: 8px;
    font: 700 12px 'Noto Sans KR', sans-serif; letter-spacing: -0.02em; cursor: pointer;
  }
  .cl-chip.st-open { background: var(--st-open); color: #fff; }
  .cl-chip.st-wait { background: var(--st-wait); color: var(--st-wait-ink); }
  .cl-chip.st-closed { background: var(--st-closed); color: var(--st-closed-ink); text-decoration: line-through; }
  .cl-chip.is-picked { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--yellow); }

  .cl-panel { width: 100%; box-shadow: none; }
  .cl-panel-head { padding: 20px 16px 22px; }
  .cl-form { padding: 24px 16px 32px; }
}

/* ── PC: 마감 반 안내는 가운데 창으로 ── */
@media (min-width: 769px) {
  .cl-sheet {
    top: 50%; bottom: auto; transform: translate(-50%, -50%);
    width: min(440px, calc(100% - 32px)); border-radius: 20px; padding: 24px;
  }
  .cl-sheet-grip { display: none; }
}
