/* 입장 화면(로그인 · 디자이너 입장 · D-297) — 유리 카드 + 천천히 도는 빛 띠 + PIN 칸이 돌다가 모이는 움직임(assets/gate.js).
   login.php · designer_login.php · 인스타 연결·안내·개인정보(gate-page)가 읽는다(body.gate). 화면 모드(야간/일반)와 무관하게 늘 이 모양.
   색: 처음(D-297)은 검정·금빛이었고, D-318(원장 "금빛 안 써도 돼 · 내부 화면하고 느낌 비슷하게")부터 **내부 야간 화면과 같은 남색·민트**. 변수 이름 --g-gold* 는 그대로 두고 값만 바꿨다. */

body.gate {
  --g-bg: #151a2e;
  --g-ink: #f1f3f9;
  --g-sub: #b6bdd4;
  --g-muted: #8f97b3;
  --g-gold: #97e8c6;   /* 이름은 옛 것(금색) 그대로지만 값은 민트 — 강조색 */
  --g-gold-2: #5d7cf2;
  --g-gold-ink: #141a2c;
  --g-line: rgba(255, 255, 255, .16);
  --g-ok: #35c98a;
  min-height: 100dvh; margin: 0; padding: 0 16px; overflow-x: hidden;
  display: grid; place-items: center;
  background-color: var(--g-bg); color: var(--g-ink); color-scheme: dark;
  background-image: radial-gradient(56rem 34rem at 0% -8%, rgba(104, 112, 242, .36), transparent 62%), radial-gradient(46rem 30rem at 100% 100%, rgba(64, 185, 162, .24), transparent 60%); background-attachment: fixed;
  font-family: Pretendard, "Pretendard Variable", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

/* 금빛 띠 — 큰 고리의 한 토막만 보이게(원뿔 그라데이션 + 고리 모양으로 오려 냄) */
.gate-bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.gate-bg i { position: absolute; left: 50%; top: 50%; width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); border-radius: 50%;
  background: conic-gradient(from var(--from), transparent 0 30%, #1b2148 38%, #3a44ad 48%, #8f9cff 57%, #62cdb6 64%, #2a6f79 74%, #1a2040 84%, transparent 92% 100%);
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - var(--w)), #000 calc(100% - var(--w) + 1px), #000 calc(100% - 1px), transparent 100%);
  mask: radial-gradient(closest-side, transparent calc(100% - var(--w)), #000 calc(100% - var(--w) + 1px), #000 calc(100% - 1px), transparent 100%);
  filter: blur(6px); opacity: var(--o); transform: translate(var(--x), var(--y)) rotate(0deg); animation: gate-drift var(--t) linear infinite; }
.gate-bg i:nth-child(1) { --s: 120vmax; --w: 10vmax; --from: 200deg; --x: -34vmax; --y: -6vmax; --o: .55; --t: 80s; }
.gate-bg i:nth-child(2) { --s: 100vmax; --w: 6vmax; --from: 20deg; --x: 36vmax; --y: 14vmax; --o: .5; --t: 100s; animation-direction: reverse; }
.gate-bg i:nth-child(3) { --s: 160vmax; --w: 16vmax; --from: 240deg; --x: 20vmax; --y: -62vmax; --o: .38; --t: 130s; }
.gate-bg i:nth-child(4) { --s: 80vmax; --w: 4vmax; --from: 120deg; --x: -30vmax; --y: 38vmax; --o: .45; --t: 70s; animation-direction: reverse; }
.gate-bg::after { content: ''; position: absolute; inset: 0; background: radial-gradient(70vmax 70vmax at 50% 45%, rgba(21, 26, 46, .08), rgba(21, 26, 46, .55) 75%); }
@keyframes gate-drift { to { transform: translate(var(--x), var(--y)) rotate(360deg); } }

/* 가운데 묶음 */
.gate .login-box { position: relative; z-index: 1; width: 100%; max-width: 400px; margin: 0; padding: 28px 0 40px; animation: gate-rise .7s cubic-bezier(.2, .7, .2, 1) backwards; }
@keyframes gate-rise { from { opacity: 0; transform: translateY(22px) scale(.97); } to { opacity: 1; transform: none; } }
.gate .login-logo { display: block; margin: 0 auto 14px; width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 0 0 1px rgba(151, 232, 198, .35), 0 14px 40px rgba(0, 0, 0, .6), 0 0 46px rgba(151, 232, 198, .22); }
.gate .brand-big { text-align: center; font-size: 30px; font-weight: 700; letter-spacing: .04em; color: var(--g-ink); margin: 0; }
.gate .brand-big em { font-style: normal; color: var(--g-gold); }
.gate-tag { margin: 6px 0 22px; text-align: center; font-size: 13.5px; color: var(--g-sub); }

/* 유리 카드 */
.gate .card.gate-card { position: relative; margin: 0; padding: 26px 22px 22px; border: 1px solid var(--g-line); border-radius: 26px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .04) 45%, rgba(255, 255, 255, .07));
  -webkit-backdrop-filter: blur(18px) saturate(120%); backdrop-filter: blur(18px) saturate(120%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 30px 70px rgba(0, 0, 0, .55); color: var(--g-ink); }
