:root {
  --navy: #1f4e78;
  --navy-dark: #143a5d;
  --blue-100: #d9eaf7;
  --blue-50: #eaf3f8;
  --yellow: #fff2cc;
  --yellow-soft: #fff9e6;
  --red: #990000;
  --red-soft: #f4cccc;
  --green: #23755b;
  --green-soft: #e3f3ec;
  --ink: #17324a;
  --muted: #617487;
  --line: #cbdde9;
  --paper: #f4f8fb;
  --white: #ffffff;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }

body {
  min-height: 100%;
  margin: 0;
  background: radial-gradient(circle at 8% 0%, rgba(217, 234, 247, 0.95), transparent 34rem), var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

button, input { font: inherit; }
a { color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.site-shell { width: min(100% - 32px, 1060px); margin: 0 auto; padding: 38px 0 72px; }

.hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--navy-dark), var(--navy) 65%, #2a638f);
  color: var(--white);
  padding: clamp(30px, 7vw, 62px);
  box-shadow: 0 22px 60px rgba(31, 78, 120, 0.18);
}

.hero::after {
  content: "";
  position: absolute;
  width: 270px;
  height: 270px;
  right: -80px;
  top: -120px;
  border-radius: 50%;
  border: 45px solid rgba(217, 234, 247, 0.1);
}

.eyebrow, .section-label {
  margin: 0 0 9px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.75rem;
  font-weight: 800;
}

.hero h1 { position: relative; z-index: 1; max-width: 850px; margin: 0; font-size: clamp(2.25rem, 7vw, 4.7rem); line-height: 0.98; letter-spacing: -0.04em; }
.hero p:last-child { position: relative; z-index: 1; margin: 22px 0 0; color: var(--blue-100); font-weight: 700; line-height: 1.55; }
.hero-compact { padding-bottom: clamp(50px, 8vw, 72px); }

.login-card {
  position: relative;
  z-index: 2;
  margin: -24px 22px 0;
  padding: clamp(24px, 5vw, 40px);
  border: 1px solid rgba(31, 78, 120, 0.12);
  border-radius: 19px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 20px 44px rgba(31, 78, 120, 0.14);
}

.section-label { color: var(--navy); }
.login-card h2, .notice-card h2, .schedule h2 { margin: 0; font-size: clamp(1.55rem, 4vw, 2.25rem); letter-spacing: -0.025em; }
.login-card > div > p:not(.section-label) { margin: 9px 0 25px; color: var(--muted); }
.login-form label, .booking-form label { display: block; font-size: 0.85rem; font-weight: 800; }
.login-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }

.login-row input, .booking-form input {
  width: 100%;
  min-height: 50px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  padding: 0 14px;
  color: var(--ink);
  outline: none;
}

.login-row input { margin-top: 0; }
.login-row input:focus, .booking-form input:focus { border-color: var(--navy); box-shadow: 0 0 0 4px rgba(31, 78, 120, 0.12); }
.login-row button, .book-button { min-height: 50px; border: 0; border-radius: 10px; background: var(--navy); color: var(--white); padding: 0 24px; font-weight: 800; cursor: pointer; }
.login-row button:hover, .book-button:hover { background: var(--navy-dark); }
button:disabled { cursor: wait; opacity: 0.68; }
.form-error { margin: 13px 0 0 !important; color: var(--red) !important; font-size: 0.9rem; font-weight: 700; }

.locked-preview { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 30px 22px 0; min-height: 110px; border: 1px dashed var(--line); border-radius: 16px; color: var(--muted); background: rgba(255, 255, 255, 0.55); text-align: center; }
.locked-preview span { font-size: 1.35rem; }

