/* ════════════════════════════════════════════════════════════════
   Today Fortune — 라이트 핑크/로즈 디자인
   다크 토글 시 전환
   ════════════════════════════════════════════════════════════════ */

.tf-page {
  position: relative;
  min-height: calc(100vh - 56px);
  padding: 80px 24px 100px;
  background: linear-gradient(180deg, #fdf2f8 0%, #fce7f3 30%, #fff1f2 100%);
  overflow: hidden;
}
.tf-bg {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(2px 2px at 10% 15%, rgba(244, 114, 182, 0.4), transparent),
    radial-gradient(1px 1px at 25% 30%, rgba(236, 72, 153, 0.3), transparent),
    radial-gradient(2px 2px at 70% 20%, rgba(244, 114, 182, 0.4), transparent),
    radial-gradient(1px 1px at 85% 50%, rgba(236, 72, 153, 0.4), transparent),
    radial-gradient(1px 1px at 40% 75%, rgba(244, 114, 182, 0.3), transparent),
    radial-gradient(2px 2px at 90% 85%, rgba(236, 72, 153, 0.3), transparent),
    radial-gradient(1px 1px at 15% 65%, rgba(244, 114, 182, 0.4), transparent);
  background-size: 100% 100%;
  opacity: 0.7;
  pointer-events: none;
  animation: tfStarTwinkle 6s ease-in-out infinite;
}
@keyframes tfStarTwinkle {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 0.4; }
}

.tf-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
}

.tf-head {
  text-align: center;
  margin-bottom: 32px;
}
.tf-pin {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(236, 72, 153, 0.12);
  border: 1px solid rgba(236, 72, 153, 0.25);
  color: #be185d;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  margin-bottom: 18px;
}
.tf-title {
  font-size: 36px;
  font-weight: 800;
  color: #1f1937;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
  line-height: 1.2;
}
.tf-sub {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.7;
}

/* ─── 입력 카드 ─── */
.tf-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(236, 72, 153, 0.15);
  border: 1px solid rgba(236, 72, 153, 0.1);
}

.tf-card-head {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: center;
  padding: 18px 22px;
  background: linear-gradient(135deg, #ec4899 0%, #be185d 60%, #a21caf 100%);
  color: white;
}
.tfh-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  font-size: 18px;
}
.tf-card-head h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}
.tf-card-head p {
  font-size: 12px;
  opacity: 0.85;
}

.tf-form {
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.tf-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tf-field label {
  font-size: 13px;
  font-weight: 700;
  color: #1f1937;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tf-field label em {
  font-style: normal;
  color: #ec4899;
}
.tf-hint {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 400;
  margin-left: 4px;
}

/* 입력 */
.tf-field input,
.tf-field select.tf-select {
  width: 100%;
  padding: 13px 16px;
  background: #fdf2f8;
  border: 1.5px solid #fce7f3;
  border-radius: 10px;
  font-size: 14px;
  color: #1f1937;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.tf-field input::placeholder { color: #d4a8c1; }
.tf-field input:focus,
.tf-field select.tf-select:focus {
  outline: none;
  border-color: #ec4899;
  background: white;
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.12);
}

/* 셀렉트 — 브라우저 기본 화살표 사용 (커스텀 배경 없음) */
.tf-field select.tf-select {
  cursor: pointer;
  background-image: none;
}
.tf-field select.tf-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background-color: #f9fafb;
}
.tf-field select.tf-select option {
  color: #1f1937;
  background: white;
}

/* 토글 (성별, 역법) */
.tf-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.tf-toggle-3 { grid-template-columns: 1fr 1fr 1fr; }
.tft {
  padding: 13px;
  background: white;
  border: 1.5px solid #fce7f3;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.tft:hover { border-color: rgba(236, 72, 153, 0.3); color: #1f1937; }
.tft.active {
  background: rgba(236, 72, 153, 0.1);
  border-color: #ec4899;
  color: #be185d;
}
.tft span { font-size: 14px; }

/* 생년월일 (3분할) */
.tf-row-3 {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto;
  gap: 4px;
  align-items: center;
}
.tf-row-3 input,
.tf-row-3 select.tf-select { text-align: center; padding: 13px 10px; }
.tf-suffix {
  font-size: 13px;
  color: #6b7280;
  padding: 0 4px;
}

/* 출생 시간 */
.tf-row-time {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 4px;
  align-items: center;
}
.tf-row-time input,
.tf-row-time select.tf-select { text-align: center; padding: 13px 10px; }

.tf-unknown-btn {
  margin-left: auto;
  padding: 4px 12px;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.25);
  color: #7c3aed;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: inherit;
}
.tf-unknown-btn:hover { background: rgba(168, 85, 247, 0.18); }
.tf-unknown-btn.active {
  background: rgba(168, 85, 247, 0.2);
  color: #6b21a8;
}

