/* ============================================================
   style.css — Ben Kansai
   Modern dark theme: near-black surfaces, soft elevation, a
   vivid accent with a subtle glow, and a clean sans-serif.
   ============================================================ */

:root {
  --black: #f5f6f8;      /* primary text (light, on dark surfaces) */
  --white: #15181f;      /* card / surface background */
  --paper: #0a0b0f;      /* page background (darkest) */
  --line: #262a33;       /* subtle border/divider */
  --blue: #5b8cff;       /* accent (user-customizable from Setup) */
  --blue-soft: #1b2440;  /* pale accent tint for backgrounds */
  --gray: #9099ac;
  --unit: 8px;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--paper);
  color: var(--black);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3, h4,
.brand-name,
.nav-link,
button,
.page-title,
.setup-subtitle {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 700;
}

img, .pixel-icon {
  image-rendering: pixelated;
}

button, input, textarea {
  font-family: inherit;
}

.is-hidden {
  display: none !important;
}

/* ---------------- Header / Nav ---------------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding: 18px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

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

.brand-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

.main-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-link {
  background: transparent;
  border: 1px solid transparent;
  color: var(--gray);
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-link.is-active {
  background: var(--blue-soft);
  border-color: transparent;
  color: var(--blue);
}

.nav-link:hover {
  background: var(--white);
  color: var(--black);
}

.nav-link.is-active:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

/* ---------------- Layout ---------------- */

.page {
  max-width: 880px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.page-title {
  font-size: 28px;
  letter-spacing: -0.4px;
  margin: 0 0 8px;
}

.page-intro {
  color: var(--gray);
  margin: 0 0 32px;
  max-width: 640px;
}

.site-footer {
  text-align: center;
  padding: 24px;
  color: var(--gray);
  font-size: 13px;
  border-top: 1px solid var(--line);
}

/* ---------------- Steps ---------------- */

.step {
  margin-bottom: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--line);
}

.step:last-child {
  border-bottom: none;
}

.step-title {
  font-size: 14px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--gray);
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-sub {
  color: var(--gray);
  margin: 0 0 24px;
}

/* ---------------- Product cards ---------------- */

.product-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.product-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.product-card:hover {
  border-color: var(--blue);
}

.product-card.is-selected {
  border-color: var(--blue);
  background: var(--blue-soft);
  box-shadow: 0 0 0 1px var(--blue), 0 8px 24px -8px var(--blue);
}

.product-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-card-title {
  font-weight: 700;
  font-size: 16px;
}

.product-card-meta {
  color: var(--gray);
  font-size: 13px;
}

.product-card-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.product-card-price-row .badge {
  margin-left: 0;
}

.product-card-price {
  font-weight: 700;
  color: var(--blue);
  font-size: 15px;
  margin-top: 4px;
}

.product-card-price-row .product-card-price {
  margin-top: 0;
}

.info-card-price-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.info-card-price-row .badge {
  margin-left: 0;
}

.product-card-price.is-free s {
  font-weight: 400;
  color: var(--gray);
  margin-left: 6px;
}

.product-card-price s {
  font-weight: 400;
  color: var(--gray);
  margin-right: 6px;
}

/* ---------------- Product group sections (Lessons / Bundles) ---------------- */

.product-group-title {
  font-size: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--gray);
  margin: 28px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.product-group-title:first-of-type {
  margin-top: 8px;
}

.product-group-note {
  background: var(--blue-soft);
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 14px;
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.6;
}

.product-card-credit-note {
  color: var(--gray);
  font-size: 12px;
  margin-top: 2px;
}

.badge {
  display: inline-block;
  margin-left: 8px;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 3px 8px;
  border-radius: 999px;
  vertical-align: middle;
}

/* ---------------- Calendar ---------------- */

.calendar {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  padding: 20px;
  max-width: 420px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-weight: 700;
}

.calendar-nav-btn {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  width: 32px;
  height: 32px;
  color: var(--black);
  cursor: pointer;
  font-weight: 700;
}

.calendar-nav-btn:hover {
  background: var(--blue-soft);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar-weekday {
  text-align: center;
  font-size: 12px;
  color: var(--gray);
  padding-bottom: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  font-size: 13px;
  cursor: not-allowed;
  color: var(--gray);
}

.calendar-day.is-disabled {
  background: var(--paper);
}

.calendar-day.is-available {
  border-color: var(--line);
  color: var(--black);
  cursor: pointer;
}

.calendar-day.is-available:hover {
  background: var(--blue-soft);
}

.calendar-day.has-booking {
  position: relative;
}

.calendar-day.has-booking::after {
  content: "";
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
}

.calendar-day.is-booked {
  background: var(--blue-soft);
  border-color: var(--blue);
  color: var(--blue);
  cursor: not-allowed;
}

.calendar-day.is-selected {
  background: var(--blue) !important;
  border-color: var(--blue) !important;
  color: var(--white) !important;
}

.calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--gray);
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  display: inline-block;
  border-radius: 3px;
  border: 1px solid var(--line);
}

