/* 앱 화면. Figma IDly_Product 모바일(390) 기준. 데스크톱에서는 가운데 컬럼만 두고 양옆은 흰 여백 */
:root {
  --main: #08257e; --ink: #212125; --sub: #70737a; --mute: #72757c; --hint: #b7b9bf;
  --line: #e5e7eb; --border: #caccd3; --info-bg: #f0f6ff; --danger: #ee4e4e;
  --bg-end: #d5deed;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--ink);
  font: 15px/1.5 "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  letter-spacing: -0.01em; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, p { margin: 0; }

.app { max-width: 430px; margin: 0 auto; min-height: 100dvh; }

/* 화면 뼈대: 내용 + 아래 고정 버튼 */
.screen { display: flex; flex-direction: column; min-height: 100dvh; background: #fff; }
.bg-gradient { background: var(--bg-end) url(/static/assets/bg-report.png) center top / 100% 100% no-repeat; }
.content { flex: 1; padding: 0 16px 24px; }
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 40px 20px; }
.center-text { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; text-align: center; }
.center-text h1 { font-size: 24px; font-weight: 700; line-height: 1.36; letter-spacing: -0.01em; }
.center-text > p { font-size: 15px; line-height: 1.5; color: var(--sub); }
.center-text b { color: var(--ink); font-weight: 600; }

.cta { position: sticky; bottom: 0; display: grid; gap: 12px; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); background: #fff; }
.bg-gradient .cta { background: linear-gradient(rgba(213, 222, 237, 0), var(--bg-end) 24px); }
.cta-link { font-size: 14px; font-weight: 600; color: var(--main); text-align: center; text-decoration: none; padding: 4px; }
.cta-note { font-size: 12px; color: var(--mute); text-align: center; }

/* 버튼 (Figma 디자인시스템 Button) */
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 54px;
  border-radius: 16px; border: 0; font: inherit; font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
  text-decoration: none; cursor: pointer; }
