/* ==========================================================================
   Spiral Form Modern UI v4.0 - Genius Edition
   (Visuals, Motion, Feedback)
   ========================================================================== */

:root {
  --primary: #FBA051;
  --primary-light: #FFBB80;
  --primary-bg: #FFFBF7;     /* 背景用ごく薄いオレンジ */
  --accent-soft: #FFF5AE;    /* 選択・フォーカス用イエロー */
  --highlight-row: #FFFDF5;  /* 行フォーカス時の背景 */
  --text-main: #333333;
  --text-muted: #666666;
  --bg-sub: #F8F9FA;
  --white: #ffffff;
  --border-radius-lg: 20px;
  --border-radius-md: 12px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 10px 30px rgba(251, 160, 81, 0.08);
  --shadow-inset: inset 0 2px 4px rgba(0,0,0,0.03); /* 入力欄の内側シャドウ */
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* --- Global Reset & Base --- */
#SMP_STYLE *, #SMP_STYLE *::before, #SMP_STYLE *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  outline: none !important;
}

#SMP_STYLE ul, #SMP_STYLE li {
  list-style: none !important;
  padding: 0;
  margin: 0;
}

#SMP_STYLE .body {
  margin: 0;
  padding: 0 0 80px;
  background-color: var(--bg-sub);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(251, 160, 81, 0.05) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(251, 160, 81, 0.05) 0%, transparent 20%);
  font-family: 'LINE Seed JP', sans-serif;
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
}

/* --- Animation Keyframes --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Header Area --- */
#SMP_STYLE .top_bar {
  height: 8px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  width: 100%;
}
/* --- Global Header --- */
.global-header {
  background-color: #FFF;
  border-bottom: 2px solid #FB8C00;
  padding: 15px 20px;
  width: 100%;
  position: relative;
  z-index: 1000;
}

.global-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-enecoop {
  display: flex;
  align-items: center;
}

.logo-enecoop img {
  height: 55px;
  width: auto;
  display: block;
}

/* Nav Menu (Hidden by default, used only in Overlay) */
.global-nav {
  display: none; /* Always hidden in the bar to use Hamburger */
}

/* --- Form Header Adjustments (Center Style) --- */
/* --- Form Header Adjustments (Optimized Grid Layout) --- */
#SMP_STYLE .form_header {
  padding: 50px 20px 30px;
  background: none;
}

#SMP_STYLE .header_row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

#SMP_STYLE .icon_left {
  justify-self: end;
  display: flex;
  align-items: center;
}

#SMP_STYLE .icon_left img {
  width: 85px;
  height: auto;
  display: block;
}

#SMP_STYLE .title_area {
  justify-self: center;
  text-align: center;
}

.title-with-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.title-text {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#SMP_STYLE .main_title {
  font-size: 32px;
  line-height: 1.35;
  margin: 5px 0 0;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #333;
}

#SMP_STYLE .icon_right {
  justify-self: start;
  display: flex;
  gap: 15px;
  align-items: center;
}

#SMP_STYLE .icon_right img {
  width: 48px;
  height: auto;
  display: block;
}

#SMP_STYLE .icon_left, #SMP_STYLE .icon_right { display: flex; }

#SMP_STYLE .top_bar {
  height: 4px;
  background: var(--primary-gradient);
  display: block;
}

/* (Old Hamburger Styles Removed) */

@media screen and (max-width: 900px) {
  #SMP_STYLE .header_row { gap: 15px; }
  #SMP_STYLE .icon_left img { width: 65px; }
  #SMP_STYLE .icon_right img { width: 38px; }
  #SMP_STYLE .main_title { font-size: 26px; }
}

@media screen and (max-width: 600px) {
  #SMP_STYLE .form_header { padding: 40px 10px 20px; }
  #SMP_STYLE .header_row { 
    grid-template-columns: 1fr auto 1fr; 
    gap: 8px; 
  }
  #SMP_STYLE .icon_left img { width: 50px; }
  #SMP_STYLE .icon_right img { width: 30px; }
  #SMP_STYLE .icon_right { gap: 8px; }
  #SMP_STYLE .main_title { font-size: 20px; }
  #SMP_STYLE .badge { font-size: 10px; padding: 2px 8px; }
}