.legend-available { background: var(--white); }
.legend-booked { background: var(--blue-soft); border-color: var(--blue); }
.legend-selected { background: var(--blue); border-color: var(--blue); }
.legend-disabled { background: var(--paper); border-color: var(--line); }

/* ---------------- Time slots ---------------- */

.time-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 480px;
}

.time-slot {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--black);
  padding: 12px 8px;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.time-slot:hover {
  background: var(--blue-soft);
}

.time-slot.is-selected {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.time-slot.is-disabled {
  color: var(--line);
  border-color: var(--line);
  cursor: not-allowed;
  text-decoration: line-through;
}

.empty-note {
  color: var(--gray);
}

/* ---------------- Form ---------------- */

.booking-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--blue-soft);
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 24px;
  max-width: 480px;
  line-height: 1.5;
}

.booking-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 480px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.field-row {
  display: flex;
  gap: 14px;
}

.field-row .field {
  flex: 1;
}

.payment-amount {
  font-size: 20px;
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 20px;
}

/* The payment form groups its inputs in wrapper divs; give those
   the same vertical rhythm as the surrounding form fields. */
#payment-contact-fields,
#payment-card-fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.field input,
.field textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--black);
  padding: 12px 14px;
  font-size: 15px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}

.btn-primary, .btn-secondary {
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--black);
  color: var(--paper);
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
}

.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
}

.btn-primary:hover {
  filter: brightness(1.12);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  border-color: var(--line);
  color: var(--black);
  margin-top: 16px;
}

.btn-secondary:hover {
  background: var(--white);
  border-color: var(--gray);
}

/* ---------------- Confirmation ---------------- */

.booking-confirmation {
  text-align: center;
  border: 1px solid var(--blue);
  border-radius: var(--radius);
  background: var(--blue-soft);
  padding: 48px 24px;
  max-width: 480px;
}

.booking-confirmation h3 {
  margin: 16px 0 8px;
}

.muted {
  color: var(--gray);
  font-size: 14px;
}

/* ---------------- Info cards (Products / Calendar) ---------------- */

.info-card-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-card {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  padding: 20px;
}

.info-card-body h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.info-card-body p {
  margin: 0 0 8px;
  color: var(--gray);
}

.info-card-facts {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
}

.info-card-facts li {
  margin-bottom: 4px;
}

/* ---------------- Bundle section (Products screen) ---------------- */

.bundle-section {
  margin-top: 36px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.bundle-section-title {
  font-size: 20px;
  margin: 0 0 8px;
}

.bundle-section-note {
  background: var(--blue-soft);
  border-left: 3px solid var(--blue);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 16px;
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.6;
}

/* ---------------- Setup screen ---------------- */

.setup-subtitle {
  font-size: 18px;
  margin: 40px 0 8px;
}

.settings-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  padding: 20px;
  margin-bottom: 8px;
}

.settings-card h3 {
  margin: 0 0 4px;
}

.accent-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.accent-swatch {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
}

.accent-swatch.is-active {
  outline: 2px solid var(--black);
  outline-offset: 2px;
}

.accent-custom {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  max-width: 240px;
}

.accent-custom input[type="color"] {
  width: 48px;
  height: 36px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  cursor: pointer;
}

/* ---------------- Availability settings ---------------- */

.availability-hours {
  display: flex;
  gap: 14px;
  margin: 16px 0;
  max-width: 360px;
}

.availability-hours .field {
  flex: 1;
}

.availability-hours select {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--black);
  padding: 10px;
  font-size: 15px;
}

