/**
 * ごりらぼ 概算見積もりシミュレーション CSS
 * 
 * Design: ソフトUIフレンドリーデザイン「やさしいステップ」
 * - すべてのセレクタに .grb- プレフィックスを使用（スコープ設計）
 * - 既存サイトのCSSを壊さない
 * - スマホ最適化を最優先
 * - ハイブリッドフォーム（①〜④ 1ページ + ⑤〜⑦ ステップ形式）
 */

/* ===== Google Fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@300;400;500;700&display=swap');

/* ===== CSS Variables ===== */
.grb-simulation {
  --grb-orange: #E8A87C;
  --grb-orange-dark: #D4956A;
  --grb-green: #7CB8A0;
  --grb-green-dark: #5FA088;
  --grb-honey: #F5C882;
  --grb-cream: #FFF8F0;
  --grb-charcoal: #4A4A4A;
  --grb-light-gray: #F5F0EB;
  --grb-font: 'Zen Maru Gothic', 'Hiragino Maru Gothic Pro', sans-serif;
}

/* ===== Reset (scoped) ===== */
.grb-simulation {
  font-family: var(--grb-font);
  color: var(--grb-charcoal);
  background-color: var(--grb-cream);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

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

.grb-simulation img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ===== Container ===== */
.grb-container {
  max-width: 540px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ===== Hero ===== */
.grb-hero {
  padding: 2rem 0 0;
  text-align: center;
}
.grb-hero__image {
  position: relative;
  border-radius: 1.25rem;
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: 4px 4px 16px rgba(0,0,0,0.06), -2px -2px 8px rgba(255,255,255,0.6);
}
.grb-hero__image img {
  width: 100%;
  height: 12rem;
  object-fit: cover;
}
@media (min-width: 640px) {
  .grb-hero__image img { height: 16rem; }
}
.grb-hero__image-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.15) 100%);
}
.grb-hero__content {
  margin-bottom: 1rem;
}
.grb-hero__badge {
  display: inline-block;
  padding: 0.375rem 1rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #FF8C42, #E8A87C);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.grb-hero__handwritten {
  display: block;
  font-size: 1.25rem;
  font-weight: 400;
  color: #666;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.grb-hero__handwritten span {
  font-weight: 700;
  font-size: 1.5rem;
}
.grb-hero__title {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--grb-charcoal);
  line-height: 1.5;
  margin: 0;
}
@media (min-width: 640px) {
  .grb-hero__title { font-size: 1.875rem; }
}

/* ===== CTA Note ===== */
.grb-cta-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 700;
  color: #FF8C42;
  margin: 0.5rem 0 1.5rem;
}
.grb-cta-note__30 {
  font-size: 1.5rem;
  font-weight: 700;
}

/* ===== Form Card ===== */
.grb-form-card {
  background: #fff;
  border-radius: 1.25rem;
  padding: 1.5rem 1.25rem;
  box-shadow: 4px 4px 16px rgba(0,0,0,0.04), -2px -2px 8px rgba(255,255,255,0.6);
  margin-bottom: 2rem;
}

/* ===== Form Group ===== */
.grb-form-group {
  margin-bottom: 0.5rem;
}

/* ===== Form Label ===== */
.grb-form-label {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.5rem;
}
.grb-form-label__num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--grb-green), var(--grb-green-dark));
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 700;
  flex-shrink: 0;
}
.grb-form-label__text {
  font-size: 1.1875rem;
  font-weight: 700;
  color: var(--grb-charcoal);
}

/* ===== Form Hint ===== */
.grb-form-hint {
  font-size: 0.9375rem;
  color: #999;
  margin: 0 0 1rem;
  padding-left: 2.75rem;
  line-height: 1.6;
}
.grb-form-hint--lg {
  font-size: 1rem;
}

/* ===== Divider ===== */
.grb-divider {
  height: 1px;
  background: #F0E8E0;
  margin: 1.5rem 0;
}

/* ===== Option Buttons ===== */
.grb-options {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  padding-left: 0;
}
.grb-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid transparent;
  border-radius: 0.875rem;
  background: var(--grb-light-gray);
  font-family: var(--grb-font);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: left;
  min-height: 3rem;
}
.grb-option:hover {
  border-color: #E8D8C8;
  background: #fff;
}
.grb-option:active {
  transform: scale(0.98);
}
.grb-option.grb-option--selected {
  border-color: var(--grb-orange);
  background: #FFF5ED;
}
.grb-option__label {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--grb-charcoal);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.grb-option--selected .grb-option__label {
  color: var(--grb-orange-dark);
}
.grb-option__badge {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.125rem 0.5rem;
  border-radius: 0.375rem;
  background-color: #E8F5EE;
  color: #1A7A4C;
  border: 1px solid #B8DECA;
}
.grb-option__badge--muted {
  background-color: var(--grb-light-gray);
  color: #999;
  border-color: #E0D8D0;
}
.grb-option__check {
  width: 1.375rem;
  height: 1.375rem;
  border-radius: 50%;
  border: 2px solid #D8D0C8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.grb-option--selected .grb-option__check {
  background: var(--grb-orange);
  border-color: var(--grb-orange);
}
.grb-option--selected .grb-option__check::after {
  content: '';
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: #fff;
}

