/* ==========================================================
   育成就労 移行シミュレーター — JOL Design System 踏襲
   tokens: JOL UI (orange #ff6b1a / Noto Sans JP + DM Sans)
   ========================================================== */
:root {
  --bg: #f4f4f6;
  --surface: #ffffff;
  --surface-2: #f7f8fb;
  --border: #e8e8f0;
  --border-2: #dde6ef;
  --primary: #ff6b1a;
  --primary-btn: #ff7020;
  --primary-soft: #ffece2;
  --primary-soft-border: rgba(255, 107, 26, 0.22);
  --ok: #00db6b;
  --ok-soft: #e5f9ed;
  --danger: #f6182f;
  --danger-soft: #ffe9e9;
  --danger-border: #ff3a43;
  --warn: #f59e0b;
  --warn-soft: #fff5e6;
  --info: #2f6df6;
  --info-soft: #eaf1ff;
  --text: #1b1b1b;
  --text-dark: #1a1a2e;
  --text-muted: #8a8a99;
  --text-soft: #5b5b6b;
  --track: rgba(0, 0, 0, 0.07);
  --orange-shadow: 0 6px 20px 0 rgba(255, 107, 26, 0.3);
  --card-shadow: 0 2px 14px rgba(20, 20, 50, 0.05);

  --font-ja: "Noto Sans JP", sans-serif;
  --font-en: "DM Sans", "Noto Sans JP", sans-serif;

  --r-card: 16px;
  --r-option: 12px;
  --r-badge: 8px;
  --r-button: 9px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ja);
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }
button { cursor: pointer; }
.en { font-family: var(--font-en); }

.app {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 22px 20px calc(28px + env(safe-area-inset-bottom));
  background: var(--bg);
  position: relative;
  z-index: 1;
}

/* PC: 左右をブランド背景 + JOLウォーターマークで埋める */
@media (min-width: 960px) {
  body {
    background: url("assets/bg-desktop.jpg") center top / cover no-repeat fixed #ff6b1a;
  }
  .app {
    box-shadow: 0 0 48px rgba(0, 0, 0, 0.18);
    border-radius: 0;
  }
  body::before, body::after {
    content: "";
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: clamp(200px, 40vw - 260px, 560px);
    aspect-ratio: 599 / 220;
    background: url("assets/watermark.svg") center / contain no-repeat;
    z-index: 0;
    pointer-events: none;
  }
  body::before { left: 2vw; }
  body::after { right: 2vw; }
}

/* ---------- ヘッダー ---------- */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 40px;
  margin-bottom: 22px;
}
.header-logo { height: 22px; width: auto; }
.header-basis {
  font-size: 10.5px;
  color: var(--text-muted);
  text-align: right;
  line-height: 1.4;
}
.header-basis b { color: var(--primary); font-weight: 700; }

/* ---------- screen 共通 ---------- */
.screen { display: flex; flex-direction: column; flex: 1; animation: fadeIn 0.35s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.eyebrow {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--primary);
  text-transform: uppercase;
}
.h1 { font-size: 24px; font-weight: 700; line-height: 1.4; margin: 8px 0 12px; color: var(--text-dark); }
.h1 .accent { color: var(--primary); }
.lead { font-size: 14px; line-height: 1.85; color: var(--text-soft); }

/* ---------- intro ---------- */
.intro-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 26px 22px;
  box-shadow: var(--card-shadow);
  margin-bottom: 16px;
}
.intro-points { display: flex; flex-direction: column; gap: 12px; margin: 18px 0 4px; }
.intro-point {
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 13.5px; line-height: 1.7; color: var(--text-soft);
}
.intro-point .num {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  font-family: var(--font-en); font-weight: 700; font-size: 13px;
  display: grid; place-items: center;
}
.intro-point b { color: var(--text); font-weight: 700; }

.notice {
  font-size: 11.5px; line-height: 1.7; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-option); padding: 12px 14px; margin-top: 16px;
}

/* ---------- buttons ---------- */
.btn-primary {
  display: block; width: 100%; min-height: 56px; border: none;
  border-radius: var(--r-button); background: var(--primary-btn); color: #fff;
  font-weight: 700; font-size: 16px; box-shadow: var(--orange-shadow);
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn-primary:active { transform: scale(0.985); filter: brightness(0.96); }
.btn-primary:disabled { opacity: 0.45; box-shadow: none; cursor: default; }
.btn-primary .btn-sub { display: block; font-size: 11px; font-weight: 400; opacity: 0.9; font-family: var(--font-en); margin-top: 2px; }

.btn-secondary {
  display: block; width: 100%; min-height: 52px;
  border: 1.5px solid var(--primary); border-radius: var(--r-button);
  background: #fff; color: var(--primary); font-weight: 700; font-size: 15px;
  transition: transform 0.15s ease;
}
.btn-secondary:active { transform: scale(0.985); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; background: none; color: var(--text-muted);
  font-size: 13px; font-weight: 500; padding: 8px 4px;
}
.btn-ghost:hover { color: var(--primary); }

.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }

