/* ====== Base (theme) ====== */
html, body { height: 100%; }
:root{
  --bg: #eef3ff;
  --card: #ffffff;
  --line: #e5eaf6;
  --text: #111111;
  --muted: #0d55fc;
  --accent: #1a5cff;

  /* 実在ファイルに合わせて相対パスを修正 */
  --hero-desktop: url("./bg-top-desktop-1920.jpg");
  --hero-mobile:  url("./bg-top-mobile-1080.jpg");
  --hero-dim: 0.42;
}

/* ====== Document ====== */
* { box-sizing: border-box; }
html{ background: transparent; }

body{
  background-color: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
               "Noto Sans JP", Arial, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  line-height: 1.7;
  letter-spacing: 0.02em;
  margin: 0;
}

/* ====== Layout & Card ====== */
.wrap{
  max-width: 840px;
  margin: 48px auto;
  padding: 0 16px;
  position: relative; z-index: 1;
}
.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
  position: relative; z-index: 1;
}

/* ====== Typography ====== */
h1{
  margin: 0 0 12px;
  font-weight: 800;
  font-size: clamp(22px, 2.1vw + 12px, 34px);
  line-height: 1.25;
}
.muted{
  color: var(--muted);
  margin: 8px 0 0;
  min-height: 1.25em;
  font-size: clamp(14px, .9vw + 10px, 16px);
}

/* ====== Radios ====== */
.radio{
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; margin: 12px 0;
  border: 1px solid var(--line); border-radius: 12px;
  background: #ffffff;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
  font-size: clamp(16px, 1vw + 12px, 18px);
  line-height: 1.7; cursor: pointer;
}
.radio:hover{
  background: #f9fbff; border-color: #d6def6;
  box-shadow: 0 2px 8px rgba(26, 92, 255, 0.08);
}
.radio:has(input[type="radio"]:checked){
  border-color: rgba(26,92,255,0.55);
  box-shadow: 0 0 0 3px rgba(26,92,255,0.15);
  background: #f5f8ff;
}
.radio input[type="radio"]{
  flex: 0 0 auto; transform: scale(1.2); margin-top: 4px;
  accent-color: var(--accent);
}
.radio:has(input[type="radio"]:focus-visible){
  outline: 3px solid rgba(26,92,255,0.35);
  outline-offset: 3px; border-color: rgba(26,92,255,0.7);
}

/* ====== Button ====== */
button#submitBtn{
  width: 100%;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-weight: 800;
  font-size: clamp(16px, 1vw + 12px, 20px);
  letter-spacing: .02em; cursor: pointer;
  transition: transform .05s ease, filter .15s ease, box-shadow .15s ease;
  box-shadow: 0 6px 16px rgba(26,92,255,0.22);
}
button#submitBtn:hover{ filter: brightness(1.06); }
button#submitBtn:active{ transform: translateY(1px); }
button#submitBtn:disabled{ opacity: .6; cursor: not-allowed; box-shadow: none; }

/* ====== Result Box ====== */
.result{
  margin-top: 16px; padding: 16px;
  border: 1px solid var(--line); border-radius: 12px;
  background: #ffffff; color: var(--text);
  line-height: 1.75; font-size: clamp(15px, .9vw + 11px, 18px);
  box-shadow: 0 2px 10px rgba(16, 24, 40, 0.06);
}
.result a{ color: var(--accent); text-decoration: underline; font-weight: 600; }

/* ====== Responsive ====== */
@media (max-width: 600px){
  .wrap{ margin: 28px auto; }
  .card{ padding: 20px; border-radius: 14px; }
  .radio{ padding: 14px; }
  button#submitBtn{ padding: 14px 16px; }
}

/* ====== Hero Background (.bg-top のときのみ) ====== */
:root {
  --hero-desktop: url("./images/bg-top-desktop-1920.jpeg");
  --hero-mobile:  url("./images/bg-top-mobile-1080.jpeg");
  --hero-dim: 0;
}

body.bg-top {
  background: transparent !important;
  position: relative;
  overflow-x: hidden;
}
.wrap, .card { position: relative; z-index: 1; }

body.bg-top::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(
      to bottom,
      rgba(10,15,30, calc(var(--hero-dim) + 0.10)) 0%,
      rgba(10,15,30, calc(var(--hero-dim) + 0.00)) 35%,
      rgba(10,15,30, calc(var(--hero-dim) + 0.12)) 100%
    ),
    var(--hero-desktop) center right / cover no-repeat;
  filter: saturate(1.05) contrast(1.05) blur(1.2px);
  pointer-events: none;
}

@media (max-width: 900px) {
  body.bg-top::before {
    background:
      linear-gradient(
        to bottom,
        rgba(10,15,30, calc(var(--hero-dim) + 0.10)) 0%,
        rgba(10,15,30, calc(var(--hero-dim) + 0.02)) 45%,
        rgba(10,15,30, calc(var(--hero-dim) + 0.14)) 100%
      ),
      var(--hero-mobile) center / cover no-repeat;
    filter: saturate(1.05) contrast(1.05) blur(1.4px);
  }
}