/* ===== Next Button (Form Phase) ===== */
.grb-next-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem;
  margin-top: 1.5rem;
  border: none;
  border-radius: 1rem;
  font-family: var(--grb-font);
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--grb-orange), var(--grb-orange-dark));
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(232, 168, 124, 0.3);
}
.grb-next-btn:hover { opacity: 0.9; }
.grb-next-btn:active { transform: scale(0.98); }

/* ===== Progress Bar (Step Phase) ===== */
.grb-progress {
  margin-bottom: 1.5rem;
  padding-top: 1.5rem;
}
.grb-progress__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.grb-progress__remaining {
  font-size: 1rem;
  font-weight: 500;
  color: var(--grb-orange);
}
.grb-progress__count {
  font-size: 0.875rem;
  color: #B0A8A0;
}
.grb-progress__bar {
  width: 100%;
  height: 0.375rem;
  background: var(--grb-light-gray);
  border-radius: 999px;
  overflow: hidden;
}
.grb-progress__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--grb-orange), var(--grb-honey));
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ===== Step Content ===== */
.grb-step-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--grb-charcoal);
  margin: 0 0 0.5rem;
}
.grb-step-desc {
  font-size: 1rem;
  color: #999;
  margin: 0 0 1rem;
  line-height: 1.6;
}

/* ===== Name Badge ===== */
.grb-name-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background-color: #FFF5ED;
  border: 1.5px solid #F0D8C0;
}
.grb-name-badge__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background-color: var(--grb-orange);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.grb-name-badge__text {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--grb-orange-dark);
}

/* ===== Text Input ===== */
.grb-input {
  width: 100%;
  padding: 1rem;
  border: 2px solid #E8E0D8;
  border-radius: 0.875rem;
  background: #fff;
  font-family: var(--grb-font);
  font-size: 1.0625rem;
  color: var(--grb-charcoal);
  transition: all 0.2s;
  outline: none;
}
.grb-input::placeholder {
  color: #C0B8B0;
}
.grb-input:focus {
  border-color: var(--grb-orange);
  box-shadow: 0 0 0 3px rgba(232, 168, 124, 0.15);
}

/* ===== Error Message ===== */
.grb-error {
  font-size: 0.875rem;
  color: #D4956A;
  margin-top: 0.5rem;
  padding-left: 0.25rem;
  min-height: 0;
}
.grb-error:empty {
  display: none;
}

/* ===== Step Navigation ===== */
.grb-step-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.grb-back-btn {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  border: 2px solid #E8E0D8;
  border-radius: 0.875rem;
  background: #fff;
  font-family: var(--grb-font);
  font-size: 1rem;
  font-weight: 500;
  color: #999;
  cursor: pointer;
  transition: all 0.2s;
}
.grb-back-btn:hover {
  border-color: #D8D0C8;
  color: var(--grb-charcoal);
}
.grb-step-next-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  flex: 1;
  padding: 0.875rem 1rem;
  border: none;
  border-radius: 0.875rem;
  font-family: var(--grb-font);
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--grb-orange), var(--grb-orange-dark));
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(232, 168, 124, 0.3);
}
.grb-step-next-btn:hover { opacity: 0.9; }
.grb-step-next-btn:active { transform: scale(0.98); }

/* ===== Submit Button ===== */
.grb-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex: 1;
  padding: 0.875rem 1rem;
  border: none;
  border-radius: 0.875rem;
  font-family: var(--grb-font);
  font-size: 1.125rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--grb-green), var(--grb-green-dark));
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(124, 184, 160, 0.3);
}
.grb-submit-btn:hover { opacity: 0.9; }
.grb-submit-btn:active { transform: scale(0.98); }
.grb-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ===== Spinner (送信中) ===== */
.grb-spinner {
  animation: grb-spin 0.8s linear infinite;
}
@keyframes grb-spin {
  to { transform: rotate(360deg); }
}

/* ===== Reassurance ===== */
.grb-reassurance {
  font-size: 0.875rem;
  color: #B0A8A0;
  text-align: center;
  margin-top: 1rem;
}

/* ===== Complete Screen ===== */
.grb-complete__icon {
  width: 5rem;
  height: 5rem;
  border-radius: 50%;
  background: #F0FAF5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}
.grb-complete__title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--grb-charcoal);
  margin: 0 0 0.75rem;
}
@media (min-width: 640px) {
  .grb-complete__title { font-size: 1.875rem; }
}
.grb-complete__desc {
  font-size: 1rem;
  color: #888;
  line-height: 1.7;
  margin: 0 0 1.5rem;
}
.grb-complete__info {
  background: var(--grb-light-gray);
  border-radius: 1rem;
  padding: 1.25rem;
  text-align: left;
  margin-bottom: 1.5rem;
}
.grb-complete__row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0;
}
.grb-complete__row + .grb-complete__row {
  border-top: 1px solid #E8E0D8;
}
.grb-complete__row svg {
  flex-shrink: 0;
  margin-top: 0.125rem;
}
.grb-complete__row-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--grb-charcoal);
  margin: 0 0 0.125rem;
}
.grb-complete__row-desc {
  font-size: 0.875rem;
  color: #999;
  margin: 0;
}
.grb-complete__back {
  display: inline-block;
  font-family: var(--grb-font);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  background: var(--grb-light-gray);
  color: var(--grb-charcoal);
  text-decoration: none;
  transition: opacity 0.2s;
}
.grb-complete__back:hover { opacity: 0.8; }
