/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1a5fa8;
  --primary-dark: #144d8a;
  --accent: #e8f0fb;
  --success: #1d8a4a;
  --error: #c0392b;
  --border: #ccd5df;
  --text: #1a1a2e;
  --muted: #5a6a7e;
  --bg: #f4f7fb;
  --card: #ffffff;
  --radius: 10px;
}

body {
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Meiryo", "Yu Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */
header {
  background: var(--primary);
  color: #fff;
  padding: 24px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.header-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 20px;
}
header h1 { font-size: 1.5rem; font-weight: 700; letter-spacing: .03em; }
.subtitle { font-size: .9rem; opacity: .85; margin-top: 4px; }

/* ===== Main ===== */
main {
  flex: 1;
  max-width: 780px;
  margin: 0 auto;
  width: 100%;
  padding: 28px 20px 48px;
}

/* ===== Progress ===== */
.progress-wrap { margin-bottom: 28px; }
.progress-steps {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}
.step-btn {
  background: none;
  border: none;
  padding: 4px 10px;
  border-radius: 20px;
  cursor: pointer;
  font-size: .8rem;
  color: var(--muted);
  font-family: inherit;
  transition: all .2s;
}
.step-btn.active { background: var(--primary); color: #fff; font-weight: 600; }
.step-btn.done { color: var(--success); }
.sep { color: var(--border); font-size: .8rem; }
.progress-bar {
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
#progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width .4s ease;
  width: 0%;
}

/* ===== Form sections ===== */
.form-section {
  display: none;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  padding: 32px 36px;
}
.form-section.active { display: block; }

.form-section h2 {
  font-size: 1.2rem;
  color: var(--primary);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent);
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-num {
  background: var(--primary);
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  flex-shrink: 0;
}
.section-note {
  font-size: .875rem;
  color: var(--muted);
  margin-bottom: 20px;
  padding: 10px 14px;
  background: var(--accent);
  border-radius: 6px;
}

/* ===== Fields ===== */
.field-group {
  margin-bottom: 22px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label > span.req {
  display: inline-block;
  background: var(--error);
  color: #fff;
  font-size: .7rem;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  font-weight: 600;
  letter-spacing: .02em;
}
label > span.opt {
  display: inline-block;
  background: var(--muted);
  color: #fff;
  font-size: .7rem;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

.field-group > label:first-child {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
  font-size: .93rem;
}
.hint {
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: 7px;
  line-height: 1.5;
}

input[type="text"],
input[type="tel"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 9px 13px;
  font-size: .93rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}
input[type="text"]:focus,
input[type="tel"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,95,168,.12);
}
input.error, select.error, textarea.error {
  border-color: var(--error);
  background: #fff5f5;
}
textarea { resize: vertical; min-height: 90px; }

.char-counter {
  display: block;
  text-align: right;
  font-size: .8rem;
  color: var(--muted);
  margin-top: 4px;
}
.char-counter.over-limit { color: var(--error); font-weight: 600; }

/* ===== Radios ===== */
.radio-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.radio-group.error .radio-label { color: var(--error); }
.radio-label {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: .93rem;
}
.radio-label input[type="radio"] {
  width: 17px; height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ===== Checkboxes ===== */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  cursor: pointer;
  font-size: .9rem;
  padding: 5px 0;
}
.checkbox-label input[type="checkbox"] {
  width: 17px; height: 17px;
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.checkbox-label input.error { outline: 2px solid var(--error); }

.checklist {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.checklist .checkbox-label {
  padding: 9px 12px;
  border-radius: 6px;
  transition: background .15s;
}
.checklist .checkbox-label:hover { background: var(--accent); }
.checklist .checkbox-label:has(input:checked) { background: #edfbf3; }

/* ===== File drop zones ===== */
.file-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  background: #fafbfd;
}
.file-drop-zone:hover,
.file-drop-zone.drag-over { border-color: var(--primary); background: var(--accent); }
.file-drop-zone.has-file { border-color: var(--success); background: #f0faf5; }
.file-drop-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.file-drop-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  color: var(--muted);
}
.file-drop-label svg { color: var(--primary); opacity: .6; }
.file-drop-label span { font-size: .9rem; }
.file-types { font-size: .78rem; color: var(--muted); }
.file-selected {
  font-size: .9rem;
  color: var(--success);
  font-weight: 600;
  padding: 6px 0 2px;
}

/* ===== Info box ===== */
.info-box {
  background: #fffbe6;
  border: 1px solid #f5d468;
  border-radius: 7px;
  padding: 12px 16px;
  font-size: .875rem;
  margin-bottom: 22px;
  line-height: 1.6;
}

/* ===== Navigation buttons ===== */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  gap: 12px;
}
.btn-prev, .btn-next, .btn-submit {
  padding: 11px 28px;
  border-radius: 8px;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
  font-family: inherit;
}
.btn-prev {
  background: #fff;
  border: 1.5px solid var(--border);
  color: var(--muted);
}
.btn-prev:hover { background: var(--bg); }
.btn-next {
  background: var(--primary);
  color: #fff;
  margin-left: auto;
}
.btn-next:hover { background: var(--primary-dark); }
.btn-submit {
  background: var(--success);
  color: #fff;
  margin-left: auto;
  padding: 12px 36px;
  font-size: 1rem;
}
.btn-submit:hover:not(:disabled) { background: #166b39; }
.btn-submit:disabled { opacity: .6; cursor: not-allowed; }

/* ===== Success & Error ===== */
#success-screen { padding: 40px 0; }
.success-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(0,0,0,.07);
  padding: 48px 40px;
  text-align: center;
}
.success-icon {
  width: 64px; height: 64px;
  background: var(--success);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 2rem;
  margin: 0 auto 20px;
}
.success-card h2 { font-size: 1.4rem; color: var(--success); margin-bottom: 14px; }
.success-card p { font-size: .95rem; color: var(--text); margin-bottom: 8px; }
.success-sub { color: var(--muted); font-size: .875rem; }
.success-contact { margin-top: 20px; font-size: .875rem; color: var(--muted); }
.success-contact a { color: var(--primary); }

.error-banner {
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  background: var(--error);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  z-index: 999;
  max-width: 600px;
  font-size: .9rem;
}
.error-banner button {
  background: none; border: none; color: #fff;
  font-size: 1.1rem; cursor: pointer; margin-left: 8px;
}

/* ===== Footer ===== */
footer {
  background: #1a2332;
  color: rgba(255,255,255,.65);
  text-align: center;
  padding: 20px;
  font-size: .82rem;
  line-height: 1.8;
}
footer a { color: rgba(255,255,255,.8); }

/* ===== Responsive ===== */
@media (max-width: 600px) {
  .form-section { padding: 22px 18px; }
  .field-row { grid-template-columns: 1fr; }
  .step-btn { font-size: .72rem; padding: 3px 7px; }
  .sep { display: none; }
  .nav-buttons { flex-direction: column-reverse; }
  .btn-next, .btn-submit { width: 100%; margin-left: 0; }
  .btn-prev { width: 100%; }
}
