/* ═══════════════════════════════════════════
   styles.css – BMI App Global Styles
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; padding: 0; font-family: 'Noto Sans KR', -apple-system, sans-serif; }

:root {
  --blue: #2196F3; --blue-dark: #1565C0; --blue-light: #E3F2FD;
  --green: #4CAF50; --orange: #FF9800; --red: #F44336;
  --txt: #1A1A2E; --txt2: #6B7280; --txt3: #9CA3AF;
  --card: #fff; --bg: #F4F6F9; --border: #E5E7EB;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --radius: 14px;
}

/* ── Framework7 overrides ── */
.page-content { background: var(--bg) !important; }

.navbar { background: linear-gradient(135deg, #1565C0, #2196F3) !important; }
.navbar .navbar-bg { background: linear-gradient(135deg, #1565C0, #2196F3) !important; }
.navbar .title { color: #fff !important; font-weight: 800; font-size: 17px; letter-spacing: -.3px; }
.navbar .link, .navbar .back-button, .navbar i.icon { color: #fff !important; }
.navbar .navbar-inner { padding: 0 8px; }

/* language toggle in navbar right */
.lang-toggle { display: flex; background: rgba(255,255,255,.18); border-radius: 20px; padding: 2px; gap: 2px; }
.lang-btn { padding: 3px 9px; border: none; border-radius: 18px; font-size: 11px; font-weight: 700; cursor: pointer; background: transparent; color: rgba(255,255,255,.75); transition: all .2s; font-family: inherit; }
.lang-btn.active { background: rgba(255,255,255,.9); color: var(--blue); }

/* tabbar */
.toolbar-bottom { background: #fff !important; border-top: 1px solid var(--border) !important; }
.toolbar-bottom .toolbar-inner { background: #fff !important; }
.tab-link { color: var(--txt3) !important; flex-direction: column !important; font-size: 11px !important; font-weight: 600 !important; gap: 3px !important; }
.tab-link.tab-link-active { color: var(--blue) !important; }
.tab-link i.f7-icons { font-size: 22px !important; }

/* ── Page padding ── */
.page-content-inner { padding: 12px 14px 80px; }

/* ── Cards ── */
.bmi-card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.card-title { font-size: 13px; font-weight: 700; color: var(--txt2); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
.card-title .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); flex-shrink: 0; }

/* ── Overview ── */
.overview-header {
  background: linear-gradient(135deg, #1565C0, #2196F3);
  border-radius: 18px; padding: 18px 16px 14px; margin-bottom: 12px;
  box-shadow: 0 6px 20px rgba(33,150,243,.3);
}
.oh-row { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 14px; }
.oh-col { text-align: center; }
.oh-label { font-size: 12px; color: rgba(255,255,255,.72); font-weight: 600; margin-bottom: 4px; }
.oh-val { font-size: 20px; font-weight: 900; color: #fff; }
.oh-val.accent { color: #64B5F6; }
.chart-legend { display: flex; gap: 14px; justify-content: center; margin-bottom: 10px; }
.legend-item { display: flex; align-items: center; gap: 4px; font-size: 11px; color: rgba(255,255,255,.8); font-weight: 600; }
.legend-dot { width: 10px; height: 3px; border-radius: 2px; }
.chart-wrap { position: relative; height: 220px; }

.os-row { display: flex; align-items: center; }
.os-col { flex: 1; text-align: center; padding: 12px 0; }
.os-label { font-size: 12px; color: var(--txt2); font-weight: 600; margin-bottom: 4px; }
.os-val { font-size: 22px; font-weight: 900; color: var(--txt); }
.os-val.down { color: var(--green); }
.os-val.remain { color: var(--blue); }
.os-center { width: 60px; height: 60px; border-radius: 50%; background: linear-gradient(135deg, #2196F3, #1565C0); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 16px rgba(33,150,243,.4); cursor: pointer; transition: transform .15s; flex-shrink: 0; }
.os-center:active { transform: scale(.93); }
.os-center svg { width: 28px; height: 28px; }
.progress-bar-bg { height: 8px; border-radius: 6px; background: #E0E0E0; overflow: hidden; margin-top: 10px; }
.progress-bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #4CAF50, #81C784); transition: width .8s ease; }
.progress-label { display: flex; justify-content: space-between; font-size: 11px; color: var(--txt2); margin-top: 5px; }

/* ── BMR page ── */
.gender-row { display: flex; gap: 10px; margin-bottom: 12px; }
.gender-btn { flex: 1; padding: 14px 8px; border-radius: var(--radius); border: 2px solid var(--border); background: var(--card); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--txt2); transition: all .2s; font-family: inherit; }
.gender-btn.active { border-color: var(--blue); background: var(--blue-light); color: var(--blue); }
.gender-icon { font-size: 28px; }

.input-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 12px; }
.input-row-item { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid #F3F4F6; }
.input-row-item:last-child { border-bottom: none; }
.iri-label { font-size: 15px; font-weight: 700; color: var(--txt); }
.iri-right { display: flex; align-items: center; gap: 6px; }
.iri-input { width: 88px; text-align: center; border: none; border-bottom: 2px solid var(--blue); font-size: 20px; font-weight: 800; color: var(--blue); background: transparent; outline: none; font-family: inherit; padding: 2px 4px; }
.iri-unit { font-size: 13px; color: var(--blue); font-weight: 700; }
.iri-select { border: 1.5px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 14px; color: var(--blue); font-weight: 700; background: #FAFAFA; outline: none; font-family: inherit; }

.bmi-bar-track { height: 10px; border-radius: 6px; background: linear-gradient(to right, #42A5F5 0%, #66BB6A 30%, #FFA726 60%, #EF5350 100%); position: relative; margin-bottom: 6px; }
.bmi-bar-thumb { position: absolute; top: -5px; width: 20px; height: 20px; background: #fff; border: 3px solid #333; border-radius: 50%; transform: translateX(-50%); transition: left .6s cubic-bezier(.34,1.56,.64,1); }
.bmi-legend-row { display: flex; justify-content: space-between; font-size: 10px; color: var(--txt2); font-weight: 600; }
.bmi-val { font-size: 52px; font-weight: 900; line-height: 1; margin-bottom: 6px; }
.bmi-badge { display: inline-block; padding: 4px 16px; border-radius: 20px; font-size: 13px; font-weight: 800; margin-bottom: 12px; }

.result-row { display: flex; gap: 10px; margin-bottom: 12px; }
.result-block { flex: 1; border-radius: var(--radius); padding: 16px 12px; text-align: center; }
.result-block.bmr-blk { background: linear-gradient(135deg, #E3F2FD, #BBDEFB); }
.result-block.tdee-blk { background: linear-gradient(135deg, #E8F5E9, #C8E6C9); }
.rb-label { font-size: 12px; font-weight: 700; color: var(--txt2); margin-bottom: 6px; }
.rb-val { font-size: 28px; font-weight: 900; }
.bmr-blk .rb-val { color: var(--blue); }
.tdee-blk .rb-val { color: var(--green); font-size: 22px; }
.rb-unit { font-size: 11px; color: var(--txt2); margin-top: 3px; }

/* ── Record page ── */
.date-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.date-nav-btn { background: var(--card); border: none; border-radius: 10px; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow); cursor: pointer; color: var(--blue); }
.date-nav-btn svg { width: 18px; height: 18px; }
.date-nav-center { text-align: center; }
.date-nav-day { font-size: 17px; font-weight: 800; color: var(--txt); }
.date-nav-sub { font-size: 12px; color: var(--txt2); margin-top: 1px; }
.rec-section-title { font-size: 11px; font-weight: 800; color: var(--txt2); text-transform: uppercase; letter-spacing: .6px; margin: 14px 0 7px; }
.rec-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 10px; }
.rec-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #F3F4F6; }
.rec-row:last-child { border-bottom: none; }
.rec-row-lbl { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--txt); }
.rec-row-lbl .emoji { font-size: 18px; width: 28px; text-align: center; }
.rec-row-right { display: flex; align-items: center; }
.rec-inp { width: 80px; text-align: right; border: none; border-bottom: 2px solid var(--blue); font-size: 16px; font-weight: 800; color: var(--blue); background: transparent; outline: none; font-family: inherit; padding: 2px 4px; }
.rec-unit { font-size: 11px; color: var(--txt2); margin-left: 4px; font-weight: 600; }
.rec-memo { width: 100%; border: none; resize: none; font-size: 14px; color: var(--txt); outline: none; min-height: 72px; font-family: inherit; line-height: 1.7; background: transparent; }
.save-fab { position: fixed; bottom: 72px; left: 14px; right: 14px; padding: 15px; background: linear-gradient(135deg, #2196F3, #1565C0); color: #fff; font-size: 15px; font-weight: 800; font-family: inherit; border: none; border-radius: var(--radius); cursor: pointer; box-shadow: 0 6px 24px rgba(33,150,243,.4); z-index: 500; }

/* ── Stats page ── */
.stat-chips { display: flex; gap: 8px; margin-bottom: 12px; }
.stat-chip { flex: 1; background: var(--card); border-radius: 13px; padding: 13px 10px; text-align: center; box-shadow: var(--shadow); }
.sc-val { font-size: 20px; font-weight: 900; color: var(--blue); }
.sc-val.g { color: var(--green); } .sc-val.o { color: var(--orange); } .sc-val.r { color: var(--red); }
.sc-lbl { font-size: 10px; color: var(--txt2); font-weight: 700; margin-top: 3px; white-space: nowrap; }
.exercise-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.ex-card { background: var(--card); border-radius: var(--radius); padding: 14px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); }
.ex-icon { width: 46px; height: 46px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.ex-info { flex: 1; }
.ex-name { font-size: 14px; font-weight: 700; color: var(--txt); }
.ex-desc { font-size: 11px; color: var(--txt2); margin-top: 2px; }
.ex-kcal { font-size: 15px; font-weight: 800; color: var(--green); }

/* ── Profile page ── */
.profile-hero { background: linear-gradient(135deg, #1565C0, #2196F3); border-radius: 18px; padding: 24px 20px; text-align: center; margin-bottom: 14px; box-shadow: 0 8px 28px rgba(33,150,243,.3); }
.avatar-ring { width: 70px; height: 70px; border-radius: 50%; background: rgba(255,255,255,.22); border: 3px solid rgba(255,255,255,.45); display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; font-size: 30px; }
.prof-name { color: #fff; font-size: 20px; font-weight: 800; margin-bottom: 3px; }
.prof-email { color: rgba(255,255,255,.7); font-size: 13px; margin-bottom: 16px; }
.prof-stats { display: flex; justify-content: space-around; }
.prof-stat .ps-val { color: #fff; font-size: 18px; font-weight: 900; }
.prof-stat .ps-lbl { color: rgba(255,255,255,.65); font-size: 11px; margin-top: 2px; font-weight: 600; }
.menu-card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 12px; }
.menu-item { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid #F3F4F6; cursor: pointer; transition: background .15s; }
.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: #F9F9F9; }
.mi-icon { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-right: 13px; flex-shrink: 0; }
.mi-text { flex: 1; }
.mi-title { font-size: 14px; font-weight: 700; color: var(--txt); }
.mi-desc { font-size: 11px; color: var(--txt2); margin-top: 2px; }
.mi-arrow { color: #C9CDD4; font-size: 18px; }
.menu-item.danger .mi-title { color: var(--red); }

/* ── Auth page ── */
.auth-page-wrap { min-height: 100vh; background: linear-gradient(160deg, #0D47A1 0%, #1565C0 40%, #2196F3 75%, #42A5F5 100%); display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 40px 20px 30px; overflow-y: auto; }
.auth-logo { width: 80px; height: 80px; border-radius: 24px; background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.35); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.auth-app-name { color: #fff; font-size: 26px; font-weight: 900; letter-spacing: -.5px; margin-bottom: 4px; }
.auth-app-sub { color: rgba(255,255,255,.72); font-size: 13px; margin-bottom: 28px; }
.auth-card { background: #fff; border-radius: 22px; padding: 26px 22px; width: 100%; max-width: 400px; box-shadow: 0 24px 60px rgba(0,0,0,.25); }
.auth-card h2 { font-size: 19px; font-weight: 800; color: var(--txt); margin: 0 0 20px; text-align: center; }
.field-lbl { font-size: 11px; font-weight: 700; color: var(--txt2); margin-bottom: 5px; display: block; text-transform: uppercase; letter-spacing: .4px; }
.field-inp { width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 15px; font-family: inherit; outline: none; background: #FAFAFA; transition: border-color .2s; color: var(--txt); }
.field-inp:focus { border-color: var(--blue); background: #fff; }
.field-wrap { margin-bottom: 13px; }
.auth-btn { width: 100%; padding: 14px; margin-top: 4px; background: linear-gradient(135deg, #2196F3, #1565C0); color: #fff; font-size: 15px; font-weight: 800; font-family: inherit; border: none; border-radius: 12px; cursor: pointer; box-shadow: 0 4px 16px rgba(33,150,243,.35); transition: transform .15s; }
.auth-btn:active { transform: scale(.97); }
.auth-btn.gray { background: var(--border); color: var(--txt2); box-shadow: none; }
.auth-switch { text-align: center; margin-top: 14px; font-size: 13px; color: var(--txt2); }
.auth-switch a { color: var(--blue); font-weight: 700; cursor: pointer; }
.flex2 { display: flex; gap: 10px; }
.flex2 > * { flex: 1; }
input[type="number"].field-inp,
input[type="email"].field-inp {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 15px; font-family: inherit; outline: none; background: #FAFAFA; transition: border-color .2s; color: var(--txt);
}
input[type="text"].field-inp {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 15px; font-family: inherit; outline: none; background: #FAFAFA; transition: border-color .2s; color: var(--txt);
}
input[type="password"].field-inp {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 15px; font-family: inherit; outline: none; background: #FAFAFA; transition: border-color .2s; color: var(--txt);
}

.rec-inp::placeholder {
  color: #f4f4f4;        /* 원하는 색상 */
  opacity: 1;         /* Firefox 기본값 0.54 보정 */
}

/* ── Popup (edit/goal sheets) ── */
.popup-inner { padding: 20px; }
.popup-title { font-size: 18px; font-weight: 800; color: var(--txt); margin-bottom: 18px; }
.popup-btn-row { display: flex; gap: 10px; margin-top: 8px; }
.popup-btn-row .auth-btn { flex: 1; margin-top: 0; }