.availability-weekdays {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.weekday-toggle {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--black);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.weekday-toggle.is-on {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.availability-error {
  color: #ef6b6b;
  font-weight: 700;
  margin-top: 12px;
}

.setup-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setup-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  padding: 20px;
}

.setup-card h3 {
  margin: 0 0 4px;
}

.env-table {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.env-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 12px;
  font-size: 13px;
  align-items: baseline;
}

.env-row code {
  background: var(--black);
  color: var(--white);
  padding: 4px 8px;
  font-size: 12px;
  white-space: nowrap;
}

.env-row span {
  color: var(--gray);
}

/* ============================================================
   Pixel icons
   Built from a single 8x8 grid via clip-path so silhouettes
   read as blocky / pixel-art, scaled per use.
   ============================================================ */

.pixel-icon {
  display: inline-block;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background-color: var(--blue);
}

.icon-logo {
  width: 28px;
  height: 28px;
  clip-path: polygon(
    25% 0%, 75% 0%, 75% 25%, 100% 25%, 100% 75%, 75% 75%,
    75% 100%, 25% 100%, 25% 75%, 0% 75%, 0% 25%, 25% 25%
  );
}

/* Free Trial Lesson — wrapped gift box: lid + body + horizontal
   ribbon (host), vertical ribbon (::before), bow on top (::after). */
.icon-trial {
  position: relative;
  background-color: transparent;
  background-image: linear-gradient(
    to bottom,
    transparent 0% 22%,        /* room for the bow */
    var(--black) 22% 32%,      /* lid */
    var(--blue) 32% 54%,       /* upper body */
    var(--black) 54% 64%,      /* horizontal ribbon */
    var(--blue) 64% 100%       /* lower body */
  );
}

.icon-trial::before {
  content: "";
  position: absolute;
  left: 44%;
  top: 22%;
  width: 12%;
  height: 78%;
  background: var(--black);     /* vertical ribbon */
}

.icon-trial::after {
  content: "";
  position: absolute;
  left: 28%;
  top: 3%;
  width: 44%;
  height: 22%;
  background: var(--blue);      /* bow-tie shape */
  clip-path: polygon(0% 0%, 50% 50%, 100% 0%, 100% 100%, 50% 50%, 0% 100%);
}

/* Paid 50 Minutes Lesson — memo paper with ruled lines (host) and a
   pen lying diagonally across it (::before). */
.icon-private {
  position: relative;
  background-color: var(--white);
  border: 1px solid var(--line);
  border-radius: 6px;
  background-image: linear-gradient(
    to bottom,
    transparent 0% 20%, var(--blue) 20% 28%,
    transparent 28% 46%, var(--blue) 46% 54%,
    transparent 54% 72%, var(--blue) 72% 80%,
    transparent 80% 100%
  );
}

.icon-private::before {
  content: "";
  position: absolute;
  left: 42%;
  top: -6%;
  width: 16%;
  height: 112%;
  background-image: linear-gradient(
    to bottom,
    var(--black) 0% 14%,       /* cap */
    var(--blue) 14% 82%,       /* body */
    var(--black) 82% 100%      /* nib tip */
  );
  clip-path: polygon(0% 0%, 100% 0%, 100% 80%, 50% 100%, 0% 80%);
  transform: rotate(38deg);
  transform-origin: center;
}

/* 4 Lessons a Month — a 2x2 grid of squares */
.icon-coin {
  background: transparent;
  background-image:
    linear-gradient(var(--blue), var(--blue)),
    linear-gradient(var(--blue), var(--blue)),
    linear-gradient(var(--blue), var(--blue)),
    linear-gradient(var(--blue), var(--blue));
  background-repeat: no-repeat;
  background-size: 16px 16px;
  background-position: 2px 2px, 22px 2px, 2px 22px, 22px 22px;
}

/* 8 Lessons a Month — a 4x2 grid of (smaller) squares */
.icon-coins {
  background: transparent;
  background-image:
    linear-gradient(var(--blue), var(--blue)),
    linear-gradient(var(--blue), var(--blue)),
    linear-gradient(var(--blue), var(--blue)),
    linear-gradient(var(--blue), var(--blue)),
    linear-gradient(var(--blue), var(--blue)),
    linear-gradient(var(--blue), var(--blue)),
    linear-gradient(var(--blue), var(--blue)),
    linear-gradient(var(--blue), var(--blue));
  background-repeat: no-repeat;
  background-size: 7px 7px;
  background-position:
    2px 11px, 11px 11px, 20px 11px, 29px 11px,
    2px 22px, 11px 22px, 20px 22px, 29px 22px;
}

.icon-check {
  clip-path: polygon(
    0% 50%, 25% 25%, 40% 55%, 80% 0%, 100% 20%, 40% 100%
  );
  background-color: var(--black);
}

.icon-calendar-sync {
  clip-path: polygon(
    0% 12.5%, 100% 12.5%, 100% 100%, 0% 100%
  );
}

.icon-meet {
  clip-path: polygon(
    0% 20%, 60% 20%, 60% 0%, 100% 30%, 100% 70%, 60% 100%, 60% 80%, 0% 80%
  );
}

.icon-mail {
  clip-path: polygon(
    0% 0%, 100% 0%, 100% 100%, 0% 100%
  );
  background-color: var(--black);
}

.icon-future {
  clip-path: polygon(
    50% 0%, 65% 15%, 55% 15%, 55% 40%, 80% 40%, 80% 30%,
    100% 50%, 80% 70%, 80% 60%, 55% 60%, 55% 85%, 65% 85%, 50% 100%,
    35% 85%, 45% 85%, 45% 60%, 20% 60%, 20% 70%, 0% 50%, 20% 30%,
    20% 40%, 45% 40%, 45% 15%, 35% 15%
  );
}

/* ---------------- Credit-dot grid (lesson bundles) ---------------- */
/* Redesigned from a reference "credit" graphic to match the
   site's square / pixel motif and black-white-blue palette. */

.credit-icon {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

.credit-icon-8 {
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  width: 56px;
  height: 32px;
  gap: 3px;
}

.credit-dot {
  background: var(--blue);
  border: 2px solid var(--blue);
}

.credit-dot.is-free {
  background: var(--white);
  border: 2px solid var(--black);
}

/* ---------------- Responsive ---------------- */

@media (max-width: 640px) {
  .product-list {
    grid-template-columns: 1fr;
  }

  .time-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .site-header {
    padding: 16px 16px;
  }

  .page {
    padding: 28px 16px 60px;
  }

  .env-row {
    grid-template-columns: 1fr;
  }
}