.toolbar { display: flex; align-items: center; justify-content: space-between; margin: 15px 2px 27px; color: var(--muted); font-size: 0.85rem; }
.toolbar span { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.toolbar i { width: 9px; height: 9px; border-radius: 50%; background: #39a978; box-shadow: 0 0 0 4px rgba(57, 169, 120, 0.13); }
.toolbar button { border: 0; background: transparent; color: var(--navy); font-weight: 800; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.toolbar form { margin: 0; }

.notice-card { border: 1px solid #efdc9e; border-radius: 18px; background: linear-gradient(180deg, var(--yellow), var(--yellow-soft)); padding: clamp(24px, 5vw, 38px); }
.notice-card .section-label { color: #7f6000; }
.notice-card h2 { color: #604b0a; }
.notice-card p:not(.section-label) { margin: 17px 0 0; max-width: 900px; color: #4c4b42; line-height: 1.65; }

.schedule { margin-top: 42px; }
.schedule-title-row { display: grid; grid-template-columns: 1fr minmax(240px, 420px); align-items: end; gap: 30px; margin-bottom: 22px; }
.schedule-title-row > p { margin: 0; color: var(--muted); line-height: 1.55; text-align: right; }
.success-notice { margin-bottom: 16px; border: 1px solid #b8decf; border-radius: 12px; background: var(--green-soft); color: #175b45; padding: 14px 17px; font-weight: 800; }
.error-notice { margin-bottom: 16px; border: 1px solid #e8aaaa; border-radius: 12px; background: var(--red-soft); color: var(--red); padding: 14px 17px; font-weight: 800; }
.day-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 20px; }
.day-tab { display: grid; gap: 4px; border: 2px solid var(--line); border-radius: 14px; background: var(--white); color: var(--navy); padding: 15px 18px; text-decoration: none; }
.day-tab:hover { border-color: var(--navy); }
.day-tab small { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.day-tab strong { font-size: 1.05rem; }
.day-tab.active { border-color: var(--navy); background: var(--navy); color: var(--white); box-shadow: 0 8px 22px rgba(31, 78, 120, 0.18); }
.selected-day-title { margin: 0 0 14px; color: var(--navy-dark); font-size: 1.15rem; }
.slot-list { display: grid; gap: 13px; }

.slot-card { overflow: hidden; border: 1px solid var(--line); border-radius: 17px; background: var(--white); box-shadow: 0 8px 24px rgba(31, 78, 120, 0.06); }
.slot-card > header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 17px 20px; background: var(--blue-50); border-bottom: 1px solid var(--line); }
.slot-kicker { display: block; margin-bottom: 3px; color: var(--muted); font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.09em; }
.slot-card h3 { margin: 0; color: var(--navy); font-size: 1.2rem; }
.availability { flex: 0 0 auto; border-radius: 999px; background: var(--white); color: var(--navy); padding: 7px 11px; font-size: 0.78rem; font-weight: 800; }
.place-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); }
.place-grid > * { min-width: 0; padding: 20px; }

.free-place { display: block; min-height: 155px; border: 0; background: var(--white); color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; }
.free-place:hover { background: #f8fbfd; }
.free-place > strong { display: block; margin-top: 23px; color: var(--green); font-size: 1.35rem; }
.free-place > span:last-child { display: block; margin-top: 4px; color: var(--muted); font-size: 0.88rem; }
.place-status { color: var(--green); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.place-status span { display: inline-grid; width: 20px; height: 20px; margin-right: 5px; place-items: center; border-radius: 50%; background: var(--green); color: var(--white); }
.place-status.open { color: var(--navy); }

.booked-place { min-height: 155px; background: var(--red-soft); color: #5f0a0a; }
.booked-place .place-status { color: var(--red); }
.booked-place .place-status span { background: var(--red); }
.booked-place > strong { display: block; margin-top: 18px; font-size: 1.08rem; }
.booked-place dl { margin: 12px 0 0; }
.booked-place dl > div { display: grid; grid-template-columns: minmax(90px, 0.8fr) 1.2fr; gap: 12px; margin-top: 7px; }
.booked-place dt { color: #7f2b2b; font-size: 0.78rem; }
.booked-place dd { margin: 0; overflow-wrap: anywhere; font-size: 0.86rem; font-weight: 700; }
.booked-place > p { margin: 15px 0 0; color: #7f2b2b; font-size: 0.75rem; }
.download-form-button { width: 100%; min-height: 42px; margin-top: 14px; border: 1px solid var(--red); border-radius: 9px; background: var(--white); color: var(--red); padding: 8px 12px; font-size: 0.8rem; font-weight: 800; cursor: pointer; }
.download-form-button:hover { background: #fff5f5; }
.download-form-button:disabled { cursor: wait; opacity: 0.72; }

.booking-form { background: #f8fbfd; }
.booking-section { margin-top: 17px; padding: 0; border: 0; }
.booking-section h4, .booking-section legend { margin: 0 0 10px; color: var(--navy); font-size: 0.88rem; font-weight: 800; }
.booking-form label { margin-top: 14px; }
.backup-options > label { display: flex; align-items: center; gap: 9px; margin-top: 9px; font-weight: 700; }
.backup-options input[type="checkbox"] { flex: 0 0 auto; width: 18px; min-height: 18px; margin: 0; accent-color: var(--navy); }
.backup-options .custom-option { display: grid; grid-template-columns: 18px 1fr; align-items: center; }
.backup-options .custom-option input[type="text"] { min-height: 42px; margin: 0; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
.secondary-button { display: inline-grid; min-height: 44px; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--white); color: var(--navy); padding: 0 16px; font-weight: 800; text-decoration: none; cursor: pointer; }
.book-button { min-height: 44px; }

.break-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #e8aaaa; border-radius: 14px; background: var(--red-soft); color: var(--red); padding: 17px 20px; }
.break-row span { font-size: 0.8rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }

@media (max-width: 700px) {
  .site-shell { width: min(100% - 20px, 1060px); padding-top: 10px; }
  .hero { border-radius: 17px; padding: 28px 22px 48px; }
  .hero h1 { max-width: 9ch; }
  .hero p:last-child { font-size: 0.88rem; }
  .login-card { margin-inline: 10px; padding: 24px 18px; }
  .login-row { grid-template-columns: 1fr; }
  .locked-preview { margin-inline: 10px; }
  .schedule-title-row { grid-template-columns: 1fr; gap: 10px; }
  .schedule-title-row > p { text-align: left; }
  .place-grid { grid-template-columns: 1fr; }
  .free-place, .booked-place { min-height: 138px; }
}

@media (max-width: 430px) {
  .slot-card > header { padding: 15px; }
  .place-grid > * { padding: 17px 15px; }
  .form-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .break-row { padding-inline: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