/* Badge (Speech Bubble) */
#SMP_STYLE .badge {
  display: inline-block;
  padding: 8px 24px;
  background-color: var(--white);
  border: 2px solid #F5A623; /* Orange border */
  border-radius: 50px;
  color: #333;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 20px; /* Space above title */
  position: relative;
  box-shadow: none;
}

/* Arrow (Border Trick) */
#SMP_STYLE .badge::after {
  content: "";
  position: absolute;
  bottom: -8px; /* Stick out bottom */
  left: 50%;
  transform: translateX(-50%);
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #F5A623; /* Match border color */
}
/* White Mask for Outline Effect */
#SMP_STYLE .badge::before {
  content: "";
  position: absolute;
  bottom: -5px; /* Slightly higher than outer arrow */
  left: 50%;
  transform: translateX(-50%);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #fff; /* Match bg color */
  z-index: 1;
}

#SMP_STYLE .main_title {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.4;
}

/* --- Caution Box (Staggered Anim 1) --- */
#SMP_STYLE .caution_box {
  margin: 10px auto 40px;
  max-width: 600px;
  border: 2px solid var(--primary);
  border-radius: var(--border-radius-lg);
  padding: 30px;
  background-color: var(--white);
  text-align: left;
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  animation-delay: 0.1s;
}

#SMP_STYLE .caution_title {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  margin-bottom: 25px;
  font-size: 16px;
  background: var(--primary);
  padding: 8px 0;
  border-radius: 8px;
}

#SMP_STYLE .caution_box li {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 15px;
  line-height: 1.7;
  padding-left: 1.5em; /* ぶら下げインデント */
  position: relative;
}

#SMP_STYLE .caution_box li::before {
  content: "\25CF" !important; /* Unicode for Black Circle */
  color: var(--primary);
  font-size: 10px;
  position: absolute;
  left: 0;
  top: 4px;
}

#SMP_STYLE .caution_box a {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 700;
}

/* --- Step Indicator (Staggered Anim 2) --- */
#SMP_STYLE .step_indicator {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 40px auto;
  max-width: 600px;
  position: relative;
  animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  animation-delay: 0.2s;
}

#SMP_STYLE .step_indicator::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 192px;
  height: 2px;
  border-top: 3px dashed var(--primary);
  z-index: 1;
  transform: translate(-50%, -50%);
}

#SMP_STYLE .step {
  width: 56px; height: 56px;
  background-color: var(--white);
  border: 2px solid var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  position: relative;
  z-index: 2;
  box-shadow: var(--shadow-sm);
}

#SMP_STYLE .step.is_active {
  background-color: var(--primary);
  color: var(--white);
  box-shadow: 0 0 0 4px rgba(251, 160, 81, 0.2), 0 4px 10px rgba(251, 160, 81, 0.3);
  transform: scale(1.05); /* Slightly larger */
}

#SMP_STYLE .step.is_done {
  background-color: #fff;
  border-color: #2ecc71;
  color: #2ecc71;
}

#SMP_STYLE .step.is_done::after {
  content: "\2713"; /* Checkmark */
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #2ecc71;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

/* --- Guidance & Error Messages --- */
#SMP_STYLE .header_rmesg {
  display: inline-block;
  text-align: left;
  font-size: 14px;
  color: #555;
  background-color: #f0f2f5;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 16px 20px 16px 52px;
  margin: 10px auto 40px; /* Increased bottom margin */
  max-width: 600px;
  line-height: 1.6;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
  animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
  animation-delay: 0.3s;
}

#SMP_STYLE .header_rmesg::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23FBA051' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cline x1='12' y1='16' x2='12' y2='12'%3E%3C/line%3E%3Cline x1='12' y1='8' x2='12.01' y2='8'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: contain;
}

