/* =============================================
 * CPEX Order Form — Card + Step Wizard
 * Mobile-first design
 * ============================================= */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;600;700&display=swap');

:root {
  --accent: #1a6cff;
  --accent-hover: #1558d6;
  --accent-soft: #e8f0ff;
  --accent-softer: #f3f7ff;
  --dark: #0f1923;
  --text: #1a1a2e;
  --text2: #5a6270;
  --text3: #99a1ad;
  --bg: #f5f6f8;
  --card: #ffffff;
  --border: #e4e7ec;
  --border-light: #f0f2f5;
  --error: #dc2626;
  --error-bg: #fef2f2;
  --success: #059669;
  --success-bg: #ecfdf5;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,.06), 0 1px 3px rgba(0,0,0,.04);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* === Layout === */
.cpex-page { min-height: 100vh; display: flex; flex-direction: column; }
.cpex-header { background: var(--card); border-bottom: 1px solid var(--border); padding: 12px 20px; position: sticky; top: 0; z-index: 50; }
.cpex-header-inner { max-width: 800px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.cpex-logo { font-weight: 700; font-size: 15px; color: var(--dark); text-decoration: none; }
.cpex-logo span { color: var(--accent); }
.cpex-nav { display: flex; gap: 16px; }
.cpex-nav a { font-size: 13px; color: var(--text2); }
.cpex-footer { background: var(--dark); color: #7a8599; text-align: center; padding: 28px 20px; font-size: 12px; line-height: 1.9; margin-top: auto; }
.cpex-footer a { color: #7db8ff; }
.cpex-main { max-width: 800px; width: 100%; margin: 0 auto; padding: 0 16px; flex: 1; }

/* === Card Menu === */
.cpex-hero { padding: 32px 4px 20px; }
.cpex-hero h1 { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.3; }
.cpex-hero p { font-size: 13px; color: var(--text2); margin-top: 6px; }
.cpex-tel-banner { background: var(--accent-softer); border: 1px solid #d0e0ff; border-radius: var(--radius-sm); padding: 12px 16px; margin: 0 4px 24px; font-size: 13px; color: var(--text2); }
.cpex-tel-banner strong { color: var(--text); }
.cpex-section-label { padding: 0 4px; margin-bottom: 10px; font-size: 11px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 1.5px; }
.cpex-cards { display: flex; flex-direction: column; gap: 8px; margin-bottom: 28px; }
.cpex-card { background: var(--card); border-radius: var(--radius); padding: 16px 18px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-sm); cursor: pointer; transition: all .15s; border: 2px solid transparent; text-decoration: none; color: inherit; }
.cpex-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-md); text-decoration: none; }
.cpex-card-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cpex-card-icon svg { width: 24px; height: 24px; }
.cpex-card-icon.blue { background: #e8f0ff; color: #1a6cff; } .cpex-card-icon.green { background: #e6f7f0; color: #059669; }
.cpex-card-icon.orange { background: #fff3e6; color: #d97706; } .cpex-card-icon.purple { background: #f3e8ff; color: #7c3aed; }
.cpex-card-icon.pink { background: #fce8f3; color: #db2777; } .cpex-card-icon.gray { background: #f1f5f9; color: #475569; }
.cpex-card-body h3 { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.3; }
.cpex-card-body p { font-size: 12px; color: var(--text3); margin-top: 1px; }
.cpex-card-arrow { margin-left: auto; color: var(--text3); font-size: 18px; flex-shrink: 0; }

/* === Form Page === */
.cpex-form-header { padding: 14px 4px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--border); }
.cpex-back { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--bg); display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--text2); cursor: pointer; border: none; text-decoration: none; flex-shrink: 0; }
.cpex-back:hover { background: var(--border); text-decoration: none; }
.cpex-form-title { font-size: 16px; font-weight: 600; color: var(--text); }
.cpex-form-body { padding: 20px 4px 40px; }

/* === Step Wizard === */
.cpex-steps { padding: 16px 4px 0; }
.cpex-step-bar { display: flex; gap: 4px; margin-bottom: 8px; }
.cpex-step-pip { flex: 1; height: 4px; border-radius: 2px; background: var(--border); transition: background .3s; }
.cpex-step-pip.done { background: var(--accent); }
.cpex-step-pip.current { background: var(--accent); opacity: .45; }
.cpex-step-label { font-size: 12px; color: var(--text3); margin-bottom: 20px; }
.cpex-step-content { display: none; }
.cpex-step-content.active { display: block; }
.cpex-step-nav { display: flex; gap: 10px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--border-light); }
.cpex-btn-back { padding: 14px 20px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--card); color: var(--text2); font-size: 14px; font-weight: 500; cursor: pointer; font-family: inherit; }
.cpex-btn-back:hover { border-color: var(--text3); }
.cpex-btn-next, .cpex-btn-submit { flex: 1; padding: 14px; background: var(--accent); color: #fff; border: none; border-radius: 12px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; transition: background .15s; }
.cpex-btn-next:hover, .cpex-btn-submit:hover { background: var(--accent-hover); }
.cpex-btn-next:disabled, .cpex-btn-submit:disabled { opacity: .5; cursor: not-allowed; }

/* === Form Fields === */
.cpex-field { margin-bottom: 18px; }
.cpex-field label { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 5px; }
.cpex-req { color: var(--error); font-size: 11px; margin-left: 2px; }
.cpex-field input[type="text"], .cpex-field input[type="email"], .cpex-field input[type="tel"],
.cpex-field input[type="number"], .cpex-field select, .cpex-field textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; color: var(--text); background: #fafbfc; font-family: inherit; transition: border-color .15s;
}
.cpex-field select { background: #fafbfc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2399a1ad' stroke-width='1.5' fill='none'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 36px; -webkit-appearance: none; appearance: none; }
.cpex-field input:focus, .cpex-field select:focus, .cpex-field textarea:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(26,108,255,.08); }
.cpex-field textarea { min-height: 100px; resize: vertical; }
.cpex-field.has-error input, .cpex-field.has-error select, .cpex-field.has-error textarea { border-color: var(--error); }
.cpex-field-error { display: block; color: var(--error); font-size: 12px; margin-top: 4px; font-weight: 500; }
.cpex-inline-error { display: block; color: var(--error); font-size: 12px; margin-top: 4px; font-weight: 500; }
.cpex-hint { font-size: 12px; color: var(--text3); margin-top: 4px; line-height: 1.5; }
.cpex-hint a { color: var(--accent); }
.cpex-note { font-size: 12px; color: var(--text3); margin: 4px 0 16px; line-height: 1.6; }
.cpex-note a { color: var(--accent); }