/* ---------- form ---------- */
.form { display: flex; flex-direction: column; gap: 18px; margin-top: 4px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label {
  font-size: 13px; font-weight: 700; color: var(--text-dark);
  display: flex; align-items: center; gap: 8px;
}
.req { font-size: 10px; font-weight: 700; color: #fff; background: var(--primary); border-radius: 4px; padding: 1px 6px; }
.opt { font-size: 10px; font-weight: 700; color: var(--text-muted); background: var(--track); border-radius: 4px; padding: 1px 6px; }
.field .hint { font-size: 11.5px; color: var(--text-muted); line-height: 1.6; }

.input, .select {
  width: 100%; min-height: 50px; padding: 0 14px;
  border: 1.5px solid var(--border); border-radius: var(--r-option);
  background: var(--surface); font-size: 15px; color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none; appearance: none;
}
textarea.input { padding: 12px 14px; min-height: 50px; resize: vertical; line-height: 1.6; }
.select {
  background-image: url("assets/jol-logo.svg");
  background-image: none;
  background-repeat: no-repeat;
  padding-right: 40px;
}
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 9px; height: 9px;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.input:focus, .select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.field.error .input, .field.error .select { border-color: var(--danger); }
.field-err { font-size: 11.5px; color: var(--danger); font-weight: 500; display: none; }
.field.error .field-err { display: block; }

.form-section-title {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  letter-spacing: 0.04em; margin: 6px 0 -4px;
  display: flex; align-items: center; gap: 8px;
}
.form-section-title::before { content: ""; width: 3px; height: 13px; background: var(--primary); border-radius: 2px; }

/* radio pills (在留資格) */
.pill-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pill {
  position: relative; border: 1.5px solid var(--border); border-radius: var(--r-option);
  background: var(--surface); padding: 13px 12px; font-size: 13.5px; font-weight: 600;
  color: var(--text); text-align: center; transition: all 0.15s ease; line-height: 1.4;
}
.pill small { display: block; font-size: 10.5px; color: var(--text-muted); font-weight: 400; margin-top: 2px; }
.pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pill.checked { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.pill.checked small { color: var(--primary); opacity: 0.8; }
.pill.full { grid-column: 1 / -1; }

/* ---------- result: timeline ---------- */
.result-head {
  background: linear-gradient(135deg, #ff8a3d 0%, var(--primary) 100%);
  color: #fff; border-radius: var(--r-card); padding: 22px 22px 20px;
  box-shadow: var(--orange-shadow); margin-bottom: 16px;
}
.result-head .company { font-size: 13px; opacity: 0.92; }
.result-head .subject { font-size: 21px; font-weight: 700; margin: 4px 0 10px; }
.result-head .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.result-head .chip {
  font-size: 11.5px; font-weight: 600; background: rgba(255,255,255,0.22);
  border-radius: 999px; padding: 4px 11px; backdrop-filter: blur(4px);
}
.result-head .goal { font-size: 12px; opacity: 0.9; margin-top: 12px; }
.result-head .goal b { font-size: 15px; }

.warn-box {
  border-radius: var(--r-option); padding: 14px 16px; margin-bottom: 12px;
  display: flex; gap: 12px; align-items: flex-start;
}
.warn-box .wicon { flex: 0 0 auto; width: 24px; height: 24px; display: grid; place-items: center; font-size: 15px; }
.warn-box .wtitle { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.warn-box .wbody { font-size: 12.5px; line-height: 1.7; }
.warn-box.danger { background: var(--danger-soft); border: 1px solid var(--danger-border); color: #a30d1c; }
.warn-box.danger .wtitle { color: var(--danger); }
.warn-box.warn { background: var(--warn-soft); border: 1px solid #f5c977; color: #8a5a00; }
.warn-box.warn .wtitle { color: #c67c00; }
.warn-box.info { background: var(--info-soft); border: 1px solid #b9cffb; color: #234a9e; }
.warn-box.info .wtitle { color: var(--info); }

.section-label {
  font-size: 13px; font-weight: 700; color: var(--text-dark);
  margin: 20px 0 12px; display: flex; align-items: center; gap: 8px;
}
.section-label::before { content: ""; width: 3px; height: 15px; background: var(--primary); border-radius: 2px; }

.timeline { position: relative; padding-left: 8px; }
.tl-item { position: relative; padding: 0 0 4px 30px; }
.tl-item::before {
  content: ""; position: absolute; left: 7px; top: 20px; bottom: -8px;
  width: 2px; background: var(--border);
}
.tl-item:last-child::before { display: none; }
.tl-dot {
  position: absolute; left: 0; top: 5px; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 3px solid var(--border); z-index: 1;
}
.tl-item.t-target .tl-dot { border-color: #b9bcc9; }
.tl-item.t-deadline .tl-dot { border-color: var(--primary); }
.tl-item.t-statutory .tl-dot { border-color: var(--danger); }
.tl-item.t-warning .tl-dot { border-color: var(--warn); }
.tl-item.t-info .tl-dot { border-color: var(--info); }
.tl-item.t-today .tl-dot { border-color: var(--ok); background: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }

.tl-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-option); padding: 12px 14px; margin-bottom: 14px;
  box-shadow: var(--card-shadow);
}
.tl-item.t-today .tl-card { background: var(--ok-soft); border-color: #a6ecc6; }
.tl-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.tl-date { font-family: var(--font-en); font-size: 13px; font-weight: 700; color: var(--text-dark); }
.tl-date.tbd { color: var(--text-muted); font-family: var(--font-ja); font-size: 12px; }
.tl-type {
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: var(--r-badge);
}
.tl-type.target { background: var(--track); color: var(--text-soft); }
.tl-type.deadline { background: var(--primary-soft); color: var(--primary); }
.tl-type.statutory { background: var(--danger-soft); color: var(--danger); }
.tl-type.warning { background: var(--warn-soft); color: #c67c00; }
.tl-type.info { background: var(--info-soft); color: var(--info); }
.tl-route { font-size: 10px; font-weight: 700; color: var(--text-muted); }
.tl-label { font-size: 14px; font-weight: 700; line-height: 1.5; color: var(--text); }
.tl-desc { font-size: 12px; line-height: 1.65; color: var(--text-soft); margin-top: 5px; }

/* notes */
.notes-box {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-option); padding: 14px 16px; margin-top: 16px;
}
.notes-box .nt { font-size: 12px; font-weight: 700; color: var(--text-dark); margin-bottom: 8px; }
.notes-box ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.notes-box li { font-size: 11.5px; line-height: 1.6; color: var(--text-soft); padding-left: 16px; position: relative; }
.notes-box li::before { content: "・"; position: absolute; left: 0; color: var(--primary); font-weight: 700; }

/* legend */
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 4px 0 0; }
.legend span { font-size: 10.5px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; border: 2.5px solid; }
.legend .lg-target { border-color: #b9bcc9; }
.legend .lg-deadline { border-color: var(--primary); }
.legend .lg-statutory { border-color: var(--danger); }

/* ---------- CTA / gate ---------- */
.gate {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 22px; margin-top: 18px; box-shadow: var(--card-shadow);
}
.gate h3 { font-size: 16px; font-weight: 700; color: var(--text-dark); margin-bottom: 6px; }
.gate p { font-size: 12.5px; color: var(--text-soft); line-height: 1.7; margin-bottom: 14px; }
.consent { display: flex; gap: 8px; align-items: flex-start; font-size: 11.5px; color: var(--text-soft); line-height: 1.6; margin-top: 10px; }
.consent input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--primary); flex: 0 0 auto; }
.consent a { color: var(--primary); text-decoration: underline; }

.cta-card {
  background: linear-gradient(135deg, #fff 0%, var(--primary-soft) 100%);
  border: 1px solid var(--primary-soft-border); border-radius: var(--r-card);
  padding: 22px; margin-top: 16px; text-align: center;
}
.cta-card h3 { font-size: 17px; font-weight: 700; color: var(--text-dark); margin-bottom: 6px; }
.cta-card p { font-size: 12.5px; color: var(--text-soft); line-height: 1.7; margin-bottom: 16px; }

/* ---------- disclaimer / footer ---------- */
.disclaimer {
  font-size: 10.5px; line-height: 1.7; color: var(--text-muted);
  border-top: 1px solid var(--border); padding-top: 14px; margin-top: 22px;
}
.disclaimer b { color: var(--text-soft); }
.logo-footer { margin-top: 24px; padding-top: 8px; display: flex; justify-content: center; }
.logo-footer img { height: 26px; width: auto; opacity: 0.85; }

.progress-steps {
  display: flex; gap: 6px; margin-bottom: 18px;
}
.progress-steps .ps { flex: 1; height: 4px; border-radius: 2px; background: var(--track); }
.progress-steps .ps.active { background: var(--primary); }

/* ---------- print (PDF出力) ---------- */
@media print {
  @page { size: A4; margin: 14mm 12mm; }
  body { background: #fff !important; }
  body::before, body::after { display: none !important; }
  .app { box-shadow: none !important; max-width: none; padding: 0; }
  .no-print { display: none !important; }
  .tl-card, .intro-hero, .gate, .cta-card, .notes-box { box-shadow: none !important; }
  .result-head { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tl-item::before, .tl-dot, .tl-type, .warn-box, .result-head {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .tl-item { break-inside: avoid; }
  .warn-box { break-inside: avoid; }
}