#SMP_STYLE .header_emesg {
  display: none; /* Hidden by default, shown by JS */
  margin: 20px auto 30px;
  max-width: 650px;
  width: 90%;
  background-color: #FFF5F5;
  border: 2px solid #FF4D4D;
  border-radius: var(--border-radius-md);
  padding: 24px;
  text-align: center;
  color: #D32F2F;
  animation: fadeInUp 0.8s backwards;
}

#SMP_STYLE .header_emesg p { margin: 0; font-size: 14px; line-height: 1.6; }

/* --- Form Container --- */
#SMP_STYLE form {
  background-color: transparent; /* Changed from white */
  max-width: 700px;
  margin: 0 auto 40px; /* Removed top margin */
  border-radius: 0;
  padding: 0; /* Changed from 20px */
  box-shadow: none; /* Removed shadow */
}

#SMP_STYLE .smp_tmpl {
  padding: 30px 20px 0; /* Reduced bottom padding */
  text-align: left;
}

/* --- Section Title (Refined: Text & Line Match) --- */
#SMP_STYLE .section_title {
  position: relative;
  font-size: 20px;
  font-weight: 800; /* ExtraBold for Headings */
  color: var(--primary); /* Text matches theme color */
  margin: 20px 0 20px; /* Reduced top/bottom margin */
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary); /* Line matches text */
  letter-spacing: 0.05em;
  padding-left: 0; /* Removed indent */
}

#SMP_STYLE .section_title:nth-of-type(n) { animation: none; }

/* --- Required Badge (Ideal Reference Style) --- */
#SMP_STYLE .badge-required {
  display: inline-block;
  background: none;
  border: none;
  color: #E03131; /* Deep Red */
  font-size: 13px; /* Slightly larger */
  font-weight: 700;
  padding: 0;
  margin-left: 8px;
  vertical-align: 0;
}

#SMP_STYLE .badge-required::before {
  content: "\203B"; /* Unicode for Reference Mark */
  margin-right: 1px;
}

/* --- Static Luxury Layout (The Ultimate Reset) --- */
#SMP_STYLE dl {
  position: relative;
  margin-bottom: 24px;
  padding: 0 0 30px; /* Spacing handled via margin/padding mix for rhythm */
  border-bottom: 1px solid #EAEAEA; /* Subtle separator instead of boxes */
  background-color: transparent;
  transition: none;
  animation: none; /* No entrance animation */
}

#SMP_STYLE dl:focus-within {
  background-color: transparent;
  border-color: #EAEAEA;
  box-shadow: none;
  transform: none;
}

/* Label (The Pillar) */
#SMP_STYLE dt.title {
  position: static;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 700;
  color: #333; /* High contrast dark gray */
  letter-spacing: 0.05em;
  transform: none;
  pointer-events: auto;
}

#SMP_STYLE dl:focus-within dt.title {
  color: var(--primary); /* subtle color shift only */
  transform: none;
}

/* Required Badge (Minimal & Sharp) */
#SMP_STYLE .badge-required {
  display: inline-block;
  background-color: #FFF;
  border: 1px solid #FF4D4D;
  color: #FF4D4D;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 4px;
  margin-left: 12px;
  vertical-align: middle;
  letter-spacing: 0.05em;
  box-shadow: none;
  transform: none;
  animation: none; /* Stop the pulse */
}

#SMP_STYLE .badge-required::before { display: none; }

/* Content Wrapper */
#SMP_STYLE dd.data {
  margin: 0; /* Override UA default */
  padding: 0 0 0 16px; /* Indent slightly for hierarchy on PC */
  min-height: auto;
  display: block;
}

/* Inputs (Solid & Tactile) */
#SMP_STYLE .input, #SMP_STYLE textarea, #SMP_STYLE select {
  display: block;
  width: 100%;
  background-color: #FFF !important;
  border: 1px solid #CCC !important; /* Proper solid border */
  border-radius: 6px; /* Tighter radius for professional look */
  padding: 14px 16px;
  margin: 0;
  font-size: 16px;
  color: #111;
  line-height: 1.5;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03); /* Extremely subtle depth */
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* Focus: Pure state change, no movement */
#SMP_STYLE .input:focus, #SMP_STYLE textarea:focus, #SMP_STYLE select:focus {
  background-color: #FFF !important;
  border-color: var(--primary) !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(251, 160, 81, 0.15) !important;
  transform: none;
}

