/* ============================================================
   디자인스킨 허브 — Specimen Library Aesthetic & Password Auth Style
   warm paper base · ink text · royal blue accent · color chips
   ============================================================ */
@import url("../_assets/cdn.jsdelivr.net/gh/orioncactus/pretendard_v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");
@import url("../_assets/webfontworld.github.io/gmarket/GmarketSans.css");

:root {
  --paper: #f8fafc;
  --paper-deep: #f1f5f9;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-soft: #334155;
  --ink-faint: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --accent: #4f46e5;
  --accent-soft: #eef2ff;
  --accent-ink: #4338ca;
  --gold: #c89b3c;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-1: 0 1px 2px rgba(23, 21, 14, .05), 0 4px 14px rgba(23, 21, 14, .06);
  --shadow-2: 0 2px 6px rgba(23, 21, 14, .08), 0 14px 34px rgba(23, 21, 14, .13);
  --font-display: 'GmarketSans', 'Pretendard Variable', Pretendard, sans-serif;
  --font-body: 'Pretendard Variable', Pretendard, -apple-system, 'Malgun Gothic', sans-serif;
  --wrap: 1180px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0f1216;
  --paper-deep: #12161c;
  --card: #181d24;
  --ink: #eef2f8;
  --ink-soft: #b9c3d0;
  --ink-faint: #8d97a6;
  --line: #262d37;
  --line-strong: #38414e;
  --accent: #8aa9ff;
  --accent-soft: rgba(138, 169, 255, .16);
  --accent-ink: #bccdff;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .45), 0 4px 14px rgba(0, 0, 0, .45);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .5), 0 16px 38px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image: radial-gradient(rgba(23,21,14,.028) 1px, transparent 1px);
  background-size: 22px 22px;
}
:root[data-theme="dark"] body {
  background-image: radial-gradient(rgba(240,237,225,.03) 1px, transparent 1px);
}
img { max-width: 100%; display: block; }
a { color: var(--accent-ink); text-decoration: none; }
button { font-family: inherit; }
::selection { background: var(--accent); color: #fff; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ── Header ─────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 18px;
  height: 62px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em;
  color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0;
  transition: transform .2s ease;
}
.logo:hover { transform: translateY(-1px); }
.logo-swatch {
  width: 26px; height: 26px; border-radius: 8px; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  position: relative; overflow: hidden;
}
.logo-swatch::after {
  content: ''; position: absolute; inset: 2px; border-radius: 6px;
  border: 1.5px solid rgba(255,255,255,0.45);
}
.logo em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent-ink), #9333ea);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  font-weight: 800;
}
.main-nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; }
.main-nav a {
  text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: .88rem;
  padding: 7px 13px; border-radius: 999px; white-space: nowrap;
  transition: background .18s, color .18s;
}
.main-nav a:hover { background: var(--paper-deep); color: var(--ink); }
.main-nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }

/* 비밀번호 인증 스롯 디자인 */
.auth-slot { flex-shrink: 0; display: flex; align-items: center; position: relative; gap: 6px; }
.pass-auth-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 7px 14px; font-weight: 700; font-size: .82rem; min-height: 38px;
  transition: all .18s ease;
}
.pass-auth-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.pass-auth-btn.unlocked {
  background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent);
}
.pass-setting-btn {
  border: 1px solid var(--line-strong); background: var(--paper-deep); color: var(--ink-soft);
  border-radius: 999px; padding: 6px 10px; font-size: .75rem; font-weight: 700; cursor: pointer;
}
.pass-setting-btn:hover { background: var(--line); color: var(--ink); }

.theme-toggle {
  flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--line-strong); background: var(--card); color: var(--ink);
  cursor: pointer; font-size: 1rem; line-height: 1;
  transition: transform .18s;
}
.theme-toggle:hover { transform: rotate(20deg) scale(1.06); }

