@charset "utf-8";

/* =========================================================
   wabi office — application form (/apply/, /en/apply/)
   Extends site.css. Every rule is scoped to .apply-page so it
   cannot reach the top page or the other form stylesheets.
   1. Shell
   2. Step indicator
   3. Form frame + steps
   4. Fields
   5. Choices (radio / checkbox / plan cards)
   6. Estimate
   7. Review
   8. Navigation + submit
   9. Thanks page
  10. Tablet (min-width: 640px) / Desktop (min-width: 1024px)
   ========================================================= */

/* 1. Shell ---------------------------------------------- */
.apply-page { padding-bottom: 32px; }

/* Several blocks below set display, which would beat the UA [hidden] rule. */
.apply-page [hidden] { display: none !important; }

.ap-shell {
  max-width: 760px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ap-head { display: flex; flex-direction: column; gap: 8px; }
.ap-lead { font-size: 14px; color: var(--ink-muted); }

.ap-alert {
  border: 1px solid #e0bdb4;
  border-radius: 12px;
  background: #fbf2f0;
  color: #7e2e1f;
  font-size: 13px;
  line-height: 1.7;
  padding: 12px 16px;
}

/* 2. Step indicator ------------------------------------- */
.ap-progress { display: flex; flex-direction: column; gap: 10px; }

.ap-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.ap-steps__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.ap-steps__item::before,
.ap-steps__item::after {
  content: "";
  position: absolute;
  top: 12px;
  height: 2px;
  background: var(--border);
}
.ap-steps__item::before { left: 0; right: 50%; margin-right: 17px; }
.ap-steps__item::after { left: 50%; right: 0; margin-left: 17px; }
.ap-steps__item:first-child::before,
.ap-steps__item:last-child::after { content: none; }
.ap-steps__item.is-done::before,
.ap-steps__item.is-done::after,
.ap-steps__item.is-current::before { background: var(--accent); }

.ap-steps__dot {
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}
.ap-steps__item.is-done .ap-steps__dot,
.ap-steps__item.is-current .ap-steps__dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
.ap-steps__cap {
  display: none;
  font-size: 11.5px;
  line-height: 1.4;
  text-align: center;
  color: var(--muted);
}
.ap-steps__item.is-current .ap-steps__cap { color: var(--ink); font-weight: 700; }

.ap-steps__now { font-size: 12px; font-weight: 700; text-align: center; line-height: 1.4; }
.ap-steps__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.ap-steps__btn:hover .ap-steps__dot { border-color: var(--accent); }
.ap-steps__btn:hover .ap-steps__cap { color: var(--ink); }
.ap-steps__btn:focus-visible { outline: none; }
.ap-steps__btn:focus-visible .ap-steps__dot { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 3. Form frame + steps --------------------------------- */
.apply-page .ap-form {
  padding: 20px 16px 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.apply-page .step {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.apply-page .step + .step {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.apply-page .step[hidden] { display: none; }
.apply-page .step.is-enhanced + .step.is-enhanced {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.apply-page .step__legend {
  float: left;
  width: 100%;
  padding: 0 0 20px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
}
.apply-page .step__legend + * { clear: both; }
.ap-legend-en { display: block; font-size: 12px; font-weight: 500; color: var(--faint); margin-top: 2px; }

.ap-stack { display: flex; flex-direction: column; gap: 26px; }

.ap-sect { display: flex; flex-direction: column; gap: 12px; }
.ap-owner { display: flex; flex-direction: column; gap: 12px; }
.ap-owners { display: flex; flex-direction: column; gap: 12px; }
.ap-owner-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--tint);
  padding: 14px;
}
.ap-owner-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ap-owner-card__title { font-size: 14px; font-weight: 700; color: var(--ink); }
.ap-owner-card__remove {
  font: inherit;
  font-size: 12.5px;
  color: var(--danger);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.ap-owner-more { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ap-sect__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ap-sect__title { font-size: 16px; font-weight: 700; color: var(--ink); line-height: 1.4; }
.ap-sect__aside { font-size: 11.5px; color: var(--muted); }

.ap-hr { height: 1px; background: var(--border); border: 0; margin: 0; }

.ap-req,
.ap-opt {
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 8px;
  display: inline-block;
  line-height: 1.6;
  white-space: nowrap;
}
.ap-req { background: #f6e3df; color: var(--danger); }
.ap-opt { background: var(--border); color: var(--ink-muted); }

/* 4. Fields --------------------------------------------- */
.ap-field { display: flex; flex-direction: column; gap: 6px; }
.ap-fields { display: flex; flex-direction: column; gap: 14px; }
.ap-row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.ap-label { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ap-label__jp { font-size: 12.5px; font-weight: 600; color: var(--ink-muted); }
.ap-label__en { font-size: 11px; color: var(--faint); }
.ap-label__link { margin-left: auto; font-size: 12px; white-space: nowrap; }

.ap-note { font-size: 12px; color: var(--faint); line-height: 1.7; }
.ap-note--indent { padding-left: 28px; }
.ap-question { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.ap-link-row { font-size: 13px; }

.apply-page input[type="text"],
.apply-page input[type="email"],
.apply-page input[type="tel"],
.apply-page input[type="url"],
.apply-page input[type="date"],
.apply-page select,
.apply-page textarea {
  width: 100%;
  min-width: 0;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 0 14px;
  height: 42px;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
}
.apply-page textarea {
  height: auto;
  min-height: 84px;
  padding: 10px 14px;
  line-height: 1.7;
  resize: vertical;
}
.apply-page select {
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236e7061' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9.5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px 16px;
}
.apply-page input::placeholder,
.apply-page textarea::placeholder { color: var(--faint); }
.apply-page input:focus,
.apply-page select:focus,
.apply-page textarea:focus { border-color: var(--accent); }
.apply-page :is(input, select, textarea).is-invalid,
.apply-page :is(input, select, textarea).is-invalid:focus { border-color: var(--danger); }
.apply-page .ap-choices.is-invalid .ap-choice,
.apply-page .ap-plan-groups.is-invalid label.plan-card { border-color: var(--danger); }
.apply-page :is(.ap-checks, label.ap-check).is-invalid { outline: 1px solid var(--danger); outline-offset: 6px; border-radius: 8px; }
.apply-page .field-error-summary { margin-bottom: 16px; }
.apply-page .ap-postal-hint { font-size: 12px; color: var(--ink-muted); }

/* Draft notice (entries kept in this browser for 7 days) */
.ap-draft {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--tint);
  color: var(--ink-muted);
  font-size: 12.5px;
  line-height: 1.6;
  padding: 8px 12px;
}
.ap-draft__clear {
  font: inherit;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.ap-readonly {
  height: 42px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--tint);
  font-size: 14px;
  color: var(--ink-soft);
}

/* Honeypot: off-screen, never display:none (bots skip hidden inputs). */
.ap-hp {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* 5. Choices -------------------------------------------- */
.ap-choices { display: flex; flex-direction: column; gap: 10px; }
.ap-choices > .ap-choice-item { display: flex; flex-direction: column; gap: 6px; }
.ap-checks { display: flex; flex-direction: column; gap: 10px; }

.ap-choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  padding: 11px 14px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
}
.ap-choice:has(input:checked) { border-color: var(--accent); background: var(--tint); }
.ap-choice__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ap-choice__title { font-weight: 700; line-height: 1.45; }
.ap-choice__en { font-size: 12px; color: var(--muted); }

.ap-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.7;
  cursor: pointer;
}
.ap-check__badge { margin-left: 4px; }

.apply-page input[type="radio"],
.apply-page input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: none;
  margin: 3px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.ap-plan-groups { display: flex; flex-direction: column; gap: 18px; }
.ap-plan-group { display: flex; flex-direction: column; gap: 8px; }
.ap-plan-group[hidden] { display: none; }
.ap-plan-group__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ap-plan-group__tag {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--muted);
  background: var(--paper);
  border-radius: 6px;
  padding: 3px 10px;
}
.ap-plan-group[data-plan-group="japan"] .ap-plan-group__tag { color: var(--accent-dark); background: var(--domestic-tint); }
.ap-plan-group[data-plan-group="overseas"] .ap-plan-group__tag { color: var(--global); background: var(--global-tint); }
.ap-plan-list { display: flex; flex-direction: column; gap: 10px; }

.apply-page label.plan-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  padding: 14px;
  cursor: pointer;
}
.apply-page label.plan-card:has(input:checked) { border-color: var(--accent); background: var(--tint); }
.plan-opt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.plan-opt__head { display: flex; align-items: flex-start; gap: 8px; }
.plan-opt__title { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; line-height: 1.45; }
.plan-opt__en {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.01em;
}
.plan-opt__price { display: flex; align-items: baseline; gap: 3px; flex-wrap: wrap; }
.plan-opt__amount { font-size: 20px; font-weight: 700; }
.plan-opt__unit { font-size: 12px; color: var(--ink-muted); }
.plan-opt__desc { font-size: 12.5px; color: var(--ink-muted); line-height: 1.7; }
.ap-consult {
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--tint);
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.8;
  padding: 12px 16px;
}

/* 6. Estimate ------------------------------------------- */
.ap-estimate {
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.ap-estimate__head {
  background: var(--ink-soft);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  padding: 9px 14px;
  line-height: 1.6;
}
.apply-page .ap-estimate__head { color: #ffffff; } /* beats `.step p` from site.css */
.ap-estimate__body { padding: 18px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.ap-estimate__total { text-align: center; line-height: 1.3; }
.ap-estimate__amount { font-size: 32px; font-weight: 700; }
.ap-estimate__tax { font-size: 13px; color: var(--ink-muted); margin-left: 6px; }
.ap-estimate__rows { display: flex; flex-direction: column; }
.ap-estimate__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.ap-estimate__row[hidden] { display: none; }
.ap-estimate__key { color: var(--ink-muted); }
.ap-estimate__val { font-weight: 700; }

.ap-terms-list {
  margin: 0;
  padding-left: 20px;
  list-style: disc;
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 2;
}

/* 7. Review --------------------------------------------- */
.ap-review { display: flex; flex-direction: column; gap: 16px; }
.ap-grp {
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.ap-grp__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--tint);
  border-bottom: 1px solid var(--border);
}
.ap-grp__title { font-size: 14px; font-weight: 700; color: var(--ink); }
.ap-grp__edit { margin-left: auto; height: 30px; padding: 0 12px; font-size: 12px; border-radius: 9px; }
.ap-grp__body {
  margin: 0;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px 16px;
  align-items: baseline;
}
.ap-grp__body dt { font-size: 12px; color: var(--muted); }
.ap-grp__body dd { margin: 0 0 8px; font-size: 14px; color: var(--ink); line-height: 1.6; }
.ap-grp__body dd:last-child { margin-bottom: 0; }

/* 8. Navigation + submit -------------------------------- */
.ap-nav { display: flex; flex-direction: column-reverse; gap: 10px; }
.ap-nav .btn { width: 100%; }
.ap-actions { display: flex; flex-direction: column; gap: 12px; }
.ap-actions .btn { width: 100%; }
.apply-page .btn[disabled] { opacity: 0.55; cursor: progress; }

/* 9. Thanks page ---------------------------------------- */
.ap-done { display: flex; flex-direction: column; gap: 22px; padding: 24px 16px; }
.ap-done__head { display: flex; align-items: flex-start; gap: 14px; }
.ap-done__text { display: flex; flex-direction: column; gap: 6px; }
.ap-done__lead { font-size: 14px; color: var(--ink-muted); }
.ap-done__sub { display: block; font-size: 13px; color: var(--faint); }
.ap-docs { display: flex; flex-direction: column; gap: 12px; }
.ap-docs__list {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px 20px;
  align-items: start;
  font-size: 13px;
}
.ap-docs__list dt {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-weight: 700;
}
.ap-docs__list dd { margin: 0 0 10px; color: var(--ink-muted); line-height: 1.7; }
.ap-docs__list dd:last-child { margin-bottom: 0; }
.ap-docs__en { font-size: 11px; font-weight: 500; color: var(--faint); margin-left: 6px; }
.ap-done .ap-note { text-align: center; }

/* 10. Tablet / desktop ---------------------------------- */
@media (min-width: 640px) {
  .apply-page .ap-form { padding: 28px 28px 30px; }
  .apply-page .step__legend { font-size: 21px; }
  .ap-steps__cap { display: block; }
  .ap-steps__now { display: none; }
  .ap-nav { flex-direction: row; justify-content: flex-end; }
  .ap-nav .btn { width: auto; min-width: 180px; }
  .ap-nav [data-prev] { margin-right: auto; }
  .ap-grp__body { grid-template-columns: 148px minmax(0, 1fr); gap: 10px 16px; }
  .ap-grp__body dd { margin-bottom: 0; }
  .ap-docs__list { grid-template-columns: 200px minmax(0, 1fr); gap: 10px 20px; }
  .ap-docs__list dd { margin-bottom: 0; }
  .ap-done { padding: 32px 32px 34px; }
  .ap-actions .btn { width: auto; min-width: 280px; align-self: center; }
}

@media (min-width: 1024px) {
  .apply-page .ap-form { padding: 36px 40px 38px; }
  .ap-shell { gap: 24px; }
  .ap-row2 { gap: 12px; }
  .ap-estimate__body { padding: 18px 20px 16px; }
  .ap-estimate__amount { font-size: 36px; }
  .ap-docs__list { grid-template-columns: 220px minmax(0, 1fr); }
}