/* --- Submit Button (Static Luxury - Boxy) --- */
#SMP_STYLE input.submit {
  display: block;
  width: 100%;
  max-width: 320px; /* Match the new standard input width */
  height: 56px; /* Slightly more compact height */
  margin: 20px auto 40px; /* Reduced top/bottom margin */
  border: none;
  border-radius: 8px; /* Boxy Match */
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: var(--white);
  font-size: 18px;
  font-weight: 800; /* ExtraBold for Action */
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: opacity 0.3s, transform 0.2s, box-shadow 0.3s;
  box-shadow: 0 4px 12px rgba(251, 160, 81, 0.3); /* Grounded shadow */
  position: relative;
  overflow: hidden;
  z-index: 1;
}

#SMP_STYLE input.submit:hover {
  box-shadow: 0 6px 16px rgba(251, 160, 81, 0.4);
  filter: brightness(1.05);
  transform: none;
}

#SMP_STYLE input.submit:active {
  box-shadow: 0 2px 6px rgba(251, 160, 81, 0.3);
  transform: none;
}

/* PC Width Constraints & Specific Field Tuning */
@media screen and (min-width: 601px) {
  /* Default tight width */
  #SMP_STYLE .input { max-width: 320px; }
  #SMP_STYLE select { max-width: 320px; }

  /* Full width allowed for specific textareas/large fields */
  #SMP_STYLE input[name*="mail"], 
  #SMP_STYLE input[name*="address"], 
  #SMP_STYLE textarea { max-width: 100%; }

  /* Specific Field Optimizations */
  /* Member Number: Tight (150px) */
  #SMP_STYLE input[name="f014066299"] { max-width: 150px; }

  /* Member Name: Medium (220px) */
  #SMP_STYLE input[name="f014066300"] { max-width: 220px; }
}

/* --- Radio Tiles Master (Toggle Button Style) --- */
/* Matches the "Green Button" look in reference, but with Orange */
#SMP_STYLE .multi2 ul {
  display: flex !important;
  flex-wrap: wrap;
  gap: 12px; /* Open up spacing */
  list-style: none !important;
  padding: 0;
  margin: 0;
}

#SMP_STYLE .multi2 li {
  flex: 1 1 auto; /* Allow growth */
  margin: 0;
}

#SMP_STYLE .multi2 label {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 100px; /* Base width */
  padding: 16px 12px; /* Taller touch target */

  /* Unchecked State: Warm Tint BG, ExtraBold Theme Text */
  background-color: #FFFBF5; /* Very subtle warm white */
  border: 1px solid var(--primary);
  border-radius: 6px;

  color: var(--primary); /* Restore Theme Color */
  font-weight: 800; /* ExtraBold for Readability */
  font-size: 17px;
  letter-spacing: 0.05em; /* Open up spacing slightly */
  text-shadow: none;

  cursor: pointer;
  box-shadow: none;
  transition: all 0.2s;
  position: relative;
}

/* Hover: Slight fill */
#SMP_STYLE .multi2 label:hover {
  background-color: #FFF9F0;
  color: var(--primary);
}

/* Selected State: Solid Color Fill */
#SMP_STYLE .multi2 label:has(input:checked) {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #FFF;
  box-shadow: 0 4px 12px rgba(251, 160, 81, 0.3);
}

/* Custom Circle Indicator (Removed) */
#SMP_STYLE .multi2 label:has(input:checked)::before { content: none; }

/* Hide native input */
#SMP_STYLE .multi2 label input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  transform: none;
  box-shadow: none;
}

/* (Removed conflicting 2px border rule that caused jumping) */
#SMP_STYLE .multi2 label:has(input:checked)::after { content: none; } /* No checkmark */

