/* =========================================================
   Studio Rocky — かんたん見積り（見積りビルダー）
   共通の css/style.css の上に足す。紺×金の意匠は systems ページと共通。
   ========================================================= */
:root {
  --q-navy: #0f1b2d; --q-navy-2: #16243a; --q-gold: #c9a54a; --q-gold-2: #e7cf8a;
  --q-grad-gold: linear-gradient(135deg, #b8923a 0%, #e7cf8a 50%, #c9a54a 100%);
  --q-ink: #1b2430;
}
main { overflow-x: clip; }

/* ---------- ヘッダー ---------- */
.q-hero {
  position: relative; color: #fff; overflow: hidden;
  background:
    radial-gradient(70% 60% at 85% 20%, rgba(201,165,74,0.18), transparent 60%),
    radial-gradient(60% 50% at 10% 90%, rgba(66,165,245,0.14), transparent 60%),
    linear-gradient(180deg, var(--q-navy) 0%, var(--q-navy-2) 100%);
  padding: calc(var(--nav-h) + clamp(36px, 5vw, 64px)) 0 clamp(90px, 10vw, 130px);
}
.q-hero::after { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px); background-size: 28px 28px; -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent 85%); mask-image: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent 85%); }
.q-hero .container { position: relative; z-index: 1; text-align: center; }
.q-hero .crumbs { font-size: 0.85rem; color: rgba(255,255,255,0.6); margin-bottom: 14px; }
.q-hero .crumbs a:hover { color: #fff; }
.q-hero .eyebrow { color: var(--q-gold-2); }
.q-hero h1 { font-size: clamp(1.8rem, 4.2vw, 3rem); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 12px; line-height: 1.2; }
.q-hero p { color: rgba(255,255,255,0.82); max-width: 640px; margin: 0 auto; font-size: clamp(0.95rem, 1.4vw, 1.06rem); }
.q-hero__badges { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 22px; }
.q-hero__badges span { font-size: 0.8rem; font-weight: 600; color: rgba(255,255,255,0.88); border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.06); padding: 6px 12px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; }
.q-hero__badges i { width: 8px; height: 8px; border-radius: 50%; background: var(--q-gold-2); display: inline-block; }

/* ---------- ステップの帯（ヘッダーに食い込ませる） ---------- */
.q-rail { margin-top: -62px; position: relative; z-index: 2; }
.q-rail__inner {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px; box-shadow: var(--shadow-lg); padding: 8px; overflow: hidden;
}
.q-rail__step { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 12px 10px; border-radius: 999px; font-weight: 700; font-size: 0.92rem; color: var(--text-mute); transition: background 0.35s, color 0.35s; }
.q-rail__step i { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 0.8rem; font-weight: 800; background: var(--surface-2); color: var(--text-mute); border: 1px solid var(--line); transition: all 0.35s; }
.q-rail__step.done i { background: var(--q-navy); color: var(--q-gold-2); border-color: var(--q-navy); }
.q-rail__step.now { background: var(--q-navy); color: #fff; }
.q-rail__step.now i { background: var(--q-grad-gold); color: var(--q-ink); border-color: transparent; }

/* ---------- レイアウト ---------- */
.q-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(22px, 3vw, 40px); align-items: start; padding-block: clamp(36px, 5vw, 56px) clamp(64px, 8vw, 110px); }
.q-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(22px, 3vw, 34px); box-shadow: var(--shadow-xs); margin-bottom: 22px; position: relative; }
.q-panel[hidden] { display: none; }
.q-panel__head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.q-panel__num { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--q-navy); color: var(--q-gold-2); font-weight: 800; flex: none; }
.q-panel__head h2 { font-size: 1.22rem; margin: 0; }
.q-panel__head p { margin: 2px 0 0; color: var(--text-soft); font-size: 0.9rem; }