.btn-main { background: var(--main); color: #fff; }
.btn-outline { background: #fff; color: var(--ink); border: 0.762px solid var(--border);
  box-shadow: 0 4px 7px rgba(16, 24, 46, 0.06); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn:focus-visible, .back:focus-visible { outline: 2px solid #3766f4; outline-offset: 2px; }

/* 상단: 로고 (Figma 홈 헤더) / 뒤로 + 제목 / 단계 점 */
.logo-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 20px 8px; }
.head-link { display: flex; align-items: center; height: 44px; margin-right: -8px; padding: 0 8px;
  font-size: 14px; font-weight: 600; color: var(--sub); text-decoration: none; }
.head-link:focus-visible, .menu-row:focus-visible, .contact:focus-visible, .faq summary:focus-visible { outline: 2px solid #3766f4; outline-offset: 2px; border-radius: 8px; }
.bar-head { display: flex; align-items: center; gap: 16px; height: 48px; padding: 0 20px; margin-top: 8px; }
.back { display: flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: 22px; background: #fff; }
.bar-head .back { margin-left: -10px; }
.head-title { font-size: 18px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.steps { display: flex; gap: 6px; }
.steps i { width: 8px; height: 8px; border-radius: 4px; background: var(--border); }
.steps i.on { background: var(--main); }
.steps i.wide { width: 24px; }

/* 메일 연결 폼 (Figma: 대표 계정 설정) */
.form-col { display: flex; flex-direction: column; gap: 16px; padding: 0 20px 24px; }
.title { padding: 20px 0 8px; }
.title h1 { font-size: 22px; font-weight: 700; line-height: 30px; }
.title p { margin-top: 6px; font-size: 14px; line-height: 19px; color: var(--sub); }
.field { display: grid; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; line-height: 18px; color: var(--sub); }
.field-hint { font-size: 12px; line-height: 1.5; color: var(--sub); }
.input { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: 12px;
  background: #fff; border: 0.762px solid var(--line); }
.input:focus-within { border-color: var(--main); }
.input img { flex: none; }
.input img.dim { opacity: 0.55; }
.input input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 16px; color: var(--ink); }
.input input::placeholder { color: var(--mute); }
.reveal { flex: none; height: 44px; margin-right: -8px; padding: 0 8px; border: 0; border-radius: 8px; background: none;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--sub); cursor: pointer; }
.reveal:focus-visible { outline: 2px solid #3766f4; }
.row { display: flex; gap: 8px; }
.row .input:first-child { flex: 1; }
.port { width: 88px; }

.kind { display: grid; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 36px; padding: 0 14px; border-radius: 18px; border: 0.762px solid var(--line); background: #fff;
  font: inherit; font-size: 14px; color: var(--sub); cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--main); background: var(--info-bg); color: var(--main); font-weight: 600; }
.chip:focus-visible { outline: 2px solid #3766f4; outline-offset: 2px; }
.kind-note { font-size: 12px; color: var(--mute); }
.guide { padding: 16px; border-radius: 14px; background: var(--info-bg); font-size: 13px; line-height: 1.5; }
.guide p { font-weight: 600; margin-bottom: 6px; }
.guide ol { margin: 0; padding-left: 18px; color: var(--sub); }
.guide a { color: var(--main); }
.guide.blocked { color: var(--danger); }

.agree { display: flex; gap: 12px; align-items: flex-start; padding: 16px; margin-top: 8px; border-radius: 16px; background: var(--info-bg); cursor: pointer; }
.agree input { position: absolute; opacity: 0; pointer-events: none; }
.check { flex: none; width: 22px; height: 22px; border-radius: 11px; border: 0.762px solid var(--border); background: #fff; }
.check img { display: none; }
.agree input:checked + .check { border: 0; background: none; }
.agree input:checked + .check img { display: block; }
.agree input:focus-visible + .check { outline: 2px solid #3766f4; outline-offset: 2px; }
.agree-text { font-size: 12px; line-height: 1.5; color: var(--sub); }
.agree-text b { display: block; margin-bottom: 2px; font-size: 14px; font-weight: 600; color: var(--ink); }

.error, .center-text > .error { font-size: 13px; line-height: 1.5; color: var(--danger); }
.content > .error { margin-top: 16px; }

/* 분석 중 (Figma: 보안 상태를 분석하고 있어요) */
.scan-ring { position: relative; width: 140px; height: 140px; border-radius: 70px;
  background: url(/static/assets/scan-ring.png) center / cover; box-shadow: 0 12px 16px rgba(8, 37, 126, 0.1); }
.scan-core { position: absolute; inset: 20px; display: flex; align-items: center; justify-content: center;
  border-radius: 50px; background: #fff; box-shadow: 0 4px 6px rgba(8, 37, 126, 0.06); }
.orb { position: absolute; border-radius: 50%; }
.orb-1 { left: 60px; top: -6px; width: 14px; height: 14px; background: #5d7eeb; box-shadow: 0 2px 6px rgba(93, 126, 235, 0.4); }
.orb-2 { left: 126px; top: 90px; width: 10px; height: 10px; background: #5d7eeb; opacity: 0.6; }
.orb-3 { left: 2px; top: 108px; width: 8px; height: 8px; background: #7d98ee; opacity: 0.5; }
#scanning .center { gap: 32px; }
#scanning .center-text { gap: 0; }
.h-scan { font-size: 22px !important; line-height: 1.2 !important; }
.track { width: 100%; max-width: 310px; height: 6px; margin: 24px 0 12px; border-radius: 3px; background: #e8eeff; overflow: hidden; }
#scan-bar { height: 100%; border-radius: 3px; background: url(/static/assets/scan-bar.png) center / 100% 100%;
  transform: scaleX(0); transform-origin: left; transition: transform .4s; }
.caption { font-size: 11px; line-height: 1.6; color: var(--mute); }
#scan-detail { font-size: 13px; color: var(--sub); margin-bottom: 2px; }
#scan-error { margin-top: 12px; }

/* 리포트 화면 */
#preview .content, #report .content { padding-top: 0; }
.foot-note { margin-top: 24px; font-size: 12px; line-height: 1.7; color: var(--mute); text-align: center; }
.foot-note a { color: var(--main); font-weight: 600; }

/* 소셜 로그인 버튼 (카카오·Apple 브랜드 가이드 색) */
/* 소셜 로그인 — 카카오 공식 가이드, Apple 버튼 가이드(Figma 커뮤니티) 기준. 로고 크기·색은 각 가이드 그대로 */
.btn-social { border-radius: 10px; font-weight: 500; }
.btn-social img { flex: none; }
.btn-kakao { gap: 8px; background: #fee500; color: rgba(0, 0, 0, 0.85); font-weight: 600; }
.btn-apple { gap: 12px; background: #000; color: #fff; }
.cta-link { border: 0; background: none; font: inherit; cursor: pointer; }
.cta-link.dev { font-size: 12px; font-weight: 500; color: var(--mute); }

/* 약관 동의 (Figma: 4 Consent) */
.agree-all { margin-top: 8px; align-items: center; }
.agree-all .check { width: 26px; height: 26px; border-radius: 13px; }
.agree-all .agree-text b { margin: 0; font-size: 16px; }
.agree-list { display: grid; padding-top: 4px; border-top: 1px solid var(--line); }
.agree-row { display: flex; align-items: center; gap: 12px; padding: 12px 8px; font-size: 14px; cursor: pointer; }
.agree-row input { position: absolute; opacity: 0; pointer-events: none; }
.agree-row > span:not(.check) { flex: 1; }
.agree-row a { margin: -12px -8px; padding: 12px 8px; font-size: 13px; color: var(--mute); }
.agree-row input:checked + .check, .agree-all input:checked + .check { border: 0; background: none; }
.agree-row input:checked + .check img, .agree-all input:checked + .check img { display: block; }
.agree-row input:focus-visible + .check { outline: 2px solid #3766f4; outline-offset: 2px; }

/* 메일 분석 동의: 한 줄 + 자세히 */
.agree-fold { position: relative; margin-top: 4px; border-radius: 14px; background: var(--info-bg); }
.agree-fold .agree-row { padding: 14px 72px 14px 16px; }
.fold-toggle { position: absolute; top: 4px; right: 8px; height: 44px; padding: 0 8px; border: 0; background: none;
  font: inherit; font-size: 13px; font-weight: 600; color: var(--sub); cursor: pointer; }
.fold-body { padding: 0 16px 16px 50px; font-size: 12px; line-height: 1.6; color: var(--sub); }
.fold-body p + p { margin-top: 6px; }
.fold-body b { color: var(--ink); font-weight: 600; }
.fold-body a { color: var(--main); }

/* 홈 */
.home-hero { text-align: left; padding: 24px; }
.home-hero .rp-date { font-size: 12px; }
.home-hello { font-size: 15px; font-weight: 600; color: rgba(255, 255, 255, 0.9); }
.home-hero .rp-label { margin-top: 6px !important; font-size: 24px; line-height: 1.3; }
.home-hero .rp-desc { margin-top: 6px !important; font-weight: 400; color: rgba(255, 255, 255, 0.85); }
.home-row { text-decoration: none; color: inherit; }
.state { flex: none; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.state-paid { background: #e8f5e9; color: #2e7d32; }
.state-unpaid { background: var(--info-bg); color: var(--main); }
.state-busy { background: #fff8e1; color: #9a6b00; }
.menu { display: grid; }
.help .menu-row { padding: 12px 0; }
.help .menu-row + .menu-row { border-top-width: 1px; }
.menu-row { display: flex; justify-content: space-between; align-items: center; min-height: 48px; padding: 12px 4px; border: 0; background: none;
  font: inherit; font-size: 14px; color: var(--ink); text-align: left; text-decoration: none; cursor: pointer; }
.menu-row + .menu-row { border-top: 1.33px solid var(--line); }
.menu-row span { color: #b0b1b4; }
.menu-row.danger { color: var(--danger); }
.business { margin-top: 20px; font-size: 11px; line-height: 1.7; color: var(--mute); }

/* 약관·정책 페이지 */
.legal-body { padding: 8px 20px 48px; font-size: 14px; line-height: 1.75; color: var(--ink); }
.legal-body h3 { margin: 28px 0 8px; font-size: 16px; font-weight: 700; }
.legal-body p, .legal-body li { color: #3a3b40; }
.legal-body ol, .legal-body ul { padding-left: 20px; margin: 0; }
.legal-body a { color: var(--main); }
.legal-meta { color: var(--mute) !important; font-size: 13px; }
.legal-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 12px; line-height: 1.5; }
.legal-table th, .legal-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.legal-table th { color: var(--sub); font-weight: 600; }

.pay-empty { font-size: 14px; line-height: 1.6; color: var(--sub); text-align: center; }


/* 로그인 팝업 (바텀 시트) */
.sheet-backdrop { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(16, 24, 46, 0.45); }
.sheet { width: 100%; max-width: 430px; padding: 12px 20px calc(28px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0; background: #fff; box-shadow: 0 -8px 24px rgba(16, 24, 46, 0.12);
  animation: sheet-up .22s ease-out; }
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.sheet-handle { display: block; width: 40px; height: 4px; margin: 0 auto 20px; border-radius: 2px; background: var(--line); }
.sheet-title { font-size: 20px; font-weight: 700; line-height: 1.3; }
.sheet-desc { margin-top: 6px !important; font-size: 14px; color: var(--sub); }
.sheet-actions { display: grid; gap: 10px; margin-top: 24px; }
.sheet .error { margin-top: 12px; text-align: center; }
.sheet .cta-link { display: block; margin: 14px auto 0; }
.sheet-note { margin-top: 16px !important; font-size: 12px; color: var(--mute); text-align: center; }

.sheet-mock { margin-top: 14px !important; font-size: 12px; color: var(--mute); text-align: center; }

/* 홈 ??? 티저 */
.home-teaser { margin-top: 8px; }
.home-teaser div { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15); }
.home-teaser span { font-size: 14px; color: rgba(255, 255, 255, 0.85); }
.home-teaser b { font-size: 22px; font-weight: 700; color: var(--gold, #ffd200); letter-spacing: 0.04em; }
.home-teaser p { margin-top: 12px !important; font-size: 13px; color: rgba(255, 255, 255, 0.85); }

/* 홈 한 줄 요약 */
.home-headline { margin-top: 10px; }
.home-headline .rp-label { margin-top: 0 !important; font-size: 26px; line-height: 1.3; }
.home-headline .rp-desc { margin-top: 8px !important; font-weight: 400; color: rgba(255, 255, 255, 0.85); }

/* 알림 모달 (Figma: Dialog) */
.modal-backdrop { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(16, 24, 46, 0.45); }
.dialog { width: 100%; max-width: 320px; outline: 0; word-break: keep-all; padding: 28px 24px 16px; border-radius: 20px; background: #fff; text-align: center;
  box-shadow: 0 12px 32px rgba(16, 24, 46, 0.18); animation: dialog-in .18s ease-out; }
@keyframes dialog-in { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dialog { animation: none; } }
.dialog-title { font-size: 19px; font-weight: 700; line-height: 1.35; color: var(--ink); }
.dialog-text { margin-top: 10px !important; font-size: 14px; line-height: 1.6; color: var(--sub); }
.dialog .btn { margin-top: 24px; }
.dialog-later { display: block; width: 100%; height: 44px; margin-top: 4px; font-size: 14px; color: var(--sub); }

/* 도움말 화면: 흰 바탕, 구역 제목과 줄만 (카드·테두리 없이 여백으로 나눈다) */
.help { padding: 8px 20px 48px; }
.help-h2 { margin: 32px 0 8px; font-size: 13px; font-weight: 600; color: var(--sub); }
.help-h2:first-child { margin-top: 12px; }
.faq details + details { border-top: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; padding: 12px 0;
  font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-right: 4px;
  border-right: 1.5px solid var(--mute); border-bottom: 1.5px solid var(--mute); transform: rotate(45deg) translateY(-2px); }
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.faq p { padding: 0 0 16px; font-size: 14px; line-height: 1.65; color: var(--sub); }
.faq a { color: var(--main); font-weight: 600; }
.menu-row .menu-sub { font-size: 13px; color: var(--sub); }
.help .business { margin-top: 40px; }

/* 확인 모달의 위험 버튼 (회원 탈퇴) */
.btn-danger { background: var(--danger); color: #fff; }

/* 로그인 없이 사용하기: 저장 안내 팝업과 홈 안내 카드 */
.guest-dialog { max-width: 340px; }
.dialog-list { margin: 14px 0 0; padding: 14px 16px 14px 32px; border-radius: 12px; background: var(--info-bg);
  font-size: 13px; line-height: 1.7; color: var(--ink); text-align: left; }
.dialog-warn { margin-top: 12px !important; font-size: 13px; line-height: 1.6; color: var(--danger); text-align: left; }
.dialog-sub { margin-top: 12px !important; font-size: 12px; line-height: 1.6; color: var(--mute); }
.guest-dialog .btn { margin-top: 20px; }
.guest-note { margin-top: 16px; }
.guest-login { display: block; padding: 0; border: 0; background: none; font-family: inherit; cursor: pointer; text-align: left; }
.guest-login:focus-visible { outline: 2px solid #3766f4; outline-offset: 2px; border-radius: 4px; }

/* 아주 좁은 화면 (320px): 칸 안 여백을 줄여 넘치지 않게 */
@media (max-width: 340px) {
  .form-col { padding: 0 16px 24px; }
  .input { padding: 0 10px; gap: 8px; }
}

/* 선택 정보 (내부 통계) */
.about-group { display: grid; gap: 10px; padding-top: 8px; }
.about-group .chip { min-height: 40px; }
.about-note { margin-top: 8px; font-size: 12px; line-height: 1.6; color: var(--sub); }

/* 결제 화면: 커피 한 잔 값 (알림과 같은 내용) */
.value-card { margin-top: 16px; padding: 20px; }
.value-title { font-size: 16px; font-weight: 700; line-height: 1.4; }
.value-text { margin-top: 6px !important; font-size: 14px; line-height: 1.6; color: var(--sub); word-break: keep-all; }

/* 스크립트가 넣는 여러 문장짜리 안내는 문장마다 줄을 바꾼다 (\n) */
.error, .cta-note, #guest-note-text { white-space: pre-line; }

/* 결제 화면: 결제가 고민될 때 샘플 리포트로 (밝은 버튼, 가끔 흔들어 눈에 띄게) */
.sample-cta { display: grid; gap: 6px; text-align: center; }
.sample-cta p { font-size: 14px; font-weight: 600; color: var(--sub); }
.sample-btn { height: 48px; background: #ffb300; color: var(--ink); font-weight: 700; box-shadow: 0 6px 16px rgba(255, 179, 0, 0.35);
  animation: sample-wiggle 3.2s ease-in-out 1s infinite; }
.sample-btn:hover { background: #ffc233; }
@keyframes sample-wiggle {
  0%, 84%, 100% { transform: rotate(0); }
  87% { transform: rotate(-2deg); }
  90% { transform: rotate(2deg); }
  93% { transform: rotate(-1.5deg); }
  96% { transform: rotate(1deg); }
}
@media (prefers-reduced-motion: reduce) { .sample-btn { animation: none; } }