/* 도시 검색 */
.tf-search-input {
  position: relative;
}
.tfsi-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: #ec4899;
}
.tfsi-glass {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  color: #d4a8c1;
}
.tf-search-input input { padding-left: 40px; padding-right: 40px; }

/* 도시 커스텀 드롭다운 — JS가 body로 이동시키고 position:fixed 좌표를 직접 설정 */
.tf-city-dropdown {
  position: fixed;
  overflow-y: auto;
  background: white;
  border: 1px solid rgba(236, 72, 153, 0.2);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(236, 72, 153, 0.18);
  z-index: 9999;
  padding: 6px 0;
}
/* 위쪽으로 펼침 — 그림자 방향만 차별화 */
.tf-city-dropdown.up {
  box-shadow: 0 -12px 32px rgba(236, 72, 153, 0.18);
}
.tf-city-dropdown[hidden] { display: none; }
.tf-city-group-header {
  padding: 8px 14px 4px;
  font-size: 11px;
  font-weight: 800;
  color: #be185d;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: linear-gradient(90deg, rgba(236, 72, 153, 0.08), rgba(236, 72, 153, 0.02));
  border-top: 1px solid rgba(236, 72, 153, 0.12);
  margin-top: 4px;
  user-select: none;
  cursor: default;
}
.tf-city-group-header:first-child {
  margin-top: 0;
  border-top: none;
}
.tf-city-option {
  padding: 8px 18px;
  font-size: 13px;
  color: #1f1937;
  cursor: pointer;
  transition: background 0.1s, color 0.1s, padding-left 0.1s;
}
.tf-city-option:hover,
.tf-city-option.active {
  background: rgba(236, 72, 153, 0.1);
  color: #be185d;
  padding-left: 22px;
}
.tf-city-empty {
  padding: 14px;
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
}
/* 스크롤바 */
.tf-city-dropdown::-webkit-scrollbar { width: 6px; }
.tf-city-dropdown::-webkit-scrollbar-thumb {
  background: rgba(236, 72, 153, 0.3);
  border-radius: 3px;
}