/* --- Badge Pulse Animation --- */
@keyframes badgePulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(255, 107, 107, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); }
}

#SMP_STYLE .badge-required {
  animation: badgePulse 2s infinite;
}

/* --- Zip / Phone / Time --- */
#SMP_STYLE .zipcode ul, #SMP_STYLE .phone ul, #SMP_STYLE .time ul {
  display: flex; align-items: center; gap: 10px;
}

#SMP_STYLE .zipcode li, #SMP_STYLE .phone li, #SMP_STYLE .time li {
  flex: 0 0 auto; display: flex; align-items: center; gap: 5px;
}

#SMP_STYLE .zipcode input, #SMP_STYLE .phone input {
  text-align: center; 
  width: 100px; /* Fixed logical width for number segments */
  padding: 12px 10px; /* Slightly reduced padding */
}

/* --- Date Icon --- */
#SMP_STYLE .is_date {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23FB8C00' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 16px center !important;
  padding-right: 48px !important;
  background-size: 20px;
}

/* --- Error Highlight (New Validation Feedback) --- */
#SMP_STYLE dd.data.error-highlight {
  background-color: #FFF5F5;
  border-radius: 8px;
  padding: 15px 15px 15px 20px; 
  border: 1px dashed #FF4D4D;
  transition: all 0.3s;
}

#SMP_STYLE dd.data.error-highlight .input {
  border-color: #FF4D4D !important;
  background-color: #FFF !important;
}

#SMP_STYLE .js-error-msg, #SMP_STYLE .msg {
  color: #FF4D4D !important;
  margin-top: 8px !important;
  display: block !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

@media screen and (max-width: 600px) {
  #SMP_STYLE .smp_tmpl { padding: 25px 15px; }
  #SMP_STYLE dl { padding: 20px 15px; margin-bottom: 15px; }
  #SMP_STYLE .section_title { margin: 30px 0 20px; font-size: 18px; }
  #SMP_STYLE .multi2 label { flex: 1 1 100%; }
  #SMP_STYLE .step_indicator { gap: 25px; }
  #SMP_STYLE .step_indicator::before { width: 140px; }

  /* Mobile padding tweaks */
  #SMP_STYLE .input, #SMP_STYLE textarea, #SMP_STYLE select {
    padding: 14px 16px;
    font-size: 16px; 
  }

  /* Remove indentation on mobile */
  #SMP_STYLE dd.data { padding: 0; }

  /* Mobile: Split Field Optimization */
  #SMP_STYLE .zipcode ul, #SMP_STYLE .phone ul, #SMP_STYLE .time ul {
    gap: 4px; /* Tighter gap */
    width: 100%; /* Ensure container uses full width */
  }
  #SMP_STYLE .zipcode li, #SMP_STYLE .phone li, #SMP_STYLE .time li {
    flex: 1 1 0px; /* FORCE shrink/grow equally */
    gap: 2px;
    width: auto;
  }
  #SMP_STYLE .zipcode input, #SMP_STYLE .phone input {
    width: 100%; /* Fill the flexible li */
    flex: 1; 
    padding: 12px 2px; /* Minimal padding */
    min-width: 0; /* Prevent overflow */
    box-sizing: border-box;
  }
  
  /* Error Highlight adjustment for Mobile */
  #SMP_STYLE dd.data.error-highlight {
    padding: 15px;
  }

  /* Header Mobile Optimization */
  #SMP_STYLE .header_row {
    flex-direction: row; /* Keep horizontal */
    align-items: center; /* Center vertically */
    justify-content: center;
    gap: 5px; /* Tight gap */
  }
  #SMP_STYLE .title_area {
    flex: 1; /* Allow title to take spacing */
    min-width: 0; /* Allow shrinking */
  }
  #SMP_STYLE .icon_left img { width: 50px; }
  #SMP_STYLE .main_title { font-size: 29px; line-height: 1.3; margin: 0; }
  #SMP_STYLE .badge { 
    font-size: 10px; 
    padding: 3px 10px; 
    margin-bottom: 5px;
    border: 1px solid #F5A623;
  }
  #SMP_STYLE .badge::after { bottom: -6px; border-width: 6px; } /* Smaller arrow */
  #SMP_STYLE .badge::before { bottom: -4px; border-width: 5px; }
  
  #SMP_STYLE .icon_right { gap: 5px; }
  #SMP_STYLE .icon_right img { width: 30px; }
}

