/* 앱 화면. Figma IDly_Product 모바일(390) 기준. 데스크톱에서는 가운데 컬럼만 두고 양옆은 흰 여백 */
:root {
  --main: #08257e; --ink: #212125; --sub: #70737a; --mute: #8c8f96; --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; padding: 8px 20px 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: 36px; height: 36px; border-radius: 18px; background: #fff; }
#connect .back { margin-left: -8px; }
.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); }
.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: 32px; margin-right: -6px; 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 { font-size: 13px; 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 브랜드 가이드 색) */
.btn-kakao { background: #fee500; color: rgba(0, 0, 0, 0.85); }
.btn-apple { background: #000; color: #fff; }
.btn-naver { background: #03c75a; color: #fff; }
.btn-google { background: #fff; color: #1f1f1f; border: 0.762px solid var(--border); }
.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 { 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: 10px; right: 12px; height: 28px; 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 { margin-top: 20px !important; 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; }
.menu-row { display: flex; justify-content: space-between; align-items: center; padding: 15px 16px; 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-free-note { margin-top: 16px; font-size: 12px; line-height: 1.6; color: var(--sub); }

/* 커피 한 잔 비유 */
.coffee { margin-top: 24px; padding: 18px 20px; border-radius: 18px; background: #fffaf2;
  box-shadow: 0 1px 1.5px rgba(16, 24, 46, 0.03); }
.coffee-title { font-size: 16px; font-weight: 700; color: var(--ink); }
.coffee-text { margin-top: 6px !important; font-size: 13px; line-height: 1.6; color: var(--sub); }

/* 로그인 팝업 (바텀 시트) */
.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: 16px; }
.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); }
