/* PrepFit — clean liquid-glass design system */
:root {
  --bg: #f5f5f8;
  --ink: #111118;
  --ink-2: #3c3c48;
  --muted: #7b7b8a;
  --faint: #a7a7b4;
  --line: rgba(17, 17, 24, 0.08);
  --line-2: rgba(17, 17, 24, 0.05);
  --accent: #ff5a1f;
  --accent-2: #ff9a3d;
  --accent-soft: rgba(255, 90, 31, 0.1);
  --pink: #ffb36b;
  --ok: #22a06b;
  --warn: #e5a50a;
  --danger: #e5484d;

  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-blur: blur(24px) saturate(170%);
  --glass-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 0 0 1px rgba(17, 17, 24, 0.04), 0 10px 30px -12px rgba(30, 30, 60, 0.12);

  --r-sm: 10px;
  --r: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  font-size: 15px;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, textarea, select { font: inherit; color: inherit; }
::selection { background: rgba(255, 90, 31, 0.18); }

/* ---------- glass ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* ---------- logo ---------- */
.logo { font-weight: 800; font-size: 21px; letter-spacing: -0.04em; display: inline-flex; align-items: center; gap: 8px; }
.logo-mark {
  width: 28px; height: 28px; flex: none;
  background: url("../img/logo.png") center / contain no-repeat;
}
.logo b { color: inherit; font-weight: 800; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px; font-weight: 600; font-size: 14px;
  transition: transform 0.2s var(--ease), background 0.2s, box-shadow 0.2s, opacity 0.2s;
  white-space: nowrap; user-select: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #24242e; }
.btn-accent { background: linear-gradient(135deg, var(--accent), #ff7a2f); color: #fff; }
.btn-outline { border: 1.5px solid var(--ink); background: rgba(255, 255, 255, 0.5); }
.btn-outline:hover { background: #fff; }
.btn-ghost { background: rgba(17, 17, 24, 0.04); }
.btn-ghost:hover { background: rgba(17, 17, 24, 0.08); }
.btn-danger { background: rgba(229, 72, 77, 0.1); color: var(--danger); }
.btn-danger:hover { background: rgba(229, 72, 77, 0.16); }
.btn-lg { height: 50px; padding: 0 26px; font-size: 15.5px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 9px; display: inline-grid; place-items: center; color: var(--ink-2);
  transition: background 0.15s;
}
.icon-btn:hover { background: rgba(17, 17, 24, 0.06); }
.icon-btn svg, .btn svg { width: 17px; height: 17px; flex: none; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input, .textarea, .select {
  width: 100%; height: 46px; padding: 0 15px; border-radius: 13px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, 0.72);
  outline: none; transition: border 0.15s, box-shadow 0.15s, background 0.15s; font-size: 15px;
}
.textarea { height: auto; min-height: 88px; padding: 12px 15px; resize: vertical; line-height: 1.6; }
.select { appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b7b8a' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.input:focus, .textarea:focus, .select:focus { border-color: rgba(255, 90, 31, 0.55); box-shadow: 0 0 0 4px rgba(255, 90, 31, 0.12); background: #fff; }
.input.sm, .select.sm { height: 38px; font-size: 14px; border-radius: 11px; }
.hint { font-size: 12.5px; color: var(--muted); }
.hint.err { color: var(--danger); }
.hint.ok { color: var(--ok); }

.check { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.check input { display: none; }
.check .box {
  width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid #c9c9d4; background: #fff;
  display: grid; place-items: center; transition: all 0.15s; flex: none;
}
.check input:checked + .box { background: var(--ink); border-color: var(--ink); }
.check .box::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); opacity: 0; }
.check input:checked + .box::after { opacity: 1; }

/* ---------- chips / segmented ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--ink-2);
  background: #fff; border: 0; box-shadow: 0 0 0 1px rgba(17, 17, 24, 0.1);
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.chip:hover { box-shadow: 0 0 0 1px rgba(17, 17, 24, 0.25); }
.chip.on { background: var(--ink); color: #fff; box-shadow: 0 0 0 1px var(--ink); }

.seg { display: flex; padding: 4px; border-radius: 13px; background: rgba(17, 17, 24, 0.05); gap: 2px; }
.seg button { flex: 1; height: 34px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); transition: all 0.2s var(--ease); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(17, 17, 24, 0.1), 0 0 0 0.5px rgba(17, 17, 24, 0.05); }

.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: rgba(17, 17, 24, 0.06); color: var(--ink-2); }
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.ok { background: rgba(34, 160, 107, 0.12); color: var(--ok); }
.badge.warn { background: rgba(229, 165, 10, 0.14); color: #a87a00; }
.badge.danger { background: rgba(229, 72, 77, 0.12); color: var(--danger); }

/* ---------- toast ---------- */
.toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  padding: 11px 18px; border-radius: 14px; font-size: 14px; font-weight: 500; color: #fff;
  background: rgba(20, 20, 28, 0.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4); animation: toastIn 0.35s var(--ease);
}
.toast.err { background: rgba(200, 50, 56, 0.92); }
.toast.note { background: rgba(255, 255, 255, 0.85); color: var(--muted); font-size: 13px; box-shadow: 0 0 0 1px var(--line), 0 8px 24px -14px rgba(0, 0, 0, 0.25); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(0.97); } }

/* ---------- modal ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 20px;
  background: rgba(240, 240, 246, 0.5); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation: fade 0.2s;
}
.modal { width: 100%; max-width: 440px; border-radius: var(--r-xl); padding: 28px; background: var(--glass-strong); animation: pop 0.3s var(--ease); }
.modal h3 { margin: 0 0 6px; font-size: 20px; letter-spacing: -0.03em; }
.modal p.sub { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(6px); } }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(17, 17, 24, 0.12); border-top-color: var(--accent); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll::-webkit-scrollbar-thumb { background: rgba(17, 17, 24, 0.12); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
.scroll::-webkit-scrollbar-track { background: transparent; }

/* ---------- auth pages ---------- */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-top { position: fixed; top: 0; left: 0; right: 0; padding: 22px 32px; display: flex; justify-content: space-between; align-items: center; }
.auth-card { width: 100%; max-width: 440px; border-radius: var(--r-xl); padding: 36px; }
.auth-card h1 { font-size: 26px; letter-spacing: -0.04em; margin: 0 0 6px; line-height: 1.3; }
.auth-card .sub { color: var(--muted); margin: 0 0 26px; font-size: 14.5px; }
.auth-foot { margin-top: 20px; text-align: center; font-size: 14px; color: var(--muted); }
.auth-foot a { color: var(--ink); font-weight: 600; }

.progress { height: 4px; border-radius: 4px; background: rgba(17, 17, 24, 0.06); overflow: hidden; margin-bottom: 26px; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--pink)); border-radius: 4px; transition: width 0.5s var(--ease); }
.step-label { font-size: 12.5px; font-weight: 700; color: var(--accent); margin-bottom: 8px; letter-spacing: 0; }
.step { display: none; animation: stepIn 0.4s var(--ease); }
.step.on { display: block; }
@keyframes stepIn { from { opacity: 0; transform: translateX(12px); } }

.terms-box { border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, 0.6); margin-bottom: 10px; overflow: hidden; }
.terms-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; }
.terms-head .check { font-size: 14.5px; font-weight: 600; }
.terms-head .req { color: var(--accent); font-size: 12px; font-weight: 700; margin-left: 2px; }
.terms-toggle { font-size: 12.5px; color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.terms-toggle:hover { background: rgba(17, 17, 24, 0.05); }
.terms-body { display: none; max-height: 190px; overflow: auto; padding: 0 16px 14px; font-size: 12.5px; color: var(--ink-2); line-height: 1.7; border-top: 1px solid var(--line-2); }
.terms-body.open { display: block; padding-top: 12px; }
.terms-body h4 { margin: 10px 0 2px; font-size: 12.5px; }
.terms-all { padding: 14px; border-radius: 14px; background: rgba(17, 17, 24, 0.04); margin-bottom: 12px; font-weight: 700; }

.code-inputs { display: flex; gap: 8px; justify-content: space-between; margin: 6px 0 12px; }
.code-inputs input {
  width: 100%; max-width: 56px; height: 62px; text-align: center; font-size: 26px; font-weight: 700; font-family: var(--mono);
  border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.8); outline: none; transition: all 0.15s;
}
.code-inputs input:focus { border-color: rgba(255, 90, 31, 0.6); box-shadow: 0 0 0 4px rgba(255, 90, 31, 0.12); background: #fff; }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.link-btn { font-size: 13px; font-weight: 600; color: var(--accent); }
.link-btn:disabled { color: var(--faint); cursor: default; }

.pw-rules { display: flex; gap: 12px; flex-wrap: wrap; margin: -4px 0 14px; }
.pw-rules span { font-size: 12.5px; color: var(--faint); display: inline-flex; align-items: center; gap: 4px; transition: color 0.2s; }
.pw-rules span::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pw-rules span.ok { color: var(--ok); }

.done-mark {
  width: 72px; height: 72px; border-radius: 50%; margin: 6px auto 20px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--pink)); color: #fff; box-shadow: 0 12px 30px -10px rgba(255, 90, 31, 0.6);
  animation: pop 0.5s var(--ease);
}
.done-mark svg { width: 34px; height: 34px; }