/* Specific Fix: Privacy Policy Button Size */
#SMP_STYLE .multi2 label:has(input[name="f014114161"]) {
  flex: 0 0 auto !important; /* Stop growing */
  max-width: 200px; /* Limit width */
  margin: 0;
}



/* --- Form Grouping (Custom Request) --- */
/* Groups "Member Number" through "Consent" */
#SMP_STYLE .form-group-custom {
  background-color: var(--white);
  max-width: 700px;
  margin: 20px auto 40px;
  border-radius: 20px; /* User requested 20px explicitly or via variable */
  padding: 20px;
  box-shadow: var(--shadow-md);
  border: none; /* Remove previous border */
}
/* Adjust spacing inside the group */
#SMP_STYLE .form-group-custom .section_title {
  margin-top: 10px; /* Reduce top margin for headers inside group */
}
#SMP_STYLE .form-group-custom dl:last-child {
  border-bottom: none; /* Remove last border */
  margin-bottom: 0;
}


/* --- Visual Tank Selection (2x2 Grid) --- */
#SMP_STYLE .visual-grid ul {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 10px; /* Reduced gap for mobile */
}

#SMP_STYLE .visual-grid li {
  width: 100%;
}

#SMP_STYLE .visual-grid label {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end; /* Text at bottom */
  height: 160px; /* Increased height for long text */
  padding: 10px;
  background-color: #EEE; /* Default bg */
  border: 2px solid #DDD;
  border-radius: 8px;
  text-align: center;
  font-size: 13px; /* Slightly smaller text */
  line-height: 1.3;
  color: #333;
  transition: all 0.2s;
  background-repeat: no-repeat;
  line-height: 1.3;
  color: #333;
  transition: all 0.2s;
  background-repeat: no-repeat;
  background-position: center 20px; /* Moved icon up */
  background-size: 80px auto; /* Increased size significantly */
}

/* Background Images per Value */
/* Value 1: Full (tank490.png) */
#SMP_STYLE .visual-grid label:has(input[value="1"]) {
  background-image: url("https://enecoop.sapporo.coop/lp/spiral_file/spiral_img/tank490.png");
}
/* Value 2: Qty (tank490.png) */
#SMP_STYLE .visual-grid label:has(input[value="2"]) {
  background-image: url("https://enecoop.sapporo.coop/lp/spiral_file/spiral_img/tank490.png");
}
/* Value 3: Poly (can300.png) */
#SMP_STYLE .visual-grid label:has(input[value="3"]) {
  background-image: url("https://enecoop.sapporo.coop/lp/spiral_file/spiral_img/can300.png");
}
/* Value 4: 90L (tank90.png) */
#SMP_STYLE .visual-grid label:has(input[value="4"]) {
  background-image: url("https://enecoop.sapporo.coop/lp/spiral_file/spiral_img/tank90.png");
}


/* Selected State */
#SMP_STYLE .visual-grid label:has(input:checked) {
  background-color: #FFF5E0;
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 800;
  box-shadow: 0 4px 10px rgba(251, 160, 81, 0.2);
}

#SMP_STYLE .visual-grid label:hover {
  background-color: #FFF;
  border-color: var(--primary-light);
}

/* Tank Badges for Differentiation */
#SMP_STYLE .badge-tank {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  margin-bottom: 5px; /* Changed from margin-top */
  font-size: 13px;
}
#SMP_STYLE .badge-full {
  background-color: #FFF3E0;
  color: #E65100;
  border: 1px solid #FFE0B2;
}
#SMP_STYLE .badge-qty {
  background-color: #E3F2FD;
  color: #1565C0;
  border: 1px solid #BBDEFB;
}

