:root {
  --sky-top: #d9f4ff;
  --sky-mid: #8fd4f8;
  --sea: #1287b8;
  --sea-deep: #0b628c;
  --foam: #f4fcff;
  --ink: #0d4668;
  --sun: #ffe08a;
  --card: rgba(255, 255, 255, 0.92);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.harbor {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Segoe UI", "PingFang TC", "Microsoft JhengHei", sans-serif;
  background:
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 38%, #5ec4ef 52%, var(--sea) 52.2%, var(--sea-deep) 100%);
}

a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 6vw;
  background: rgba(217, 244, 255, 0.88);
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.15;
}

.brand small { letter-spacing: 0.12em; font-size: 0.75rem; }

.brand strong { font-size: 1.25rem; }

.sail-btn,
.enroll button {
  border: 0;
  border-radius: 999px;
  background: var(--sea-deep);
  color: white;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.sail-btn { padding: 10px 18px; }

.enroll > .sail-btn {
  display: inline-block;
  margin: 0 0 20px;
}

.enroll form { margin: 0 0 16px; }

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: end;
  width: min(1080px, calc(100% - 8vw));
  margin: 0 auto;
  padding: 36px 0 0;
}

.hero h1 {
  margin: 8px 0 12px;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.05;
}

.eyebrow {
  margin: 0;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.lead { margin: 0 0 20px; font-size: 1.05rem; max-width: 36rem; }

.yacht {
  width: min(100%, 460px);
  height: auto;
  justify-self: center;
  filter: drop-shadow(0 16px 0 rgba(11, 98, 140, 0.18));
}

.waves {
  height: 84px;
  margin-top: -8px;
  background:
    radial-gradient(circle at 12px 8px, var(--foam) 10px, transparent 11px) 0 0 / 48px 28px repeat-x,
    radial-gradient(circle at 28px 18px, #7fd4f2 12px, transparent 13px) 0 18px / 64px 36px repeat-x,
    linear-gradient(var(--sea), var(--sea-deep));
}

.enroll {
  width: min(760px, calc(100% - 8vw));
  margin: 8px auto 48px;
  padding: 28px 22px 32px;
  border-radius: 28px;
  background: var(--card);
  box-shadow: 0 18px 40px rgba(8, 70, 104, 0.18);
}

.enroll h2 { margin: 0 0 6px; font-size: clamp(1.6rem, 3vw, 2.1rem); }

.error-code {
  margin: 0 0 8px;
  font-size: clamp(3rem, 8vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.04em;
}

.enroll .hint { margin: 0 0 18px; }

.notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #e5f8e8;
  color: #146233;
}

.apply-block {
  margin: 18px 0;
  padding: 16px 18px;
  border: 2px solid #b7e4f6;
  border-radius: 18px;
  background: white;
}

.apply-block h3 { margin: 0 0 8px; }

.apply-block .sail-btn { display: inline-block; margin-top: 12px; }

.apply-status { margin: 0; font-weight: 800; }

.apply-status.ready { color: #146233; }

.apply-status.missing { color: #b42318; }

.course-description { white-space: pre-wrap; }

.captcha-box {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 16px;
}

.captcha-box img {
  width: 220px;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.captcha-box label { width: min(220px, 100%); }

.id-photo {
  width: 132px;
  height: 185px;
  object-fit: cover;
  border: 2px solid #b7e4f6;
  border-radius: 12px;
  background: white;
}

.is-off { display: none !important; }

.photo-progress {
  width: min(220px, 100%);
  height: 10px;
  border-radius: 999px;
  background: #d7eef7;
  overflow: hidden;
}

.photo-progress-bar {
  width: 0;
  height: 100%;
  background: var(--sea-deep);
}

.enroll button.photo-remove {
  width: auto;
  min-height: 0;
  margin-top: 8px;
  padding: 8px 14px;
}

.enroll button.captcha-refresh,
.harbor-modal button.captcha-refresh {
  width: auto;
  min-height: 0;
  padding: 8px 14px;
  font-size: 0.95rem;
}

.harbor-modal {
  width: min(560px, calc(100vw - 32px));
  border: 0;
  border-radius: 24px;
  padding: 22px 20px;
  color: var(--ink);
  background: white;
}

.harbor-modal::backdrop { background: rgba(8, 40, 64, 0.55); }

.harbor-modal h3 { margin: 0 0 12px; }

.harbor-modal p { margin: 0 0 8px; }

.harbor-modal button[type="submit"].sail-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  min-width: 0;
}

fieldset.fields {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}

.fields > * {
  min-width: 0;
  max-width: 100%;
}

.fields label,
.span-2 { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }

.span-2 { grid-column: 1 / -1; }

input, select, textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 2px solid #b7e4f6;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: var(--ink);
  background: white;
}

textarea { min-height: 96px; resize: vertical; }

.req { color: #b42318; margin-left: 2px; }

.field-error { color: #b42318; font-weight: 600; font-size: 0.9rem; }

.field-note { font-weight: 600; font-size: 0.9rem; }

.enroll button {
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  min-height: 48px;
  font-size: 1.05rem;
}

.enroll button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dock {
  margin: 0;
  padding: 8px 6vw 28px;
  text-align: center;
  color: var(--foam);
}

.panel {
  width: min(1080px, calc(100% - 8vw));
  margin: 18px auto 48px;
}

.page-actions { margin-bottom: 16px; }

.class-board { width: 100%; margin: 0; }

.table-wrap { overflow-x: auto; }

.class-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.class-table th,
.class-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #d5f0fa;
  text-align: left;
  vertical-align: top;
  font-weight: 600;
}

.class-table th { font-size: 0.85rem; }

.sail-btn.compact {
  display: inline-block;
  padding: 8px 14px;
  white-space: nowrap;
}

.class-table button.sail-btn {
  width: auto;
  min-height: 0;
  grid-column: auto;
  font-size: 1rem;
}

.enroll-state { font-weight: 800; }

.fields .field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; }

.phone-line {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

.phone-line input { width: auto; min-width: 0; }
.phone-line .dial { width: 88px; flex: 0 0 88px; }
.phone-line input:not(.dial) { flex: 1 1 0; width: 0; }

.gender-options {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-weight: 600;
}

.gender-options label {
  flex-direction: row;
  align-items: center;
  gap: 6px;
}

.gender-options input { width: auto; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-top: 20px; }
  .hero-copy { order: 1; }
  .yacht { order: 2; width: min(100%, 320px); }
  .fields { grid-template-columns: 1fr; }
  .topbar { padding: 12px 4vw; }
  .panel,
  main > .enroll {
    width: calc(100% - 32px);
    max-width: 100%;
  }
  .enroll,
  .panel .enroll {
    max-width: 100%;
    padding: 22px 16px 26px;
  }
  .panel .enroll {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  .enroll button:not(.sail-btn):not(.photo-remove),
  .enroll > .sail-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    text-align: center;
  }
  .phone-line .dial { width: 72px; flex-basis: 72px; }
  .class-table { min-width: 0; }
  .class-table thead { display: none; }
  .class-table tr {
    display: block;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #d5f0fa;
  }
  .class-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
    border: 0;
    padding: 6px 0;
  }
  .class-table td .sail-btn {
    max-width: 100%;
  }
  .class-table td::before {
    content: attr(data-label);
    font-size: 0.8rem;
    font-weight: 700;
  }
}
