:root {
      color-scheme: dark;
      --bg: #090c1d;
      --panel: #101527;
      --line: rgba(210, 213, 255, .13);
      --soft: #a5aac7;
      --white: #f6f5ff;
      --violet: #bda5ff;
      --blue: #8ad6ff;
      --safe-bottom: env(safe-area-inset-bottom, 0px);
      font-family: "Pretendard", "SUIT", "Noto Sans CJK KR", "Apple SD Gothic Neo", system-ui, -apple-system, sans-serif;
    }
    * { box-sizing: border-box; }
    /* Reserve the collapsed sheet (92px), safe area, and 16px breathing room
       when the browser scrolls focused/targeted form controls into view. */
    html { background: var(--bg); scroll-behavior: smooth; scroll-padding-bottom: calc(108px + var(--safe-bottom)); }
    body {
      min-width: 320px;
      min-height: 100vh;
      min-height: 100dvh;
      margin: 0;
      overflow-x: hidden;
      color: var(--white);
      background: #090c1d;
      -webkit-font-smoothing: antialiased;
    }
    button, input { font: inherit; }
    button { -webkit-tap-highlight-color: transparent; }
    button:focus-visible, input:focus-visible { outline: 2px solid #bda5ff; outline-offset: 3px; }
    .ambient { position: fixed; z-index: 0; inset: 0; pointer-events: none; overflow: hidden; background: radial-gradient(ellipse 62% 37% at 50% -5%, #26234e 0%, transparent 83%), radial-gradient(ellipse 70% 44% at 105% 78%, #122d54 0%, transparent 82%), var(--bg); }
    .ambient::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(173,184,245,.042) 1px,transparent 1px), linear-gradient(90deg,rgba(173,184,245,.042) 1px,transparent 1px); background-size: 36px 36px; mask-image: linear-gradient(to bottom, transparent 0%, #000 15%, #000 75%, transparent 100%); }
    .orb { position: absolute; border-radius: 50%; opacity: .34; filter: blur(58px); animation: drift 15s ease-in-out infinite alternate; }
    .orb.one { width: 420px; height: 420px; top: -225px; left: -170px; background: #5b3cba; }
    .orb.two { width: 330px; height: 330px; bottom: -110px; right: -160px; background: #176aaf; animation-duration: 19s; animation-direction: alternate-reverse; }
    .float-stars { position: fixed; z-index: 0; inset: 0; pointer-events: none; overflow: hidden; }
    .float-star { position: absolute; width: 3px; height: 3px; background: #d2d8ff; border-radius: 50%; opacity: .4; animation: blink 3.5s ease-in-out infinite alternate; }

    .layout {
      position: relative;
      z-index: 1;
      width: min(100%, 540px);
      margin: 0 auto;
      padding: calc(25px + env(safe-area-inset-top, 0px)) 25px calc(120px + var(--safe-bottom));
    }
    .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
    .brand { display: inline-flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 750; letter-spacing: .11em; white-space: nowrap; }
    .brand-icon { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #aaa0ed88; border-radius: 11px; background: linear-gradient(145deg, #35315d, #151b37); font-size: 17px; font-weight: 850; letter-spacing: -.05em; box-shadow: inset 0 1px rgba(255,255,255,.16); }

    .hero { padding-top: clamp(38px, 7vh, 66px); }
    .step { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 15px; font-size: 10px; color: #a8b3e8; letter-spacing: .13em; font-weight: 700; }
    .step::before { content: ""; display: block; width: 19px; height: 1px; background: #aaacfa; }
    .hero h1 { margin: 0; font-size: clamp(29px, 7.4vw, 43px); line-height: 1.32; letter-spacing: -.065em; font-weight: 765; }
    .hero h1 .gradient { background: linear-gradient(100deg, #f5f3ff 2%, #c8b7ff 43%, #83d4ff 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
    .hero-sub { margin: 15px 0 0; color: #a6aecb; font-size: 13px; line-height: 1.75; letter-spacing: -.017em; }
    .section-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 36px 0 13px; font-size: 12px; font-weight: 740; }
    .section-title .number { color: #8d91b8; font-size: 10px; font-weight: 600; }
    .form-card { padding: 18px; border: 1px solid var(--line); border-radius: 21px; background: linear-gradient(145deg, rgba(25,30,56,.92), rgba(13,18,38,.94)); box-shadow: 0 16px 54px rgba(0,0,0,.15), inset 0 1px rgba(255,255,255,.045); }
    .field + .field { margin-top: 17px; }
    .field-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; color: #c9cce2; font-size: 12px; font-weight: 650; }
    .field-title .optional { color: #777f9d; font-weight: 500; font-size: 11px; }
    .text-input-wrap { position: relative; display: flex; align-items: center; }
    .text-input { width: 100%; height: 49px; padding: 0 15px; color: white; border: 1px solid rgba(195,199,255,.13); border-radius: 12px; background: #090e20; outline: none; transition: border-color .2s, box-shadow .2s; font-size: 14px; }
    .text-input::placeholder { color: #5d6682; }
    .text-input:focus { border-color: rgba(178,152,255,.75); box-shadow: 0 0 0 3px rgba(143,120,242,.1); }
    .text-input.with-suffix { padding-right: 43px; }
    .suffix { position: absolute; right: 16px; font-size: 12px; color: #8891b2; pointer-events: none; }
    .role-picker { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
    .role-pill { min-width: 0; height: 45px; border: 1px solid rgba(191,195,241,.13); border-radius: 11px; background: #0b1022; color: #959bbd; cursor: pointer; font-size: 12px; font-weight: 750; transition: background .2s,border-color .2s,color .2s,transform .18s; }
    .role-pill:active { transform: scale(.96); }
    .role-pill[aria-pressed="true"] { border-color: #aaa1ff; background: linear-gradient(125deg, rgba(120,101,213,.33), rgba(95,133,195,.22)); color: #fbfaff; box-shadow: inset 0 0 0 1px rgba(195,185,255,.05); }
    .form-footer { display: flex; gap: 11px; align-items: flex-start; padding: 15px 2px 0; color: #8189ad; font-size: 11px; line-height: 1.6; }
    .pulse-mark { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: #a1e6ff; box-shadow: 0 0 0 4px rgba(109,201,246,.09), 0 0 12px rgba(97,199,251,.4); }
    .open-cta { display: inline-flex; align-items: center; justify-content: center; gap: 11px; margin-top: 20px; height: 42px; padding: 0 15px; border: 1px solid #9c91ee55; border-radius: 12px; background: rgba(140,118,233,.12); color: #ece6ff; cursor: pointer; font-size: 12px; font-weight: 720; }
    .open-cta svg { width: 15px; height: 15px; }

    .backdrop { position: fixed; z-index: 8; inset: 0; background: rgba(2,5,15,.71); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .42s, visibility .42s; backdrop-filter: blur(0); }
    .backdrop.is-visible { opacity: 1; visibility: visible; pointer-events: auto; backdrop-filter: blur(7px); }
    .sheet {
      --sheet-peek: 92px;
      position: fixed;
      z-index: 10;
      left: 50%; bottom: 0;
      width: min(100%, 540px);
      height: calc(var(--sheet-peek) + var(--safe-bottom));
      display: flex;
      flex-direction: column;
      overflow: hidden;
      border: 1px solid rgba(226,220,255,.16);
      border-bottom: none;
      border-radius: 29px 29px 0 0;
      background: linear-gradient(158deg, rgba(32,36,69,.995), rgba(13,17,39,.995) 64%, rgba(12,16,37,.995));
      box-shadow: 0 -15px 65px rgba(0,0,0,.56), inset 0 1px rgba(255,255,255,.08);
      transform: translateX(-50%);
      transition: height .57s cubic-bezier(.2,.89,.22,1), opacity .26s, transform .32s;
      will-change: height;
    }
    .sheet.is-open { height: min(89dvh, 810px); }
    .sheet.is-dragging { transition: none !important; }
    .sheet.is-confirming { opacity: 0; pointer-events: none; transform: translate(-50%, 80px); }
    .sheet-grab {
      display: flex; flex-direction: column; align-items: center;
      flex: 0 0 auto; min-height: 44px;
      touch-action: none; cursor: grab; user-select: none;
    }
    .sheet-grab:active { cursor: grabbing; }
    .grab-line { display: block; width: 41px; height: 5px; margin: 11px 0 9px; border-radius: 20px; background: #6f729b; box-shadow: 0 0 15px rgba(160,140,241,.2); }
    .sheet-top { display: flex; align-items: flex-start; justify-content: center; text-align: center; gap: 12px; padding: 0 23px 13px; }
    .sheet-top h2 { margin: 4px 0 0; font-size: 19px; letter-spacing: -.045em; font-weight: 780; }
    /* Keep the dialog's labelled heading available to assistive technology. */
    .sheet.is-open .sheet-top { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .preview-full { display: none; flex: 1; min-height: 0; flex-direction: column; align-items: center; padding: 0 23px calc(13px + var(--safe-bottom)); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: none; }
    .preview-full::-webkit-scrollbar { display: none; }
    .sheet.is-open .preview-full { display: flex; }
    .preview-copy { width: 100%; margin: 0 0 12px; text-align: center; }
    .preview-copy .eyebrow { color: #a99eff; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
    .preview-copy h3 { margin: 7px 0 0; font-size: clamp(18px, 4.7vw, 23px); line-height: 1.46; letter-spacing: -.06em; font-weight: 750; }
    .preview-copy h3 em { color: #c6b5ff; font-style: normal; }
    .badge-stage { position: relative; flex: 1 1 auto; min-height: 0; width: 100%; display: flex; justify-content: center; align-items: center; padding: 4px 0 8px; perspective: 1100px; }
    .badge-stage::before { content: ""; position: absolute; z-index: -1; width: min(93%, 400px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(125,100,240,.34) 0, rgba(56,67,156,.16) 40%, transparent 70%); filter: blur(24px); animation: aura 3.6s ease-in-out infinite alternate; }
    .pass-shell { position: relative; flex: 0 0 auto; width: clamp(165px, min(64vw, calc((100dvh - 340px) * .72)), 275px); aspect-ratio: 900 / 1250; border: 4px solid transparent; border-radius: 17px; background: linear-gradient(146deg, #f7f1ff, #8386c8 21%, #3c3c72 40%, #c3c9ff 59%, #5b608e 79%, #b0b7e9) border-box; filter: drop-shadow(0 20px 25px rgba(0,0,0,.44)); transform-style: preserve-3d; transition: transform .22s ease-out; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
    .sheet.is-open .pass-shell { animation: passIn .7s cubic-bezier(.18,.85,.15,1) both; }
    .pass-shell::after { content: ""; position: absolute; pointer-events: none; z-index: 5; inset: 0; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); background: radial-gradient(circle at var(--light-x,50%) var(--light-y,35%),rgba(255,255,255,.19) 0%,transparent 38%); mix-blend-mode: screen; }
    .pass-inner { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 12px; isolation: isolate; background: #11162a; }
    .pass-art { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
    .pass-glint { position: absolute; z-index: 4; top: -70%; bottom: -70%; left: -42%; width: 50%; transform: translateX(-180%) rotate(23deg); background: linear-gradient(to right,transparent,rgba(255,255,255,.07),rgba(255,255,255,.2),rgba(255,255,255,.07),transparent); mix-blend-mode: screen; pointer-events: none; animation: sheen 5.4s ease-in-out 1s infinite; }
    .pass-info { position: absolute; z-index: 3; bottom: 7.0%; left: 8.5%; right: 8.5%; }
    .pass-name { margin: 0 0 8px; color: #fff; font-size: clamp(20px, 6.35vw, 30px); font-weight: 800; letter-spacing: -.05em; line-height: 1.14; text-shadow: 0 2px 12px rgba(0,0,0,.24); overflow-wrap: anywhere; }
    .pass-meta { display: flex; align-items: center; gap: 6px; }
    .pass-meta span { padding: 4px 8px; border: 1px solid rgba(228,224,255,.28); border-radius: 5px; background: rgba(197,189,253,.14); font-size: clamp(9px, 2.55vw, 11px); font-weight: 700; color: #ebe7ff; line-height: 1.15; letter-spacing: .01em; }
    .pass-meta span:last-child { border-color: rgba(163,225,255,.3); background: rgba(84,158,216,.15); color: #ccedff; }
    .preview-hint { flex: 0 0 auto; display: flex; gap: 7px; align-items: center; margin: 7px 0 12px; font-size: 10px; color: #858bab; }
    .preview-hint svg { width: 14px; height: 14px; color: #a6a2db; }
    .confirm { flex: 0 0 auto; width: 100%; height: 52px; border: none; border-radius: 15px; background: linear-gradient(100deg, #bdadff 0%, #9eacff 54%, #8fd8ff 100%); color: #10152e; font-weight: 850; font-size: 15px; letter-spacing: -.035em; cursor: pointer; box-shadow: 0 7px 25px rgba(151,142,255,.2), inset 0 1px 0 rgba(255,255,255,.65); transition: transform .2s, filter .2s; }
    .confirm:hover { filter: brightness(1.06); }
    .confirm:active { transform: scale(.987); }
    .confirm:disabled { opacity: .65; cursor: wait; }
    .demo-note { flex: 0 0 auto; margin: 9px 0 0; color: #69718f; font-size: 9px; text-align: center; line-height: 1.5; }

    .flight-layer { position: fixed; z-index: 30; inset: 0; overflow: hidden; pointer-events: none; }
    .flying-pass { position: fixed; z-index: 4; transform-origin: center; will-change: transform,opacity; }
    .flying-pass .pass-shell { width: 100% !important; height: 100% !important; filter: drop-shadow(0 20px 32px rgba(116,111,228,.4)); animation: none !important; }
    .flight-spark { position: fixed; left: var(--x); top: var(--y); width: var(--r); height: var(--r); border-radius: 50%; background: #f6f1ff; box-shadow: 0 0 14px rgba(171,150,255,.9); animation: spark-flight var(--duration) ease-out var(--delay) forwards; }
    .flight-flash { position: fixed; z-index: 2; width: 180px; height: 180px; border-radius: 50%; left: var(--x); top: var(--y); transform: translate(-50%,-50%) scale(.2); background: radial-gradient(circle,rgba(218,198,255,.4),rgba(138,168,251,.13) 40%,transparent 75%); filter: blur(8px); animation: flash .62s ease-out .28s forwards; }

    .success {
      position: fixed; z-index: 20; inset: 0;
      display: none; place-items: center; padding: 25px;
      background: radial-gradient(ellipse 70% 42% at 50% 37%,rgba(62,64,144,.3),transparent), #090c1d;
      text-align: center;
    }
    .success.is-visible { display: grid; animation: successIn .75s ease both; }
    .success-content { width: min(100%, 400px); }
    .success-mark { display: grid; place-items: center; width: 83px; height: 83px; border: 1px solid #b8aafa66; border-radius: 50%; margin: 0 auto 28px; background: radial-gradient(circle at 30% 20%,#4c437f,#1e2850); box-shadow: 0 0 0 15px rgba(144,132,255,.055),0 0 80px rgba(137,127,255,.21),inset 0 2px 3px rgba(255,255,255,.1); color: #dddbff; }
    .success-mark svg { width: 37px; height: 37px; }
    .success-label { color: #b8aaff; font-size: 11px; font-weight: 800; letter-spacing: .15em; }
    .success h2 { margin: 14px 0 12px; font-size: clamp(27px, 7.5vw, 37px); letter-spacing: -.07em; line-height: 1.32; }
    .success p { font-size: 13px; line-height: 1.8; color: #a5abc9; }
    .success-summary { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 17px; padding: 11px 17px; border: 1px solid rgba(193,196,246,.12); border-radius: 14px; background: rgba(170,167,255,.07); color: #d8dcf5; font-size: 12px; }
    .again { width: min(100%,320px); height: 50px; margin-top: 31px; border: 1px solid rgba(200,195,255,.4); border-radius: 14px; background: rgba(188,172,255,.13); color: #f0ebff; font-size: 13px; font-weight: 750; cursor: pointer; }
    .success-note { margin-top: 16px; font-size: 10px !important; color: #777e9d !important; }

    @keyframes blink { to { opacity: .07; transform: scale(.6); } }
    @keyframes drift { to { transform: translate(110px,70px) scale(1.15); } }
    @keyframes aura { from { opacity: .5; transform: scale(.86); } to { opacity: 1; transform: scale(1.14); } }
    @keyframes passIn { from { opacity: 0; transform: translateY(40px) scale(.82) rotateX(12deg); filter: blur(6px) drop-shadow(0 15px 26px #0005); } to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0) drop-shadow(0 20px 25px #0007); } }
    @keyframes sheen { 0%, 20% { transform: translateX(-180%) rotate(23deg); } 45%,100% { transform: translateX(640%) rotate(23deg); } }
    @keyframes spark-flight { 0% { transform: translate(0,0) scale(1); opacity: .95; } 100% { transform: translate(var(--dx),var(--dy)) scale(.08); opacity: 0; } }
    @keyframes flash { 0% { transform: translate(-50%,-50%) scale(.2); opacity: 0; } 45% { opacity: .9; } 100% { transform: translate(-50%,-50%) scale(2.5); opacity: 0; } }
    @keyframes successIn { from { opacity: 0; } to { opacity: 1; } }

    @media (max-height: 460px) and (min-width: 700px) { .sheet.is-open { height: 97dvh; } .badge-stage { flex: 0 0 auto; min-height: 278px; } .sheet .pass-shell { width: 185px; } }
    @media (max-height: 720px) {
      .layout { padding-top: 18px; }
      .hero { padding-top: 24px; }
      .hero h1 { font-size: 28px; }
      .section-title { margin-top: 21px; }
      .sheet.is-open { height: min(95dvh, 810px); }
      .sheet-grab { min-height: 40px; }
      .grab-line { margin-top: 8px; margin-bottom: 5px; }
      .preview-copy { margin-bottom: 5px; }
      .preview-copy h3 { font-size: 18px; line-height: 1.32; margin-top: 3px; }
      .sheet-top { padding-bottom: 7px; }
      .preview-hint { margin: 5px 0 8px; }
    }
    @media (min-width: 700px) {
      .layout { padding-top: 45px; }
      .hero { padding-top: 64px; }
      .sheet { border-left: 1px solid rgba(226,220,255,.16); border-right: 1px solid rgba(226,220,255,.16); }
      .sheet.is-open { height: min(88dvh,790px); }
      .pass-shell { width: min(270px, calc((100dvh - 340px) * .72)); }
    }
    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
      .pass-shell { transform: none !important; }
    }

/* SVG personalization: one coordinate system; no object-fit cropping. */

.form-error { margin: 0; color: #ffc0d5; font-size: 12px; line-height: 1.6; }
.form-error:not(:empty) { margin-top: 14px; }
.text-input[aria-invalid="true"] { border-color: #ffc0d5; }
.pass-shell { aspect-ratio: 950 / 1220; width: clamp(165px, min(64vw, calc((100dvh - 340px) * .779)), 275px); }
.pass-inner { aspect-ratio: 950 / 1220; height: auto; }
.pass-art { width: 100%; height: auto; aspect-ratio: 950 / 1220; object-fit: contain; }
.personalization { position: absolute; inset: 0; display: block; width: 100%; height: 100%; fill: #e2dffd; font-family: inherit; pointer-events: none; }
.pass-shell[data-design="light"] .personalization { fill: #2e3488; }
.demo-mark { letter-spacing: 10px; }

.preview-full { flex-shrink: 1; }
.badge-stage { flex: 1 0 auto; min-height: min-content; }
.preview-copy, .preview-hint { flex-shrink: 0; }
.preview-hint { text-align: center; }
.preview-copy h3, .success h2, .success-summary { overflow-wrap: anywhere; }
.demo-note { color: #a2aacb; }
.success { overflow-y: auto; overscroll-behavior: contain; }
.success-content { margin: auto; padding: 20px 0; }
.sheet-grab:focus-visible { outline: 2px solid #bda5ff; outline-offset: -4px; border-radius: 12px; }
#successTitle:focus { outline: none; }
@media (min-width: 700px) { .pass-shell { width: min(270px, max(165px, calc((100dvh - 340px) * .779))); } }
@media (max-height: 520px) {
  .sheet { --sheet-peek: 92px; }
  .layout { padding-bottom: calc(120px + var(--safe-bottom)); }
  .sheet.is-open { height: 97dvh; }
  .badge-stage { min-height: 232px; flex: 0 0 auto; }
  .sheet .pass-shell { width: 175px; }
  .preview-full { padding-left: 18px; padding-right: 18px; }
  .success-mark { width: 60px; height: 60px; margin-bottom: 16px; }
  .success h2 { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .orb, .float-stars, .pass-glint { display: none; }
  .sheet, .pass-shell, .badge-stage::before, .success { animation: none !important; transition: none !important; }
}