/* --- Initial Qualification Modal --- */
#modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0; /* Cover full screen securely */
  background-color: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 2147483647; /* Max Z-Index safely */
  display: flex; /* Removed !important to allow JS toggling */
  align-items: center !important;
  justify-content: center !important;
  padding: 20px;
}

.modal-card {
  background: var(--white);
  width: 100%;
  max-width: 450px;
  border-radius: var(--border-radius-lg);
  padding: 40px 30px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  animation: fadeInUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  margin: auto; /* Fallback centering */
}

.modal-title {
  color: var(--primary);
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 20px;
}

.modal-text {
  font-size: 16px;
  line-height: 1.8;
  color: #333;
  margin-bottom: 30px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
  line-height: 1.4;
}

.modal-btn span.sub {
  font-size: 13px;
  font-weight: 400;
  opacity: 0.9;
}

.modal-btn:active { transform: scale(0.98); }

.btn-primary {
  background-color: var(--primary);
  color: #FFF;
  box-shadow: 0 4px 12px rgba(251, 160, 81, 0.3);
}

.btn-secondary {
  background-color: #FFF;
  color: var(--primary);
  border: 2px solid var(--primary);
  box-shadow: none;
}
.btn-secondary:hover {
  background-color: #FFF5E0; /* Light orange tint on hover */
}

.modal-link-btn {
  display: block;
  width: 100%;
  padding: 16px;
  background-color: var(--primary);
  color: #FFF;
  text-align: center;
  text-decoration: none;
  font-weight: 800;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(251, 160, 81, 0.3);
  transition: opacity 0.3s;
}

.modal-link-btn:hover {
  opacity: 0.9;
}

/* ==========================================================================
   Flatpickr Custom Styles for Spiral Form
   ========================================================================== */

/* --- Container Adjustment (Mobile Fix) --- */
.flatpickr-calendar.inline {
    width: 100% !important;
    max-width: 320px; /* Standard constraint for desktop/tablet */
    margin: 20px auto !important; /* Center the calendar ALWAYS */
    box-shadow: 0 10px 30px rgba(0,0,0,0.08) !important; /* Gentle shadow */
    border: 1px solid #EAEAEA !important;
    border-radius: 12px !important;
}

/* Fix mobile month navigation overlap and ensure year is visible */
.flatpickr-month {
    height: 40px !important;
    position: relative !important;
}

.flatpickr-prev-month, .flatpickr-next-month {
    height: 40px !important;
    padding: 10px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 5 !important;
}

.flatpickr-current-month {
    padding: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    height: 40px !important;
    width: 70% !important; /* Reduced width to avoid overlap with arrows */
    left: 15% !important; /* Centered with room for arrows */
    position: absolute !important;
    top: 0 !important;
}

/* Month Dropdown and Year Input spacing */
.flatpickr-current-month .flatpickr-monthDropdown-months {
    width: auto !important;
    margin-right: 5px !important;
}
.flatpickr-current-month .numInputWrapper {
    width: 75px !important;
}

/* Ensure year is visible and positioned correctly */
.flatpickr-current-month input.cur-year {
    font-weight: 700 !important;
    color: #333 !important;
    font-size: 18px !important;
}

/* --- Color Coding (Sat/Sun/Holidays) --- */
/* Weekday Headers */
.flatpickr-weekday:nth-child(1) { color: #E03131 !important; font-weight: 700 !important; }
.flatpickr-weekday:nth-child(7) { color: #1565C0 !important; font-weight: 700 !important; }

/* Day Cells - Holidays only as per request */
.flatpickr-day.is-holiday {
    color: #E03131 !important;
}

/* Disabled Days (Gray) */
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: #ccc !important;
    opacity: 0.5;
}

/* Selected Day -> Primary Theme Color (Orange) */
.flatpickr-day.selected {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important; /* Force white text */
}

/* --- Mobile Size Opt --- */
@media screen and (max-width: 480px) {
    .flatpickr-calendar.inline {
       max-width: 100% !important; /* Take full width on mobile */
    }
    .flatpickr-days {
        width: 100% !important;
    }
    .dayContainer {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
    }
    /* Increase tap size */
    .flatpickr-day {
        height: 48px !important;
        line-height: 48px !important;
        max-width: none !important; /* Let it expand */
        font-size: 18px !important; /* Increase font for mobile */
    }
    .flatpickr-weekday {
        font-size: 14px !important;
    }
}


#SMP_STYLE dl:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* --- Confirmation Page Specific --- */
#SMP_STYLE .data_value {
    padding: 12px 16px;
    background-color: #f8fafc;
    border-radius: 6px;
    font-weight: 700;
    color: #333;
    line-height: 1.6;
    word-break: break-all;
    border: 1px solid #edf2f7;
}

