/* ==========================================================================
   NEXT / PROFILE — Pre-Production Hearing Form (Executive Gold / Blue Holo)
   ========================================================================== */

:root {
  --font-display: "Cormorant Garamond", "Shippori Mincho B1", "Yu Mincho", Georgia, serif;
  --font-serif-jp: "Shippori Mincho B1", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --font-sans: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;

  /* Executive Theme (Default: Matte Obsidian x Champagne Gold) */
  --bg-page: #050507;
  --bg-card: rgba(18, 16, 13, 0.84);
  --bg-subcard: rgba(27, 23, 18, 0.72);
  --bg-input: rgba(10, 9, 8, 0.9);
  --bg-input-focus: rgba(20, 17, 13, 0.96);

  --accent: #D8B878;
  --accent-bright: #F4E3BC;
  --accent-deep: #8A6D3B;
  --accent-glow: rgba(216, 184, 120, 0.28);
  --accent-soft: rgba(216, 184, 120, 0.13);

  --border-subtle: rgba(216, 184, 120, 0.24);
  --border-strong: rgba(244, 227, 188, 0.56);
  --border-input: rgba(216, 184, 120, 0.28);

  --text-primary: #F7F3EA;
  --text-secondary: #D4CBB8;
  --text-muted: #A99E89;
  --text-on-accent: #120E08;

  --danger: #F07B7B;
  --danger-bg: rgba(240, 123, 123, 0.12);
  --danger-border: rgba(240, 123, 123, 0.48);

  --radius-card: 16px;
  --radius-sub: 12px;
  --radius-input: 10px;
  --radius-pill: 999px;
  --transition-theme: 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="future"] {
  --bg-page: #020712;
  --bg-card: rgba(8, 22, 44, 0.84);
  --bg-subcard: rgba(11, 31, 60, 0.72);
  --bg-input: rgba(4, 12, 26, 0.92);
  --bg-input-focus: rgba(7, 21, 43, 0.98);

  --accent: #38D9F5;
  --accent-bright: #A9F2FF;
  --accent-deep: #0E7AA6;
  --accent-glow: rgba(56, 217, 245, 0.3);
  --accent-soft: rgba(56, 217, 245, 0.14);

  --border-subtle: rgba(56, 217, 245, 0.28);
  --border-strong: rgba(169, 242, 255, 0.6);
  --border-input: rgba(56, 217, 245, 0.3);

  --text-primary: #F0F8FF;
  --text-secondary: #BDD6EB;
  --text-muted: #88AFCF;
  --text-on-accent: #03111E;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background var(--transition-theme), color var(--transition-theme);
}

button,
input,
textarea {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-bright);
  outline-offset: 2px;
}

/* Ambient Backdrop */
.ambient-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}

.ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(110px);
  opacity: 0.42;
  transition: background var(--transition-theme);
}

.ambient-glow-1 {
  width: 420px;
  height: 420px;
  top: -150px;
  left: -80px;
  background: radial-gradient(circle, var(--accent-glow), transparent 72%);
}

.ambient-glow-2 {
  width: 380px;
  height: 380px;
  bottom: -140px;
  right: -90px;
  background: radial-gradient(circle, var(--accent-soft), transparent 72%);
}

.ambient-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 50% 25%, rgba(0, 0, 0, 0.72), transparent 85%);
}

/* Layout Shell (375px Mobile First) */
.page-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 14px calc(36px + env(safe-area-inset-bottom, 0px));
}

/* Header */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 4px 16px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-monogram {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: linear-gradient(145deg, var(--accent-soft), rgba(0, 0, 0, 0.45));
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent-bright);
  letter-spacing: 0.02em;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-word {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text-primary);
}

.brand-slash {
  color: var(--accent);
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.theme-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  flex-shrink: 0;
}

.theme-btn {
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  transition: background 0.2s ease, color 0.2s ease;
}

.theme-btn.is-active {
  background: linear-gradient(135deg, var(--accent-bright), var(--accent));
  color: var(--text-on-accent);
}

/* Hero Card */
.hero-card {
  padding: 22px 18px 18px;
  margin-bottom: 16px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  background: linear-gradient(160deg, var(--bg-card), rgba(8, 8, 10, 0.92));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.45);
}

.hero-eyebrow {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.hero-title {
  margin: 0 0 10px;
  font-family: var(--font-serif-jp);
  font-size: 23px;
  font-weight: 600;
  line-height: 1.38;
  letter-spacing: 0.03em;
  color: var(--text-primary);
}

.hero-desc {
  margin: 0 0 10px;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.hero-notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-subtle);
  background: var(--accent-soft);
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--accent-bright);
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.meta-pill {
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--accent-soft);
  color: var(--accent-bright);
}

.draft-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.draft-status {
  font-size: 11.5px;
  color: var(--text-muted);
}

.text-action-btn {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
  flex-shrink: 0;
}

.text-action-btn:hover {
  color: var(--accent-bright);
}

/* Validation Alert */
.alert-banner {
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: var(--radius-sub);
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
}

.alert-title {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--danger);
}

.alert-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text-primary);
}

/* Form Cards */
.apply-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-card {
  padding: 20px 16px;
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--accent-soft);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent-bright);
  flex-shrink: 0;
  margin-top: 2px;
}

