/* AMTI Family Version — 밝고 알록달록한 어린이/가족 스타일 */
/* 절대 다크 파이낸스 아님. 게임처럼 신나는 분위기 */

:root {
  --sky: #4FC3F7;
  --sky-light: #E1F5FE;
  --sun: #FFD600;
  --sun-light: #FFF9C4;
  --green: #66BB6A;
  --green-light: #E8F5E9;
  --orange: #FFA726;
  --orange-light: #FFF3E0;
  --pink: #F48FB1;
  --pink-light: #FCE4EC;
  --purple: #CE93D8;
  --purple-light: #F3E5F5;
  --white: #FFFFFF;
  --bg: #F0F7FF;
  --text: #2C3E50;
  --text-light: #546E7A;
  --border: #E0E0E0;
  --radius: 24px;
  --radius-sm: 12px;
  --shadow: 0 4px 20px rgba(79,195,247,0.15);
  --shadow-hover: 0 8px 32px rgba(79,195,247,0.28);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Apple SD Gothic Neo', 'Noto Sans KR', '맑은 고딕', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 17px;
  line-height: 1.6;
}

/* ── 헤더 ─────────────────────────────────────────────── */
.fam-header {
  background: linear-gradient(135deg, var(--sky) 0%, #29B6F6 50%, var(--purple) 100%);
  color: white;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 3px 12px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.fam-header .brand {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fam-header .expert-link {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 20px;
  padding: 4px 12px;
  transition: background 0.2s;
}
.fam-header .expert-link:hover { background: rgba(255,255,255,0.2); }

/* ── 메인 컨테이너 ─────────────────────────────────────── */
.fam-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

/* ── 스테이지 (화면 전환) ───────────────────────────────── */
.fam-stage { display: none; }
.fam-stage[data-active] { display: block; animation: fadeIn 0.35s ease; }

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

/* ── 진행 바 ─────────────────────────────────────────── */
.progress-wrap {
  background: white;
  border-radius: 30px;
  padding: 6px;
  margin-bottom: 28px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex;
  gap: 4px;
}
.progress-step {
  flex: 1;
  height: 8px;
  border-radius: 10px;
  background: var(--border);
  transition: background 0.4s;
}
.progress-step.done { background: linear-gradient(90deg, var(--sky), var(--purple)); }
.progress-step.active { background: linear-gradient(90deg, var(--sun), var(--orange)); }

/* ── 카드 ────────────────────────────────────────────── */
.fam-card {
  background: white;
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.fam-card.sky   { background: linear-gradient(135deg, white 60%, var(--sky-light)); }
.fam-card.sun   { background: linear-gradient(135deg, white 60%, var(--sun-light)); }
.fam-card.green { background: linear-gradient(135deg, white 60%, var(--green-light)); }
.fam-card.pink  { background: linear-gradient(135deg, white 60%, var(--pink-light)); }

/* ── 환영 화면 ────────────────────────────────────────── */
.intro-hero {
  text-align: center;
  padding: 12px 0 24px;
}

.intro-hero .big-emoji {
  font-size: 5rem;
  display: block;
  margin-bottom: 12px;
  animation: bounce 1.5s infinite;
}

@keyframes bounce {
  0%,100% { transform: translateY(0); }
  50%  { transform: translateY(-10px); }
}

.intro-hero h1 {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 14px;
}

.intro-hero h1 strong {
  color: var(--sky);
  display: block;
}

.intro-hero .lede {
  font-size: 1.05rem;
  color: var(--text-light);
  margin-bottom: 24px;
  line-height: 1.65;
}

.feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 28px;
}

.chip {
  background: var(--sky-light);
  color: var(--sky);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.88rem;
  font-weight: 600;
}
.chip.sun   { background: var(--sun-light);    color: #E65100; }
.chip.green { background: var(--green-light);  color: #2E7D32; }
.chip.pink  { background: var(--pink-light);   color: #880E4F; }

/* ── 버튼 ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  transition: all 0.2s;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--sky), var(--purple));
  color: white;
  box-shadow: 0 4px 16px rgba(79,195,247,0.4);
  width: 100%;
  font-size: 1.2rem;
  padding: 18px 32px;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: white;
  color: var(--sky);
  border: 2px solid var(--sky);
  padding: 12px 24px;
  font-size: 0.95rem;
}
.btn-secondary:hover { background: var(--sky-light); }

.btn-nav {
  background: var(--sky-light);
  color: var(--sky);
  border-radius: 14px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}
.btn-nav.next {
  background: linear-gradient(135deg, var(--sky), #29B6F6);
  color: white;
}
.btn-nav:hover { opacity: 0.85; }
.btn-nav:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* ── 용돈 선택 버튼 그룹 ─────────────────────────────────── */
.money-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.money-btn {
  flex: 1;
  min-width: 80px;
  padding: 14px 8px;
  border-radius: var(--radius-sm);
  border: 2.5px solid var(--border);
  background: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  color: var(--text);
}
.money-btn:hover { border-color: var(--sky); background: var(--sky-light); }
.money-btn.selected {
  border-color: var(--sky);
  background: var(--sky);
  color: white;
  box-shadow: 0 3px 12px rgba(79,195,247,0.35);
}

/* ── 라벨 + 인풋 ─────────────────────────────────────── */
.fam-label {
  display: block;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 10px;
}

.fam-label .emoji-icon {
  margin-right: 6px;
  font-size: 1.2rem;
}

.fam-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 0.2s;
  outline: none;
  color: var(--text);
}
.fam-input:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(79,195,247,0.15); }

.fam-hint {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-top: 6px;
}

/* ── 슬라이더 ──────────────────────────────────────────── */
.slider-wrap {
  margin: 8px 0;
}

.coin-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--green) var(--pct, 40%), var(--border) var(--pct, 40%));
  outline: none;
  cursor: pointer;
}
.coin-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--green);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  cursor: pointer;
  font-size: 1.1rem;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 6px;
}