/* ── Hero (index) ───────────────────────── */
.hero { position: relative; overflow: hidden; padding: 74px 0 150px; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-ink);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px;
  background: var(--card);
  animation: rise .6s .05s both;
}
.hero h1 {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(2.1rem, 5.4vw, 3.7rem);
  line-height: 1.16; letter-spacing: -.02em;
  margin: 20px 0 16px; max-width: 15em;
  animation: rise .6s .15s both;
}
.hero h1 .stroke { color: var(--accent-ink); }
.hero p.lead {
  font-size: clamp(.98rem, 1.6vw, 1.12rem); color: var(--ink-soft);
  max-width: 40em; margin: 0 0 30px;
  animation: rise .6s .25s both;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; animation: rise .6s .35s both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* 통계 바 */
.stat-strip {
  display: flex; flex-wrap: wrap; gap: 16px 28px; margin-top: 48px; padding-top: 32px;
  border-top: 1px solid var(--line); animation: rise .6s .45s both;
}
.stat { display: flex; flex-direction: column; }
.stat b { font-family: var(--font-display); font-size: 1.6rem; line-height: 1; color: var(--ink); }
.stat span { font-size: .82rem; color: var(--ink-faint); font-weight: 600; margin-top: 4px; }

/* 컬러 스트림 */
.color-stream {
  position: absolute; inset: auto 0 0 0; height: 130px; z-index: -1; opacity: .8;
  display: flex; align-items: flex-end; gap: 6px; padding: 0 4vw;
  mask-image: linear-gradient(to top, rgba(0,0,0,.55), transparent);
}
.color-stream i {
  flex: 1; border-radius: 6px 6px 0 0; min-width: 4px;
  animation: pulseHeight 3s ease-in-out infinite alternate;
}
@keyframes pulseHeight { from { transform: scaleY(.85); } to { transform: scaleY(1.15); } }

/* ── Section & Grids ─────────────────────── */
.section { padding: 60px 0; }
.section-head { margin-bottom: 36px; }
.section-head .num {
  font-family: var(--font-display); font-weight: 700; font-size: .85rem;
  color: var(--accent-ink); letter-spacing: .08em; display: block; margin-bottom: 4px;
}
.section-head h2 {
  font-family: var(--font-display); font-size: 1.8rem; margin: 0 0 6px; font-weight: 700;
}
.section-head p { margin: 0; color: var(--ink-faint); font-size: .95rem; }

.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px;
}
.feature-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px; text-decoration: none; color: inherit; position: relative;
  transition: transform .2s, border-color .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.feature-card:hover {
  transform: translateY(-4px); border-color: var(--line-strong); box-shadow: var(--shadow-2);
}
.fc-ico { font-size: 2.2rem; margin-bottom: 14px; }
.feature-card h3 { margin: 0 0 8px; font-size: 1.2rem; font-weight: 700; color: var(--ink); }
.feature-card p { margin: 0; font-size: .9rem; color: var(--ink-soft); line-height: 1.55; }
.fc-go {
  position: absolute; top: 24px; right: 24px; font-size: 1.2rem; color: var(--ink-faint);
  transition: transform .2s, color .2s;
}
.feature-card:hover .fc-go { transform: translateX(4px); color: var(--accent-ink); }

/* 사용 방법 4단계 Grid */
.step-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px;
}
.step {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 22px; position: relative;
}
.step h3 { margin: 0 0 8px; font-size: 1.05rem; font-weight: 700; color: var(--accent-ink); }
.step p { margin: 0; font-size: .88rem; color: var(--ink-soft); line-height: 1.5; }

/* 칩 & 버튼 */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); border-radius: 999px; padding: 7px 16px;
  font-size: .86rem; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: all .15s;
}
.chip:hover, .chip[aria-pressed="true"] {
  border-color: var(--ink); background: var(--ink); color: var(--paper);
}
.chip .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 12px 24px; font-weight: 700; font-size: .94rem;
  cursor: pointer; text-decoration: none; border: 1px solid transparent; transition: all .18s;
}
.btn-primary { background: var(--accent); color: #ffffff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 90%, black); transform: translateY(-1px); }
.btn-ghost { background: var(--card); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); transform: translateY(-1px); }
.btn-sm { padding: 6px 14px; font-size: .82rem; }