.section-title {
  margin: 0;
  font-family: var(--font-serif-jp);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-primary);
}

.section-sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Inputs */
.fieldset-reset {
  border: 0;
  margin: 0;
  padding: 0;
}

.field-group {
  margin-bottom: 16px;
}

.field-group:last-child {
  margin-bottom: 0;
}

.field-label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.badge-req,
.badge-opt {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 5px;
  line-height: 1.5;
}

.badge-req {
  background: var(--accent);
  color: var(--text-on-accent);
}

.badge-opt {
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-weight: 500;
}

.field-input,
.field-textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-input);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.field-textarea {
  min-height: 76px;
  resize: vertical;
}

.field-input::placeholder,
.field-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.72;
}

.field-input:focus,
.field-textarea:focus {
  border-color: var(--accent-bright);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px var(--accent-soft);
  outline: none;
}

.field-input.is-invalid,
.check-item.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px var(--danger-bg);
}

.field-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.field-hint-top {
  margin: -2px 0 10px;
}

.field-error {
  margin: 6px 0 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--danger);
}

/* Business Blocks */
.business-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.business-block {
  padding: 15px 14px;
  border-radius: var(--radius-sub);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subcard);
}

.business-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.business-badge {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-bright);
}

.btn-remove-business {
  border: 1px solid rgba(240, 123, 123, 0.4);
  background: rgba(240, 123, 123, 0.08);
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
}

.btn-remove-business:hover {
  background: rgba(240, 123, 123, 0.18);
}

.business-actions {
  margin-top: 14px;
}

.btn-add-business {
  width: 100%;
}

/* Choice Cards (Styles & Theme) */
.choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.choice-card,
.theme-choice-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 13px;
  border-radius: var(--radius-sub);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subcard);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.choice-card:has(input:checked),
.theme-choice-card:has(input:checked) {
  border-color: var(--accent-bright);
  background: var(--accent-soft);
}

.choice-card input,
.theme-choice-card input {
  width: 19px;
  height: 19px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.choice-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.choice-title {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.choice-note {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}

.theme-choice-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.theme-choice-inner {
  display: flex;
  align-items: center;
  gap: 11px;
}

.swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.swatch-gold {
  background: linear-gradient(135deg, #16130E 35%, #D8B878 72%, #F4E3BC 100%);
}

.swatch-holo {
  background: linear-gradient(135deg, #041226 35%, #0E7AA6 68%, #38D9F5 100%);
}

/* Info Callout */
.info-callout {
  margin-top: 14px;
  padding: 13px 14px;
  border-radius: var(--radius-sub);
  border: 1px solid var(--border-subtle);
  background: var(--accent-soft);
}

.callout-note {
  background: var(--bg-subcard);
  border-color: var(--border-strong);
}

.callout-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-bright);
}

.callout-text {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* Links Grid */
.links-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 13px;
}

.links-grid .field-group {
  margin-bottom: 0;
}

/* Radio Pills */
.radio-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.radio-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 8px 6px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subcard);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.radio-pill input {
  margin: 0;
  accent-color: var(--accent);
}

.radio-pill:has(input:checked) {
  border-color: var(--accent-bright);
  background: var(--accent-soft);
  color: var(--accent-bright);
}

/* Confirmation Checkboxes */
.check-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 13px;
  border-radius: var(--radius-sub);
  border: 1px solid var(--border-subtle);
  background: var(--bg-subcard);
  font-size: 13.5px;
  line-height: 1.55;
  cursor: pointer;
}

.check-item:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.check-item input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex-shrink: 0;
}

.check-item-optional {
  border-style: dashed;
}

.check-num {
  color: var(--accent-bright);
  margin-right: 4px;
}

/* Action Buttons */
.action-card {
  border-color: var(--border-strong);
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.btn-primary,
.btn-secondary {
  width: 100%;
  min-height: 52px;
  padding: 13px 16px;
  border-radius: var(--radius-input);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid transparent;
  transition: transform 0.12s ease, filter 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn-primary:active,
.btn-secondary:active {
  transform: scale(0.99);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-bright) 0%, var(--accent) 100%);
  color: var(--text-on-accent);
  box-shadow: 0 10px 26px var(--accent-glow);
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-secondary {
  background: var(--bg-subcard);
  border-color: var(--border-strong);
  color: var(--accent-bright);
}

.btn-secondary:hover {
  background: var(--accent-soft);
}

.btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Feedback & Preview */
.feedback-toast {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-strong);
  background: var(--accent-soft);
  color: var(--accent-bright);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.preview-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.preview-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-bright);
}

.preview-textarea {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius-input);
  border: 1px solid var(--border-input);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}

/* Footer */
.page-footer {
  text-align: center;
  padding: 26px 8px 10px;
}

.footer-brand {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.footer-note {
  margin: 0;
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Tablet / Desktop Enhancements */
@media (min-width: 560px) {
  .page-shell {
    padding: 20px 20px 56px;
  }

  .hero-card {
    padding: 28px 26px 22px;
  }

  .hero-title {
    font-size: 28px;
  }

  .form-card {
    padding: 26px 24px;
  }

  .choice-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .theme-choice-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .links-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
