/* ===== VITAL DX FORMS — SHARED DESIGN SYSTEM ===== */
/* Each form sets its own --primary / --accent via inline :root override */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* defaults — overridden per form */
  --primary: #0A6EBD;
  --primary-dark: #054D8A;
  --primary-light: #E8F4FD;
  --accent: #00C389;
  --accent-dark: #009E6F;
  --gradient-start: #054D8A;
  --gradient-mid: #0A6EBD;
  --gradient-end: #0891D4;
  --focus-ring: rgba(10,110,189,0.12);
  --btn-shadow: rgba(10,110,189,0.3);
  --btn-shadow-hover: rgba(10,110,189,0.4);

  /* shared tokens */
  --danger: #EF4444;
  --text-primary: #1A1F36;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --border: #E5E7EB;
  --bg-main: #F0F4F8;
  --bg-card: #FFFFFF;
  --bg-section: #F8FAFC;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Noto Sans JP', 'Inter', sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 0 0 80px 0;
}

/* ===== HEADER ===== */
.header {
  background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-mid) 50%, var(--gradient-end) 100%);
  color: white;
  padding: 0;
  position: relative;
  overflow: hidden;
}
.header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
}
.header::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.10) 0%, transparent 70%);
  border-radius: 50%;
}
.header-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px 36px;
  position: relative;
  z-index: 1;
}
.header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
}
.header-badge .dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}
.header h1 {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 10px;
}
.header p {
  font-size: 13px;
  opacity: 0.8;
  line-height: 1.6;
}

/* ===== MAIN CONTAINER ===== */
.container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== SECTION CARDS ===== */
.section-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid var(--border);
  transition: box-shadow 0.2s;
}
.section-card:hover {
  box-shadow: var(--shadow-md);
}
.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.section-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.section-title-wrap { flex: 1; }
.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}
.section-body {
  padding: 20px 24px;
}

/* icon backgrounds */
.icon-info     { background: linear-gradient(135deg, #DBEAFE, #BFDBFE); }
.icon-user     { background: linear-gradient(135deg, #D1FAE5, #A7F3D0); }
.icon-mail     { background: linear-gradient(135deg, #EDE9FE, #DDD6FE); }
.icon-product  { background: linear-gradient(135deg, #FEF3C7, #FDE68A); }
.icon-message  { background: linear-gradient(135deg, #FCE7F3, #FBCFE8); }
.icon-check    { background: linear-gradient(135deg, #F1F5F9, #E2E8F0); }

/* ===== STEPS GUIDE ===== */
.steps-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.step-card {
  flex: 1;
  text-align: center;
  padding: 20px 12px;
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: box-shadow 0.2s;
}
.step-card:hover {
  box-shadow: var(--shadow-sm);
}
.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: white;
  font-size: 12px;
  font-weight: 700;
  border-radius: 50%;
  margin-bottom: 8px;
}
.step-emoji {
  font-size: 28px;
  margin-bottom: 8px;
}
.step-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.step-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.step-desc strong {
  color: var(--primary);
  font-weight: 600;
}
.step-arrow {
  font-size: 20px;
  color: var(--text-muted);
  flex-shrink: 0;
}
@media (max-width: 600px) {
  .steps-container {
    flex-direction: column;
    gap: 4px;
  }
  .step-arrow {
    transform: rotate(90deg);
  }
}

/* ===== FORM FIELDS ===== */
.field-group {
  margin-bottom: 20px;
}
.field-group:last-child { margin-bottom: 0; }

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.5;
}
.required {
  display: inline-block;
  background: var(--danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.05em;
}
.optional {
  display: inline-block;
  background: #E5E7EB;
  color: #6B7280;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.05em;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background: white;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}
textarea { resize: vertical; min-height: 100px; }

/* Two-col layout */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) {
  .two-col { grid-template-columns: 1fr; }
}

/* ===== CHECKBOX / RADIO OPTIONS ===== */
.options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.options-grid.col1 { grid-template-columns: 1fr; }

.opt-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
  background: white;
  user-select: none;
}
.opt-item:hover { border-color: var(--primary); background: var(--primary-light); }
.opt-item input[type="radio"],
.opt-item input[type="checkbox"] {
  accent-color: var(--primary);
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.opt-item.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 500;
}

/* ===== HINT ===== */
.hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.5;
}

/* ===== SUBMIT BAR ===== */
.submit-wrap {
  background: white;
  border-top: 1px solid var(--border);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
}
.submit-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.submit-note {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}
.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  box-shadow: 0 4px 12px var(--btn-shadow);
}
.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--btn-shadow-hover);
}
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* ===== SUCCESS SCREEN ===== */
.success-screen {
  display: none;
  text-align: center;
  padding: 60px 24px;
}
.success-screen.visible { display: block; }
.success-icon {
  width: 80px; height: 80px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  margin: 0 auto 24px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.success-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
}
.success-msg {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 500px;
  margin: 0 auto;
}

/* ===== ERROR STATE ===== */
.field-error input,
.field-error textarea,
.field-error select {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1) !important;
}
.error-msg {
  color: var(--danger);
  font-size: 11px;
  font-weight: 500;
  margin-top: 4px;
  display: none;
}
.field-error .error-msg { display: block; }
.field-error .opt-item { border-color: rgba(239,68,68,0.4); }

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 11px;
  color: var(--text-muted);
}
.footer a {
  color: var(--primary);
  text-decoration: none;
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}
.loading-overlay.visible { display: flex; }
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
  .header-inner { padding: 32px 20px 28px; }
  .section-header { padding: 16px 20px; }
  .section-body { padding: 16px 20px; }
  .submit-inner { padding: 12px 16px; flex-direction: column; }
  .submit-note { text-align: center; }
  .btn-submit { width: 100%; justify-content: center; }
}

@media print {
  .submit-wrap { display: none; }
  .header { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { padding: 0; }
}