/* ── 스킨 갤러리 카드 ────────────────────── */
.skin-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px;
}
.skin-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; position: relative; transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}
.skin-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.skin-card .thumb {
  aspect-ratio: 16/9; background: var(--paper-deep); position: relative; overflow: hidden;
}
.skin-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.palette-band { display: flex; height: 10px; }
.palette-band i { flex: 1; height: 100%; }

.sc-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.sc-no { font-size: .75rem; font-weight: 700; color: var(--ink-faint); letter-spacing: .05em; }
.skin-card h3 { margin: 4px 0; font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.sc-cat { font-size: .8rem; color: var(--accent-ink); font-weight: 600; margin-top: auto; }

.fav-btn {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: rgba(0,0,0,.4); color: #ffffff; cursor: pointer; font-size: 1rem;
  backdrop-filter: blur(4px); transition: transform .15s, background .15s;
}
.fav-btn[aria-pressed="true"] { color: #ffca28; background: rgba(0,0,0,.7); }
.fav-btn:hover { transform: scale(1.1); }

/* ── 미니 라이브 슬라이드 미리보기 ───────── */
.live-preview {
  background: var(--paper-deep); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 16px;
}
.lp-slide {
  border-radius: 8px; padding: 18px; font-size: .8rem; box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; gap: 14px; min-height: 200px;
}
.lp-head { display: flex; justify-content: space-between; align-items: flex-start; }
.lp-title { font-weight: 700; font-size: 1.1rem; line-height: 1.3; }
.lp-rule { height: 3px; width: 40px; margin-top: 6px; border-radius: 2px; }
.lp-date { font-size: .7rem; opacity: .7; }
.lp-body { display: flex; gap: 12px; margin-top: 4px; }
.lp-kpis { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.lp-kpi { padding: 6px 8px; border-radius: 6px; display: flex; flex-direction: column; }
.lp-kpi b { font-size: 1rem; line-height: 1.1; }
.lp-kpi span { font-size: .65rem; opacity: .85; }
.lp-chart { flex: 1; display: flex; align-items: flex-end; gap: 6px; height: 75px; }
.lp-chart i { flex: 1; border-radius: 3px 3px 0 0; }
.lp-foot { display: flex; justify-content: space-between; font-size: .68rem; opacity: .6; margin-top: auto; }
.lp-tag { display: block; font-size: .72rem; color: var(--ink-faint); text-align: center; margin-top: 8px; }

/* ── Modal (스킨 모달 및 비밀번호 모달) ────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.6);
  backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center;
  padding: 20px; opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--card); border-radius: var(--radius); width: 100%; max-width: 820px;
  max-height: 90vh; overflow-y: auto; padding: 28px; box-shadow: var(--shadow-2);
  position: relative; animation: modalIn .22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn { from { transform: scale(.95) translateY(10px); } to { transform: none; } }
.modal-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.modal-top h2 { margin: 4px 0 0; font-size: 1.5rem; font-weight: 700; }
.m-no { font-size: .8rem; font-weight: 700; color: var(--accent-ink); }
.modal-close {
  background: var(--paper-deep); border: none; width: 34px; height: 34px; border-radius: 50%;
  cursor: pointer; font-size: 1rem; color: var(--ink); display: flex; align-items: center; justify-content: center;
}
.modal-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
@media (max-width: 720px) { .modal-cols { grid-template-columns: 1fr; } }

.palette-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.palette-row {
  display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--paper); border: 1px solid var(--line); cursor: pointer; text-align: left;
  transition: background .15s; width: 100%;
}
.palette-row:hover { background: var(--paper-deep); border-color: var(--line-strong); }
.palette-row .pc { width: 24px; height: 24px; border-radius: 6px; border: 1px solid rgba(0,0,0,.15); flex-shrink: 0; }
.palette-row .pl { font-size: .85rem; font-weight: 600; flex: 1; }
.palette-row .copy-hint { font-size: .72rem; color: var(--accent-ink); opacity: 0; transition: opacity .15s; }
.palette-row:hover .copy-hint { opacity: 1; }
.palette-row .px { font-family: monospace; font-weight: 700; font-size: .85rem; color: var(--ink-soft); }

.m-desc dt { font-weight: 700; font-size: .85rem; color: var(--ink-faint); margin-top: 12px; }
.m-desc dd { margin: 4px 0 0; font-size: .92rem; color: var(--ink); line-height: 1.5; }
.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }

/* 비밀번호 인증 전용 팝업 모달 */
.pass-modal {
  max-width: 440px; padding: 28px; text-align: center;
}
.pass-modal-ico { font-size: 2.8rem; margin-bottom: 12px; }
.pass-modal h3 { margin: 0 0 8px; font-size: 1.3rem; font-weight: 700; }
.pass-modal p { font-size: .9rem; color: var(--ink-soft); margin: 0 0 20px; line-height: 1.5; }
.pass-input-wrap { margin-bottom: 20px; text-align: left; }
.pass-input-wrap label { display: block; font-size: .8rem; font-weight: 700; margin-bottom: 6px; color: var(--ink-faint); }
.pass-input {
  width: 100%; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  background: var(--paper); color: var(--ink); font-size: 1rem; font-family: inherit;
}
.pass-input:focus { outline: none; border-color: var(--accent); }

/* ── 프롬프트 빌더 ───────────────────────── */
.builder-layout { display: grid; grid-template-columns: 320px 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .builder-layout { grid-template-columns: 1fr; } }

.skin-pick-box {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; max-height: 580px; display: flex; flex-direction: column;
}
.skin-pick-list { overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.skin-pick {
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-sm);
  background: var(--paper); border: 1px solid transparent; cursor: pointer; text-align: left;
  transition: all .15s; width: 100%;
}
.skin-pick:hover, .skin-pick[aria-pressed="true"] {
  background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 700;
}
.mini-band { display: flex; width: 24px; height: 16px; border-radius: 4px; overflow: hidden; flex-shrink: 0; }
.mini-band i { flex: 1; height: 100%; }

.builder-main {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px;
}
.builder-form-group { margin-bottom: 18px; }
.builder-form-group label { display: block; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.builder-textarea {
  width: 100%; min-height: 140px; padding: 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--paper); color: var(--ink);
  font-family: inherit; font-size: .92rem; resize: vertical; line-height: 1.6;
}
.builder-textarea:focus { outline: none; border-color: var(--accent); }
.output-box {
  background: var(--paper-deep); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 16px; font-family: monospace; font-size: .85rem; white-space: pre-wrap;
  word-break: break-all; max-height: 320px; overflow-y: auto; color: var(--ink);
}

/* ── 서식 및 카드 ───────────────────────── */
.style-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; }
.style-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; display: flex; flex-direction: column; gap: 10px;
}
.st-tag {
  align-self: flex-start; font-size: .75rem; font-weight: 700; letter-spacing: .06em;
  color: var(--accent-ink); background: var(--accent-soft); padding: 3px 10px; border-radius: 999px;
}
.style-card h3 { margin: 0; font-size: 1.15rem; font-weight: 700; }
.st-desc { margin: 0; font-size: .88rem; color: var(--ink-soft); line-height: 1.5; }
.st-usage { margin: 0; font-size: .8rem; color: var(--ink-faint); font-weight: 600; }
.prompt-text {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px; font-size: .84rem; margin: 8px 0; white-space: pre-wrap; word-break: break-all;
}

/* ── Toast ──────────────────────────────── */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--paper); padding: 12px 24px; border-radius: 999px;
  font-weight: 700; font-size: .88rem; box-shadow: var(--shadow-2); z-index: 200;
  opacity: 0; pointer-events: none; transition: all .25s ease;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* ── Footer ─────────────────────────────── */