.gate-card h1 { margin: 0 0 4px; text-align: center; font-size: 19px; font-weight: 700; }
.gate-card h1 em { font-style: normal; color: var(--g-gold); }
.gate-card .gate-sub { margin: 0 0 18px; text-align: center; font-size: 13px; color: var(--g-sub); }
.gate .fl { display: block; margin: 14px 0 6px; font-size: 13px; font-weight: 600; color: var(--g-sub); }
.gate input[type=text], .gate input[type=password] { width: 100%; padding: 13px 14px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 14px; background: rgba(0, 0, 0, .34); color: var(--g-ink); font-size: 16px; outline: none; transition: border-color .2s, box-shadow .2s; }
.gate input[type=text]:focus, .gate input[type=password]:focus { border-color: var(--g-gold); box-shadow: 0 0 0 3px rgba(151, 232, 198, .22); }
.gate .btn.gate-btn { position: relative; width: 100%; margin-top: 20px; padding: 14px; border: 0; border-radius: 14px; background: linear-gradient(180deg, #aef2d6, #7fd9b4); color: var(--g-gold-ink); font-size: 16px; font-weight: 800; letter-spacing: .02em; box-shadow: 0 10px 26px rgba(127, 217, 180, .28); transition: transform .15s, filter .2s, background .4s; }
.gate .btn.gate-btn:hover { filter: brightness(1.06); }
.gate .btn.gate-btn:active { transform: scale(.98); }
.gate .flash-err { margin: 0 0 14px; padding: 10px 12px; border: 1px solid rgba(255, 120, 120, .4); border-radius: 12px; background: rgba(120, 20, 20, .35); color: #ffc9c9; font-size: 13.5px; }
.gate .gate-foot { margin: 16px 0 0; text-align: center; font-size: 13px; color: var(--g-sub); }
.gate .gate-foot a { color: var(--g-gold); text-underline-offset: 3px; }
.gate-card.is-shake { animation: gate-shake .45s cubic-bezier(.3, .6, .4, 1); }
@keyframes gate-shake { 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }

/* PIN 칸 — 진짜 입력 칸은 그 위에 투명하게 덮여 있다 */
.pin-area { position: relative; height: 132px; margin-top: 4px; display: grid; place-items: center; }
.pin-cells { display: flex; gap: 10px; justify-content: center; transform-origin: 50% 50%; }
.pin-cell { width: 50px; height: 58px; display: grid; place-items: center; border: 1.5px solid rgba(151, 232, 198, .32); border-radius: 14px; background: rgba(0, 0, 0, .38); font-size: 26px; font-weight: 700; color: var(--g-ink); transition: transform .5s cubic-bezier(.3, .7, .2, 1), border-color .2s, box-shadow .2s, opacity .3s; }
.pin-cell.is-on { border-color: rgba(151, 232, 198, .7); }
.pin-cell.is-cur { border-color: var(--g-gold); box-shadow: 0 0 0 3px rgba(151, 232, 198, .2), 0 0 22px rgba(151, 232, 198, .3); }
.pin-cell.is-cur::after { content: ''; width: 2px; height: 24px; background: var(--g-gold); animation: gate-blink 1s steps(2) infinite; }
@keyframes gate-blink { 50% { opacity: 0; } }
.pin-area input[name=pin] { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; font-size: 16px; cursor: pointer; }
.pin-ring { position: absolute; left: 50%; top: 50%; width: 116px; height: 116px; margin: -58px 0 0 -58px; border-radius: 50%; border: 1.5px dashed rgba(151, 232, 198, .0); pointer-events: none; transition: border-color .4s, transform .5s cubic-bezier(.3, .7, .2, 1), box-shadow .4s; }

/* 확인 중 — 칸이 원을 그리며 돈다 → 가운데로 모인다 */
.is-checking .pin-ring { border-color: rgba(151, 232, 198, .5); }
.is-checking .pin-cells { animation: gate-spin 1s linear infinite; }
.is-checking .pin-cell.is-cur::after { display: none; }
.is-merge .pin-cells { animation: none; }
.is-merge .pin-cell { opacity: 0; }
.is-merge .pin-ring { border-style: solid; border-color: var(--g-gold); transform: scale(.62); box-shadow: 0 0 34px rgba(151, 232, 198, .5); }
@keyframes gate-spin { to { transform: rotate(360deg); } }
.gate-btn .gate-spin { display: none; width: 16px; height: 16px; margin-right: 8px; vertical-align: -2px; border: 2.5px solid rgba(36, 26, 5, .25); border-top-color: var(--g-gold-ink); border-radius: 50%; animation: gate-spin .7s linear infinite; }
.is-checking .gate-btn .gate-spin { display: inline-block; }
/* 아이디·비밀번호 화면 — 확인 중에는 로고 둘레로 금빛 고리가 돈다 */
.gate-logo-wrap { position: relative; width: 84px; margin: 0 auto 14px; }
.gate-logo-wrap .login-logo { margin: 0; }
.gate-logo-wrap::after { content: ''; position: absolute; inset: -10px; border-radius: 30px; border: 2px solid transparent; border-top-color: var(--g-gold); border-right-color: rgba(151, 232, 198, .35); opacity: 0; transition: opacity .3s; }
.gate.is-busy .gate-logo-wrap::after { opacity: 1; animation: gate-spin .9s linear infinite; }

@media (max-width: 360px) { .pin-cell { width: 42px; height: 52px; font-size: 22px; } .pin-cells { gap: 7px; } }
@media (prefers-reduced-motion: reduce) {
  .gate-bg i, .gate .login-box, .is-checking .pin-cells, .gate.is-busy .gate-logo-wrap::after, .pin-cell.is-cur::after, .gate-card.is-shake { animation: none !important; }
  .pin-cell, .pin-ring { transition: none !important; }
}

/* ── 글 읽는 공개 화면(인스타 연결 · 연결 안내 · 개인정보 안내 — 카톡으로 보내는 디자이너 연결 링크가 여는 화면 · D-317) ──
   body.gate.gate-page: 가운데 한 장이 아니라 위에서부터 흐르는 글. 기존 화면의 색 변수(--ink · --line · --good-soft …)를 검정·금빛에 맞게 바꿔 끼워
   그 화면들이 직접 적어 둔 상자 색(var(--warn-soft) 등)도 저절로 어울린다. */
body.gate {
  --bg: #151a2e; --card: rgba(255, 255, 255, .06); --ink: #f1f3f9; --sub: #b6bdd4; --line: rgba(255, 255, 255, .14); --brand: #252c46;
  --accent: #97e8c6; --accent-soft: rgba(151, 232, 198, .13);
  --good: #5fd6a0; --good-soft: rgba(53, 201, 138, .14); --warn: #f2c27a; --warn-soft: rgba(240, 179, 90, .14); --bad: #ff9c9c; --bad-soft: rgba(255, 120, 120, .14);
}
body.gate.gate-page { display: block; padding: 0 16px; line-height: 1.6; }
.gate-doc { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; padding: 28px 0 48px; animation: gate-rise .9s cubic-bezier(.22, 1, .36, 1) backwards; }
.gate-page h1 { color: var(--g-ink); font-weight: 700; }
.gate-page h2 { margin: 0 0 8px; font-size: 16.5px; font-weight: 700; color: var(--g-ink); line-height: 1.45; }
.gate-page .gate-mark { display: block; margin: 0 auto; border-radius: 18px; box-shadow: 0 0 0 1px rgba(151, 232, 198, .35), 0 12px 34px rgba(0, 0, 0, .6), 0 0 40px rgba(151, 232, 198, .2); }
.gate-page .card { margin: 0 0 12px; padding: 18px 18px 16px; border: 1px solid var(--g-line); border-radius: 22px; color: var(--g-ink);
  background: linear-gradient(160deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04) 45%, rgba(255, 255, 255, .06)), rgba(21, 26, 46, .42);   /* 금빛 띠 위에서도 글이 읽히게 어두운 밑칠 */
  -webkit-backdrop-filter: blur(16px) saturate(120%); backdrop-filter: blur(16px) saturate(120%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .16) inset, 0 22px 50px rgba(0, 0, 0, .45); }
.gate-page .card + .card, .gate-page details.card { animation: gate-rise .9s cubic-bezier(.22, 1, .36, 1) backwards; }
.gate .muted { color: var(--g-sub); }
.gate a { color: var(--g-gold); text-underline-offset: 3px; }
.gate-page .btn { border: 0; border-radius: 14px; background: linear-gradient(180deg, #aef2d6, #7fd9b4); color: var(--g-gold-ink); font-weight: 800; box-shadow: 0 10px 26px rgba(127, 217, 180, .26); text-decoration: none; transition: transform .42s cubic-bezier(.22, 1, .36, 1), filter .3s; }
.gate-page .btn:active { transform: scale(.975); }
.gate-page .btn-line, .gate-page .btn-ghost { background: rgba(255, 255, 255, .06); color: var(--g-gold); border: 1px solid rgba(151, 232, 198, .45); box-shadow: none; }
.gate-page code { padding: 1px 6px; border: 1px solid rgba(255, 255, 255, .16); border-radius: 6px; background: rgba(0, 0, 0, .35); color: var(--g-ink); }
.gate-page summary { color: var(--g-ink); }
.gate-page b, .gate-page strong { color: var(--g-ink); }
.gate-page [style*="color:var(--bad"] b, .gate-page [style*="color:var(--warn"] b { color: inherit; }
.gate-page input[type=text], .gate-page textarea, .gate-page select { background: rgba(0, 0, 0, .34); color: var(--g-ink); border: 1px solid rgba(255, 255, 255, .18); }
@media (prefers-reduced-motion: reduce) { .gate-doc, .gate-page .card { animation: none !important; } }