body.dark .tf-city-dropdown {
  background: #1a0a1f;
  border-color: rgba(236, 72, 153, 0.3);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
}
body.dark .tf-city-group-header {
  color: #f9a8d4;
  background: linear-gradient(90deg, rgba(236, 72, 153, 0.18), rgba(236, 72, 153, 0.04));
  border-top-color: rgba(236, 72, 153, 0.25);
}
body.dark .tf-city-option { color: #e5e7eb; }
body.dark .tf-city-option:hover,
body.dark .tf-city-option.active {
  background: rgba(236, 72, 153, 0.18);
  color: #f9a8d4;
}
body.dark .tf-city-empty { color: #6b7280; }

/* 제출 버튼 */
.tf-submit {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #ec4899, #be185d);
  color: white;
  font-size: 15px;
  font-weight: 800;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  margin-top: 8px;
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 6px 18px rgba(236, 72, 153, 0.3);
}
.tf-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(236, 72, 153, 0.45);
}

/* ════════════════════════════════════════════════════════════════
   다크 모드 변환
   ════════════════════════════════════════════════════════════════ */
body.dark .tf-page {
  background: linear-gradient(180deg, #1a0a1f 0%, #15041a 50%, #07060f 100%);
}
body.dark .tf-bg {
  background-image:
    radial-gradient(2px 2px at 10% 15%, rgba(244, 114, 182, 0.6), transparent),
    radial-gradient(1px 1px at 25% 30%, rgba(236, 72, 153, 0.5), transparent),
    radial-gradient(2px 2px at 70% 20%, rgba(244, 114, 182, 0.6), transparent),
    radial-gradient(1px 1px at 85% 50%, rgba(236, 72, 153, 0.6), transparent),
    radial-gradient(1px 1px at 40% 75%, rgba(244, 114, 182, 0.5), transparent),
    radial-gradient(2px 2px at 90% 85%, rgba(236, 72, 153, 0.5), transparent),
    radial-gradient(1px 1px at 15% 65%, rgba(244, 114, 182, 0.6), transparent);
  opacity: 0.85;
}
body.dark .tf-pin {
  background: rgba(236, 72, 153, 0.18);
  border-color: rgba(236, 72, 153, 0.35);
  color: #f9a8d4;
}
body.dark .tf-title { color: white; }
body.dark .tf-sub { color: #c5c4d6; }

body.dark .tf-card {
  background: rgba(20, 14, 30, 0.85);
  border-color: rgba(236, 72, 153, 0.2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
body.dark .tf-field label { color: white; }
body.dark .tf-field input,
body.dark .tf-field select.tf-select {
  background-color: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
  color: white;
}
body.dark .tf-field input::placeholder { color: #6b7280; }
body.dark .tf-field input:focus,
body.dark .tf-field select.tf-select:focus {
  background-color: rgba(0, 0, 0, 0.4);
  border-color: #ec4899;
}
body.dark .tf-field select.tf-select {
  background-image: none;
}
body.dark .tf-field select.tf-select option {
  color: white;
  background: #1a0a1f;
}
body.dark .tf-field select.tf-select:disabled {
  opacity: 0.45;
  background-color: rgba(0, 0, 0, 0.45);
}
body.dark .tft {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.1);
  color: #c5c4d6;
}
body.dark .tft:hover { color: white; border-color: rgba(236, 72, 153, 0.3); }
body.dark .tft.active {
  background: rgba(236, 72, 153, 0.18);
  border-color: #ec4899;
  color: #f9a8d4;
}
body.dark .tf-suffix { color: #9ca3af; }
body.dark .tf-hint { color: #6b7280; }

@media (max-width: 540px) {
  .tf-title { font-size: 28px; }
  .tf-form { padding: 22px 18px; gap: 18px; }
  .tf-row-3 { grid-template-columns: 1fr 1fr 1fr; }
  .tf-row-3 .tf-suffix { display: none; }
}

/* ════════════════════════════════════════════════════════════════
   추가: 운세 분석 결과 카드 (Mock API 응답 표시 영역)
   - 입력 카드(.tf-card)와 동일한 폭/스타일 톤 유지
   - 초기 hidden, 분석 완료 시 fade-in
   - 추가/업데이트 시 이 블록 안에 주석으로 표기할 것
   ════════════════════════════════════════════════════════════════ */
.tf-result-card {
  margin-top: 24px;
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(236, 72, 153, 0.15);
  border: 1px solid rgba(236, 72, 153, 0.1);
  animation: tfResultIn 0.45s ease-out both;
}
@keyframes tfResultIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 결과 카드 헤드 (입력 카드 헤드와 동일 톤) */
.tf-result-head {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 18px 22px;
  background: linear-gradient(135deg, #ec4899 0%, #be185d 60%, #a21caf 100%);
  color: white;
}
.tf-result-head .tfh-icon {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  font-size: 18px;
}
.tf-result-head h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}
.tf-result-head p {
  font-size: 12px;
  opacity: 0.85;
}
.tf-result-head .tfr-date {
  font-size: 11px;
  font-weight: 700;
  background: rgba(255,255,255,0.18);
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.tf-result-body {
  padding: 24px 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* 종합 점수 영역 */
.tfr-score-wrap {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px;
  background: linear-gradient(135deg, #fdf2f8, #fce7f3);
  border: 1px solid rgba(236, 72, 153, 0.18);
  border-radius: 14px;
}
.tfr-score-circle {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: conic-gradient(#ec4899 var(--p, 0%), #f9d3e3 0);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.tfr-score-circle::before {
  content: "";
  position: absolute; inset: 8px;
  background: white;
  border-radius: 50%;
}
.tfr-score-num {
  position: relative;
  font-size: 26px;
  font-weight: 800;
  color: #be185d;
}
.tfr-score-meta h4 {
  font-size: 17px;
  font-weight: 800;
  color: #1f1937;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.tfr-score-meta p {
  font-size: 13px;
  line-height: 1.6;
  color: #6b7280;
}

/* 카테고리별 운세 grid */
.tfr-cats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tfr-cat {
  padding: 14px;
  background: #fdf2f8;
  border: 1px solid #fce7f3;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tfr-cat-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700;
  color: #6b7280;
}
.tfr-cat-head .tfr-stars {
  margin-left: auto;
  color: #ec4899;
  font-size: 12px;
  letter-spacing: 1px;
}
.tfr-cat-text {
  font-size: 13px;
  color: #1f1937;
  font-weight: 600;
  line-height: 1.5;
}

/* 행운 요소 */
.tfr-lucky {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.tfr-lucky-item {
  text-align: center;
  padding: 12px 8px;
  border: 1px dashed rgba(236, 72, 153, 0.35);
  border-radius: 12px;
  background: rgba(255, 241, 247, 0.7);
}
.tfr-lucky-item .lk-label {
  font-size: 11px;
  color: #9ca3af;
  font-weight: 600;
  margin-bottom: 4px;
}
.tfr-lucky-item .lk-val {
  font-size: 14px;
  font-weight: 800;
  color: #be185d;
}

/* 조언 / 주의 박스 */
.tfr-advice {
  padding: 14px 16px;
  border-radius: 12px;
  display: flex; gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.6;
}
.tfr-advice strong {
  display: block;
  font-weight: 800;
  margin-bottom: 4px;
  font-size: 12px;
  letter-spacing: 0.02em;
}
.tfr-advice.good {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #065f46;
}
.tfr-advice.warn {
  background: rgba(244, 114, 182, 0.08);
  border: 1px solid rgba(236, 72, 153, 0.25);
  color: #9d174d;
}
.tfr-advice .ad-ico {
  font-size: 18px; flex-shrink: 0;
}

/* 액션 버튼 */
.tfr-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tfr-btn {
  padding: 12px;
  font-size: 13px; font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.12s, box-shadow 0.2s;
}
.tfr-btn-primary {
  background: linear-gradient(135deg, #ec4899, #be185d);
  color: white; border: none;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}
.tfr-btn-primary:hover { transform: translateY(-1px); }
.tfr-btn-ghost {
  background: white;
  border: 1.5px solid #fce7f3;
  color: #be185d;
}
.tfr-btn-ghost:hover { border-color: #ec4899; }

/* 다크 모드 */
body.dark .tf-result-card {
  background: rgba(20, 14, 30, 0.85);
  border-color: rgba(236, 72, 153, 0.2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
body.dark .tfr-score-wrap {
  background: linear-gradient(135deg, rgba(236,72,153,0.08), rgba(168,85,247,0.08));
  border-color: rgba(236, 72, 153, 0.25);
}
body.dark .tfr-score-circle::before { background: #1a0f24; }
body.dark .tfr-score-meta h4 { color: white; }
body.dark .tfr-score-meta p { color: #c5c4d6; }
body.dark .tfr-cat {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.08);
}
body.dark .tfr-cat-head { color: #9ca3af; }
body.dark .tfr-cat-text { color: white; }
body.dark .tfr-lucky-item {
  background: rgba(0,0,0,0.25);
  border-color: rgba(236, 72, 153, 0.4);
}
body.dark .tfr-lucky-item .lk-val { color: #f9a8d4; }
body.dark .tfr-advice.good {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
}
body.dark .tfr-advice.warn {
  background: rgba(236, 72, 153, 0.12);
  color: #f9a8d4;
}
body.dark .tfr-btn-ghost {
  background: rgba(0,0,0,0.3);
  border-color: rgba(255,255,255,0.12);
  color: #f9a8d4;
}

/* 로딩 스피너 (분석 중 표시) */
.tfr-loading {
  padding: 36px 22px;
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
}
.tfr-spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(236, 72, 153, 0.2);
  border-top-color: #ec4899;
  border-radius: 50%;
  animation: tfSpin 0.8s linear infinite;
}
@keyframes tfSpin { to { transform: rotate(360deg); } }
.tfr-loading-text {
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
}
body.dark .tfr-loading-text { color: #c5c4d6; }

@media (max-width: 540px) {
  .tfr-cats { grid-template-columns: 1fr; }
  .tfr-score-wrap { grid-template-columns: 80px 1fr; gap: 14px; padding: 14px; }
  .tfr-score-circle { width: 80px; height: 80px; }
  .tfr-score-num { font-size: 22px; }
  .tfr-actions { grid-template-columns: 1fr; }
}