.slider-val {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--green);
  margin: 8px 0;
}

/* ── 스텝 헤더 ────────────────────────────────────────── */
.step-header {
  margin-bottom: 22px;
}

.step-badge {
  display: inline-block;
  background: var(--sky);
  color: white;
  border-radius: 30px;
  padding: 3px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.step-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.3;
}

.step-sub {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-top: 6px;
}

/* ── 시나리오 카드 ─────────────────────────────────────── */
.scenario-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  border: 2.5px solid var(--border);
  box-shadow: var(--shadow);
  transition: border-color 0.2s;
}
.scenario-card.answered { border-color: var(--green); }

.scenario-q {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.45;
}

.scenario-q .q-emoji {
  font-size: 1.6rem;
  display: block;
  margin-bottom: 8px;
}

.scenario-opts {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.scenario-opt {
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: white;
  font-size: 0.97rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s;
  color: var(--text);
  line-height: 1.4;
}
.scenario-opt:hover { border-color: var(--sky); background: var(--sky-light); }
.scenario-opt.selected {
  border-color: var(--green);
  background: var(--green-light);
  color: #1B5E20;
  font-weight: 700;
}

.no-correct {
  font-size: 0.8rem;
  color: var(--text-light);
  text-align: right;
  margin-top: 8px;
}

/* ── 스피너 ────────────────────────────────────────────── */
.loading-stage {
  text-align: center;
  padding: 60px 20px;
}

.loading-emoji {
  font-size: 4rem;
  animation: spin 1.5s linear infinite;
  display: block;
  margin-bottom: 20px;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.loading-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-light);
}

/* ── 결과 화면 ────────────────────────────────────────── */
.result-hero {
  text-align: center;
  padding: 24px 0 16px;
}