#SMP_STYLE .confirm_actions {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding-bottom: 40px;
}

#SMP_STYLE .submit_primary {
    width: 100%;
    max-width: 400px;
}

#SMP_STYLE .btn_back {
    background: #fff;
    border: 1px solid #cbd5e1;
    color: #64748b;
    padding: 12px 40px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

#SMP_STYLE .btn_back:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #334155;
}

/* ==========================================================================
   Hamburger Menu Integration (Custom for Spiralフォーム)
   ========================================================================== */

/* Hamburger Button Styling */
.hamburger-btn {
  display: flex !important;
  flex-direction: column;
  justify-content: space-between;
  width: 32px;
  height: 24px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 2147483647 !important; /* MATCH Max Z-Index for modal compatibility */
  position: relative;
  pointer-events: auto !important; /* Force clicks even if parent has none */
}

.hamburger-btn span {
  width: 100%;
  height: 3px;
  background-color: #5d4037 !important;
  border-radius: 3px;
  transition: all 0.3s;
}

/* Hamburger active state (transforms to X) */
.hamburger-btn.is_active span:nth-child(1) {
  transform: translateY(10.5px) rotate(45deg);
}
.hamburger-btn.is_active span:nth-child(2) {
  opacity: 0;
}
.hamburger-btn.is_active span:nth-child(3) {
  transform: translateY(-10.5px) rotate(-45deg);
}

/* Mobile/PC Nav Overlay (Full Screen Modern Design) */
.mobile-nav-overlay {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100% !important;
  height: 100% !important;
  background-color: rgba(255, 255, 255, 0.98) !important;
  z-index: 2147483646 !important; /* Just below button */
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex !important;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  backdrop-filter: blur(10px);
}

.mobile-nav-overlay.is_active {
  opacity: 1 !important;
  visibility: visible !important;
}

.nav-logo {
  margin-bottom: 40px;
  opacity: 0;
  transform: translateY(-20px);
  transition: all 0.4s ease 0.1s;
}

.mobile-nav-overlay.is_active .nav-logo {
  opacity: 1;
  transform: translateY(0);
}

.nav-logo img {
  height: 50px;
  width: auto;
}

.mobile-nav-overlay ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: 400px;
}

.mobile-nav-overlay li {
  margin-bottom: 0;
  border-bottom: none;
  padding: 0;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.4s ease;
}

.mobile-nav-overlay.is_active li:nth-child(1) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.mobile-nav-overlay.is_active li:nth-child(2) { transition-delay: 0.15s; opacity: 1; transform: translateY(0); }
.mobile-nav-overlay.is_active li:nth-child(3) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.mobile-nav-overlay.is_active li:nth-child(4) { transition-delay: 0.25s; opacity: 1; transform: translateY(0); }

.mobile-nav-overlay a {
  text-decoration: none;
  color: #333;
  font-family: inherit;
  font-weight: 800;
  font-size: 18px;
  display: block;
  padding: 20px;
  transition: all 0.2s;
  letter-spacing: 0.05em;
  border-radius: 8px;
}

.mobile-nav-overlay a:hover {
  color: #5d4037;
  background-color: #FFF9C4;
  transform: scale(1.02);
}

.mobile-nav-overlay a:active {
  background-color: #FBC02D;
  color: #fff;
  transform: scale(0.98);
}