/* システムのカード */
.q-sys-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.q-sys { position: relative; text-align: left; background: var(--surface); border: 1.5px solid var(--line); border-radius: 18px; padding: 0; overflow: hidden; cursor: pointer; font: inherit; color: var(--text); transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s; }
.q-sys:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(201,165,74,0.55); }
.q-sys.on { border-color: var(--q-gold); box-shadow: 0 0 0 4px rgba(201,165,74,0.18), var(--shadow); }
.q-sys__img { aspect-ratio: 16 / 8; overflow: hidden; background: #0b1424; }
.q-sys__img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s var(--ease); }
.q-sys:hover .q-sys__img img { transform: scale(1.04); }
.q-sys__body { padding: 14px 16px 16px; }
.q-sys__body b { display: block; font-size: 1rem; margin-bottom: 4px; line-height: 1.35; }
.q-sys__body span { display: block; color: var(--text-soft); font-size: 0.84rem; line-height: 1.5; }
.q-sys__body em { display: inline-block; margin-top: 10px; font-style: normal; font-size: 0.8rem; font-weight: 700; color: #7d6320; background: rgba(201,165,74,0.14); padding: 4px 10px; border-radius: 999px; }
.q-sys__check { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; background: var(--q-grad-gold); color: var(--q-ink); display: grid; place-items: center; font-weight: 900; opacity: 0; transform: scale(0.6); transition: all 0.3s var(--ease); box-shadow: 0 6px 14px rgba(201,165,74,0.4); }
.q-sys.on .q-sys__check { opacity: 1; transform: scale(1); }

/* 数量 */
.q-units { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; }
.q-stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.q-stepper button { width: 52px; height: 52px; border: none; background: transparent; font-size: 1.4rem; cursor: pointer; color: var(--text); font-weight: 700; transition: background 0.2s; }
.q-stepper button:hover { background: rgba(201,165,74,0.16); }
.q-stepper input { width: 84px; height: 52px; border: none; background: transparent; text-align: center; font: inherit; font-size: 1.4rem; font-weight: 800; color: var(--text); }
.q-stepper input:focus { outline: none; }
.q-units__help { color: var(--text-soft); font-size: 0.9rem; margin: 0; }
.q-units__help b { color: var(--text); }
.q-range { width: 100%; margin-top: 16px; accent-color: var(--q-gold); }

/* オプション */
.q-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.q-opt { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; background: var(--surface); transition: border-color 0.25s, background 0.25s, transform 0.25s; }
.q-opt:hover { border-color: rgba(201,165,74,0.55); transform: translateY(-2px); }
.q-opt input { position: absolute; opacity: 0; pointer-events: none; }
.q-opt .tick { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-strong); flex: none; display: grid; place-items: center; color: transparent; font-size: 0.8rem; font-weight: 900; transition: all 0.2s; }
.q-opt.on { border-color: var(--q-gold); background: rgba(201,165,74,0.08); }
.q-opt.on .tick { background: var(--q-grad-gold); border-color: transparent; color: var(--q-ink); }
.q-opt__name { flex: 1; font-size: 0.92rem; font-weight: 600; line-height: 1.4; }
.q-opt__price { font-size: 0.8rem; color: #7d6320; font-weight: 700; white-space: nowrap; }
.q-opt__price.ask { color: var(--text-mute); }
.q-empty { color: var(--text-mute); font-size: 0.9rem; }

/* お客様情報 */
.q-form .field { margin-bottom: 16px; }
.q-form .radio-group { grid-template-columns: 1fr 1fr; }
.q-form textarea { min-height: 110px; }
.q-form .form-note { margin-top: 4px; }

/* ---------- 右側：御見積プレビュー ---------- */
.q-side { position: sticky; top: calc(var(--nav-h) + 16px); }
.q-ticket { position: relative; background: #fff; border-radius: 18px; box-shadow: 0 30px 60px rgba(15,27,45,0.18), 0 0 0 1px rgba(15,27,45,0.06); overflow: hidden; }
.q-ticket__head { background: linear-gradient(135deg, var(--q-navy), #1f3050); color: #fff; padding: 18px 22px 16px; }
.q-ticket__head small { display: block; font-size: 0.7rem; letter-spacing: 0.18em; color: var(--q-gold-2); font-weight: 700; }
.q-ticket__head b { display: block; font-size: 1.05rem; margin-top: 2px; }
.q-ticket__progress { height: 6px; background: rgba(255,255,255,0.15); border-radius: 999px; margin-top: 12px; overflow: hidden; }
.q-ticket__progress i { display: block; height: 100%; width: 0; background: var(--q-grad-gold); transition: width 0.6s var(--ease); }
.q-ticket__meta { display: flex; justify-content: space-between; font-size: 0.72rem; color: rgba(255,255,255,0.7); margin-top: 6px; }
.q-ticket__body { padding: 18px 22px; }
.q-ticket__sys { font-weight: 800; font-size: 0.98rem; margin: 0 0 4px; }
.q-ticket__sub { color: var(--text-mute); font-size: 0.82rem; margin: 0 0 12px; }
.q-lines { list-style: none; margin: 0; padding: 0; border-top: 1px dashed var(--line-strong); }
.q-lines li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line-strong); font-size: 0.86rem; animation: qIn 0.35s var(--ease); }
.q-lines li span { color: var(--text-soft); }
.q-lines li b { white-space: nowrap; }
.q-lines li b.ask { color: var(--text-mute); font-weight: 600; }
@keyframes qIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.q-total { margin-top: 14px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.q-total small { color: var(--text-mute); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; }
.q-total b { font-size: clamp(1.6rem, 2.4vw, 2rem); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.q-total__ex { text-align: right; color: var(--text-mute); font-size: 0.8rem; }
.q-monthly { margin-top: 10px; font-size: 0.86rem; color: var(--text-soft); background: var(--surface-2); border-radius: 10px; padding: 8px 12px; }
.q-ask { margin-top: 10px; font-size: 0.8rem; color: #7d6320; background: rgba(201,165,74,0.12); border: 1px solid rgba(201,165,74,0.4); border-radius: 10px; padding: 8px 12px; }
.q-ticket__foot { padding: 0 22px 20px; }
.q-ticket__foot .btn { width: 100%; justify-content: center; }
.btn--gold { background: var(--q-grad-gold); color: var(--q-ink); border-color: transparent; box-shadow: 0 10px 28px rgba(201,165,74,0.35); }
.btn--gold:hover { box-shadow: 0 16px 36px rgba(201,165,74,0.45); color: var(--q-ink); }
.btn--gold:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.q-ticket__note { font-size: 0.74rem; color: var(--text-mute); margin: 10px 0 0; line-height: 1.6; }
.q-ticket::before, .q-ticket::after { content: ""; position: absolute; left: -10px; width: 20px; height: 20px; border-radius: 50%; background: var(--bg); box-shadow: inset -1px 0 0 rgba(15,27,45,0.06); }
.q-ticket::before { top: 96px; }
.q-ticket::after { top: 96px; left: auto; right: -10px; box-shadow: inset 1px 0 0 rgba(15,27,45,0.06); }
.q-empty-state { text-align: center; padding: 26px 8px; color: var(--text-mute); font-size: 0.9rem; }
.q-empty-state svg { width: 44px; height: 44px; color: var(--q-gold); margin-bottom: 8px; }

/* 発行中のオーバーレイ */
.q-busy { position: fixed; inset: 0; z-index: 200; background: rgba(15,27,45,0.72); backdrop-filter: blur(6px); display: grid; place-items: center; color: #fff; text-align: center; }
.q-busy[hidden] { display: none; }
.q-busy i { display: block; width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.25); border-top-color: var(--q-gold-2); animation: qSpin 0.9s linear infinite; }
@keyframes qSpin { to { transform: rotate(360deg); } }

/* ---------- スマホ ---------- */
@media (max-width: 960px) {
  .q-layout { grid-template-columns: 1fr; }
  .q-side { position: static; }
  .q-rail__inner { grid-template-columns: repeat(4, 1fr); border-radius: 22px; }
  .q-rail__step { flex-direction: column; gap: 6px; font-size: 0.72rem; padding: 10px 4px; text-align: center; }
}
@media (max-width: 720px) {
  .q-sys-grid { grid-template-columns: 1fr; }
  .q-opts { grid-template-columns: 1fr; }
  .q-units { grid-template-columns: 1fr; }
  .q-rail { margin-top: -50px; }
}
@media (prefers-reduced-motion: reduce) {
  .q-lines li { animation: none; }
  .q-sys:hover, .q-opt:hover { transform: none; }
}

/* ---------- スマホ: 見出しは左揃え・文節の途中で折らない ---------- */
@media (max-width: 720px) {
  .q-hero .container { text-align: left; }
  .q-hero h1 { font-size: clamp(1.5rem, 6.4vw, 1.9rem); }
  .q-hero p { margin-left: 0; }
  .q-hero__badges { justify-content: flex-start; }
  h1, h2, h3 { word-break: auto-phrase; overflow-wrap: anywhere; }
  .q-panel__head h2 { font-size: 1.1rem; }
}