.char-emoji {
  font-size: 5rem;
  display: block;
  margin-bottom: 8px;
  animation: bounceIn 0.6s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes bounceIn {
  from { transform: scale(0.3); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.char-name {
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 4px;
}

.char-sub {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 16px;
}

.char-desc {
  background: var(--sky-light);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.97rem;
  line-height: 1.55;
  color: var(--text);
  text-align: left;
}

/* ── 별점 FFS ─────────────────────────────────────────── */
.ffs-section {
  margin-top: 20px;
}

.ffs-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ffs-stars {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 10px;
}

.ffs-star {
  font-size: 2.2rem;
  transition: transform 0.3s;
}
.ffs-star.lit { animation: starPop 0.4s ease forwards; }
.ffs-star.dim { opacity: 0.25; }

@keyframes starPop {
  from { transform: scale(0.5); }
  60%  { transform: scale(1.3); }
  to   { transform: scale(1); }
}

.ffs-gauge-wrap {
  background: var(--border);
  border-radius: 30px;
  height: 18px;
  overflow: hidden;
  margin: 10px 0 8px;
}

.ffs-gauge-fill {
  height: 100%;
  border-radius: 30px;
  background: linear-gradient(90deg, var(--orange), var(--sun), var(--green));
  transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ffs-score-label {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
}

.ffs-band-chip {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 700;
  margin-top: 4px;
}
.ffs-band-chip.fit      { background: var(--green-light);  color: #2E7D32; }
.ffs-band-chip.caution  { background: var(--sun-light);    color: #E65100; }
.ffs-band-chip.risk     { background: var(--orange-light); color: #BF360C; }
.ffs-band-chip.critical { background: var(--pink-light);   color: #880E4F; }

/* ── 돈 분배 그림 ──────────────────────────────────────── */
.money-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

.money-box {
  background: white;
  border-radius: var(--radius-sm);
  padding: 18px 14px;
  text-align: center;
  border: 2.5px solid var(--border);
  transition: border-color 0.3s;
}
.money-box.adventure { border-color: var(--orange); }
.money-box.piggy     { border-color: var(--sky); }

.money-box .box-emoji { font-size: 2.4rem; display: block; margin-bottom: 6px; }
.money-box .box-label { font-size: 0.85rem; color: var(--text-light); margin-bottom: 4px; }
.money-box .box-amount {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  word-break: keep-all;
}

/* ── 깜빡 버릇 ────────────────────────────────────────── */
.bias-card {
  background: var(--sun-light);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.bias-card .bias-emoji { font-size: 2rem; flex-shrink: 0; margin-top: 2px; }
.bias-card .bias-content .bias-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
}
.bias-card .bias-content .bias-tip {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* ── 칭찬 메시지 ───────────────────────────────────────── */
.praise-card {
  background: linear-gradient(135deg, var(--sky), var(--purple));
  border-radius: var(--radius);
  padding: 24px;
  color: white;
  text-align: center;
}

.praise-card .praise-emoji { font-size: 2.5rem; display: block; margin-bottom: 12px; }
.praise-card .praise-text {
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.6;
}

/* ── 부모님 코너 ───────────────────────────────────────── */
.parent-corner {
  background: #F5F5F5;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.9rem;
  color: var(--text-light);
  border-left: 4px solid var(--purple);
}

.parent-corner .parent-title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.parent-corner a {
  color: var(--sky);
  font-weight: 600;
  text-decoration: none;
}
.parent-corner a:hover { text-decoration: underline; }

/* ── 섹션 제목 ────────────────────────────────────────── */
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── 다시하기 버튼 ─────────────────────────────────────── */
.btn-retry {
  display: block;
  width: 100%;
  padding: 16px;
  margin-top: 16px;
  border-radius: 50px;
  border: 2.5px solid var(--sky);
  background: white;
  color: var(--sky);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.btn-retry:hover { background: var(--sky-light); }

/* ── 푸터 ─────────────────────────────────────────────── */
.fam-footer {
  background: white;
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-light);
}

/* ── 반응형 ───────────────────────────────────────────── */
@media (max-width: 400px) {
  .fam-main { padding: 16px 12px 60px; }
  .money-split { grid-template-columns: 1fr; }
  .intro-hero h1 { font-size: 1.4rem; }
  .btn-primary { font-size: 1.05rem; }
}

/* ── 입력 필드 섹션 간격 ─────────────────────────────── */
.input-section { margin-bottom: 24px; }

/* ── 오류 메시지 ──────────────────────────────────────── */
.err-msg {
  color: #C62828;
  background: #FFEBEE;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  margin-bottom: 12px;
  display: none;
}
.err-msg.show { display: block; }