/* Fieldset */
.cpex-fieldset { border: none; padding: 0; margin-bottom: 8px; }
.cpex-fieldset legend { font-weight: 600; font-size: 15px; color: var(--text); margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--accent-soft); width: 100%; }

/* Radio/Checkbox */
.cpex-radio-group { display: flex; flex-direction: column; gap: 8px; }
.cpex-radio, .cpex-checkbox { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: all .15s; font-size: 14px; }
.cpex-radio:hover, .cpex-checkbox:hover { border-color: #b8d0ff; }
.cpex-radio.selected, .cpex-checkbox.selected { border-color: var(--accent); background: var(--accent-softer); }

/* Zip Code */
.cpex-zip-row { display: flex; gap: 8px; align-items: flex-start; }
.cpex-zip-row .cpex-field { flex: 1; }
.cpex-zip-btn { margin-top: 26px; padding: 11px 16px; background: var(--dark); color: #fff; border: none; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; font-weight: 500; white-space: nowrap; font-family: inherit; }
.cpex-zip-btn:hover { background: #1a2a3e; }
.cpex-zip-btn:disabled { opacity: .5; }

/* Pole Card */
.cpex-pole-card { background: var(--bg); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.cpex-pole-hidden { display: none; }
.cpex-pole-num { font-size: 12px; font-weight: 600; color: var(--accent); letter-spacing: .5px; }
.cpex-pole-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cpex-pole-remove { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border); background: var(--card); color: var(--text3); cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.cpex-pole-remove:hover { border-color: var(--error); color: var(--error); background: var(--error-bg); }
.cpex-pole-card .cpex-field { margin-bottom: 10px; }
.cpex-pole-card .cpex-field:last-child { margin-bottom: 0; }
.cpex-brand-opts { margin-top: 8px; }
.cpex-add-pole { text-align: center; padding: 14px; border: 2px dashed var(--border); border-radius: var(--radius); color: var(--text3); font-size: 13px; cursor: pointer; margin-top: 4px; }
.cpex-add-pole:hover { border-color: var(--accent); color: var(--accent); }

/* Plug Card */
.cpex-plug-card { background: var(--bg); border-radius: var(--radius); padding: 16px; margin-bottom: 10px; }
.cpex-plug-card h4 { font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.cpex-plug-fields { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; }
.cpex-plug-fields .cpex-field { margin-bottom: 0; }

/* Privacy */
.cpex-privacy { margin-top: 20px; padding: 16px; background: var(--bg); border-radius: var(--radius-sm); }
.cpex-privacy .cpex-checkbox { border: none; padding: 0; background: none; }

/* Error/Success */
.cpex-global-error { background: var(--error-bg); border: 1px solid #fecaca; color: var(--error); padding: 14px 16px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 14px; font-weight: 500; }

/* Confirmation Summary */
.cpex-confirm-summary { margin-bottom: 8px; }
.cpex-confirm-section { margin-bottom: 20px; }
.cpex-confirm-section h3 { font-size: 14px; font-weight: 600; color: var(--accent); margin-bottom: 8px; padding-bottom: 6px; border-bottom: 2px solid var(--accent-soft); }
.cpex-confirm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cpex-confirm-table tr { border-bottom: 1px solid var(--border-light); }
.cpex-confirm-table tr:last-child { border-bottom: none; }
.cpex-confirm-table th { text-align: left; color: var(--text3); font-weight: 500; padding: 8px 12px 8px 0; width: 35%; vertical-align: top; font-size: 13px; }
.cpex-confirm-table td { color: var(--text); padding: 8px 0; word-break: break-all; }
.cpex-confirm-note { background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 20px; font-size: 13px; color: #92400e; text-align: center; line-height: 1.6; }
.cpex-btn-confirm { background: #059669; }
.cpex-btn-confirm:hover { background: #047857; }
.cpex-success { text-align: center; padding: 48px 24px; background: var(--success-bg); border: 1px solid #a7f3d0; border-radius: var(--radius); margin: 32px 4px; }
.cpex-success h2 { color: var(--success); font-size: 20px; margin-bottom: 8px; }
.cpex-success p { color: var(--text); margin-bottom: 12px; font-size: 14px; line-height: 1.7; }
.cpex-success-btn { display: inline-block; padding: 12px 32px; background: var(--accent); color: #fff; border-radius: 12px; font-weight: 600; font-size: 14px; text-decoration: none; margin-top: 8px; }
.cpex-success-btn:hover { background: var(--accent-hover); text-decoration: none; }

/* Responsive */
@media (min-width: 640px) {
  .cpex-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .cpex-hero { padding: 40px 4px 24px; }
  .cpex-hero h1 { font-size: 26px; }
}
@media (max-width: 639px) {
  .cpex-nav { display: none; }
  .cpex-plug-fields { grid-template-columns: 1fr; }
}