.duon-footer {
  background: var(--paper-deep); border-top: 1px solid var(--line); padding: 48px 0 36px;
  margin-top: 80px; font-size: .85rem; color: var(--ink-soft);
}
.duon-footer-inner { max-width: var(--wrap); margin: 0 auto; padding: 0 22px; display: flex; flex-direction: column; gap: 14px; text-align: center; }
.duon-footer-brand a, .duon-footer-info a, .duon-footer-links a { color: inherit; text-decoration: underline; }
.duon-footer-sep { margin: 0 6px; opacity: .5; }
.duon-footer-info span { display: inline-block; margin: 0 6px; }
.duon-footer-social { display: flex; justify-content: center; gap: 16px; font-size: 1.3rem; margin: 8px 0; }
.duon-footer-social a { color: var(--ink-soft); transition: color .15s; }
.duon-footer-social a:hover { color: var(--accent-ink); }
.duon-footer-copy { font-size: .78rem; color: var(--ink-faint); }

/* 동적 CSS 썸네일 (이미지 대체 fallback 디자인) */
.thumb-gen {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
  user-select: none;
}
.thumb-gen b {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
  z-index: 1;
}
.tg-rule {
  width: 32px;
  height: 3px;
  border-radius: 2px;
  margin: 6px 0;
  z-index: 1;
}
.tg-chips {
  display: flex;
  gap: 5px;
  margin-top: 6px;
  z-index: 1;
}
.tg-chips i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.15);
  display: inline-block;
}