/* custom dropdown */
.dd { position: relative; width: 100%; }
.dd.role { width: auto; display: inline-block; }
.dd-native { position: absolute !important; inset: 0; opacity: 0; pointer-events: none; width: 100%; height: 100%; }
.dd-btn { width: 100%; height: 46px; padding: 0 14px 0 15px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 13px; background: rgba(255, 255, 255, 0.72); box-shadow: 0 0 0 1px var(--line); font-size: 15px; text-align: left; transition: box-shadow 0.15s, background 0.15s; }
.dd-btn:hover { background: #fff; }
.dd.open .dd-btn { background: #fff; box-shadow: 0 0 0 1.5px rgba(255, 90, 31, 0.55); }
.dd-btn svg { width: 14px; height: 14px; flex: none; color: var(--muted); transition: transform 0.15s; }
.dd.open .dd-btn svg { transform: rotate(180deg); }
.dd-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd.sm .dd-btn { height: 38px; font-size: 14px; border-radius: 11px; }
.dd.role .dd-btn { height: 28px; padding: 0 9px 0 10px; font-size: 12px; font-weight: 600; border-radius: 8px; gap: 6px; color: var(--ink-2); }
.dd.role .dd-btn svg { width: 11px; height: 11px; }
.dd-btn:disabled { opacity: 0.5; cursor: default; }
.dd-menu { position: fixed; z-index: 2000; max-height: 280px; overflow: auto; padding: 5px; border-radius: 14px; background: #fff; box-shadow: 0 16px 40px -12px rgba(16, 16, 16, 0.28), 0 0 0 1px rgba(16, 16, 16, 0.06); animation: pop 0.14s var(--ease); }
.dd-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 11px; border-radius: 9px; font-size: 14px; text-align: left; white-space: nowrap; color: var(--ink-2); }
.dd-item:hover { background: rgba(17, 17, 24, 0.05); }
.dd-item.on { color: var(--ink); font-weight: 700; background: rgba(255, 90, 31, 0.08); }
.dd-item.locked, .dd-label.locked { color: var(--faint, #a1a1aa); }
.dd-item svg { width: 14px; height: 14px; color: var(--accent); flex: none; }


/* info "i" inside segmented buttons + hover tooltip */
.seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg-i { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; font: italic 700 10px/1 Georgia, serif; color: var(--faint); box-shadow: inset 0 0 0 1.2px currentColor; cursor: help; flex: none; }
.seg-i:hover, .seg button.on .seg-i { color: var(--muted); }
.tipbox { position: fixed; z-index: 3000; max-width: 260px; padding: 10px 12px; border-radius: 11px; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 500; line-height: 1.6; letter-spacing: -0.01em; pointer-events: none; animation: fade 0.12s; word-break: keep-all; }
.tipbox::after { content: ""; position: absolute; left: var(--ax, 50%); transform: translateX(-50%); border: 6px solid transparent; }
.tipbox.up::after { top: 100%; border-top-color: var(--ink); }
.tipbox.down::after { bottom: 100%; border-bottom-color: var(--ink); }

.tip-i { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 6px; border-radius: 50%; font: italic 700 10px/1 Georgia, serif; color: var(--faint); box-shadow: inset 0 0 0 1.2px currentColor; cursor: help; vertical-align: -2px; }
.tip-i:hover { color: var(--muted); }
.tipbox .tip-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; }
.tipbox .tip-legend span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.tipbox .cv { margin: 0; }
.tipbox .cv.s-none { background: rgba(255, 255, 255, 0.35); }
.tipbox.wide { max-width: 380px; padding: 13px 15px; font-size: 13px; line-height: 1.75; }