/* ── 비밀번호 필수 잠금 게이트웨이 (Gatekeeper) ─────────────────── */
body.auth-locked main {
  filter: blur(14px) grayscale(40%);
  pointer-events: none;
  user-select: none;
  opacity: .35;
  transition: filter .3s ease, opacity .3s ease;
}

.auth-gate-overlay {
  position: fixed;
  inset: 0;
  top: 62px;
  z-index: 990;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transition: opacity .25s ease, visibility .25s ease;
}
.auth-gate-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.auth-gate-card {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 38px 30px;
  text-align: center;
  box-shadow: var(--shadow-2);
  animation: gateScaleIn .25s ease;
}

@keyframes gateScaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.auth-gate-ico {
  font-size: 3rem;
  margin-bottom: 14px;
  display: inline-block;
}

.auth-gate-card h2 {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--ink);
  margin: 0 0 10px;
  letter-spacing: -.02em;
}

.auth-gate-card p {
  font-size: .92rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin: 0 0 24px;
}

.auth-gate-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-gate-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line-strong);
  background: var(--paper);
  color: var(--ink);
  font-size: 1.05rem;
  text-align: center;
  letter-spacing: .2em;
  font-weight: 700;
  outline: none;
  transition: border-color .2s;
}

.auth-gate-input:focus {
  border-color: var(--accent);
}

.auth-gate-btn {
  width: 100%;
  padding: 13px;
  font-size: 1rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transition: transform .15s, opacity .15s;
}

.auth-gate-btn:hover {
  opacity: .95;
  transform: translateY(-1px);
}

.auth-gate-hint {
  font-size: .8rem;
  color: var(--ink-faint);
  margin-top: 14px;
}


/* ── readable contrast guards (dark theme) ─────────────────── */
:root[data-theme="dark"] body {
  background-color: var(--paper);
  background-image: radial-gradient(rgba(238, 242, 248, .035) 1px, transparent 1px);
}
:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select,
:root[data-theme="dark"] button {
  color: var(--ink);
}
:root[data-theme="dark"] ::placeholder {
  color: var(--ink-faint);
  opacity: 1;
}
:root[data-theme="dark"] .btn-primary,
:root[data-theme="dark"] .btn-primary:hover {
  color: #0f1216;
}
