/*
 * NKI NFC — Approved design tokens
 *
 * SOT: docs/DESIGN_SYSTEM_SOT.md
 * Visual reference: ../welcome-mock.html — ONLY section[data-design-sot="welcome-content"]
 * plus shared page background/palette/typography (owner-approved, 2026-10-19).
 * Preview controls, badges, dialogs, and demo interactions outside the frame
 * are intentionally excluded and MUST NOT generate product design tokens.
 *
 * Use these tokens across Welcome, certificate, authentication, My Collection,
 * ownership/transfer flows. Do not fork palette/type/size values per page.
 * Ornamental one-off details may remain in page styles.
 */
:root {
  color-scheme: dark;

  /* Core palette — exact values from the approved Welcome Mock */
  --bg: #080908;
  --surface: #131310;
  --gold: #d8b875;
  --gold-light: #f3db9d;
  --gold-dark: #8d6c36;
  --text: #f7f0dc;
  --muted: #b1a58b;
  --muted-low: #817967;
  --line: rgba(206, 170, 105, .23);
  --sans: "LINE Seed Sans TH", Tahoma, system-ui, sans-serif;

  /* Reusable component colors and materials */
  --color-panel-border: rgba(204, 162, 93, .35);
  --color-panel-inset-border: rgba(204, 162, 93, .12);
  --color-action-primary-start: #bf974f;
  --color-action-primary-center: #f0d18a;
  --color-action-primary-end: #c09a56;
  --color-action-primary-text: #241a0b;
  --color-action-primary-border: #eac580;
  --color-action-secondary-text: #efd5a2;
  --color-action-secondary-bg: rgba(221, 180, 108, .05);
  --color-action-secondary-border: rgba(217, 177, 107, .67);
  --color-focus: var(--gold-light);

  /* Typography: only loaded families are Regular (400) and Bold (700) */
  --weight-regular: 400;
  --weight-bold: 700;
  --size-display: clamp(39px, 6vw, 54px);
  --size-display-mobile: 40px;
  --size-display-small: 35px;
  --size-subheading: clamp(19px, 3.4vw, 24px);
  --size-subheading-mobile: 19px;
  --size-subheading-small: 17px;
  --size-body: 14px;
  --size-description: 12px;
  --size-button: 14px;
  --size-eyebrow: 10px;

  /* Shared viewport-anchored GatewayFrame shell (Owner locked 2026-10-20). */
  --shell-edge: clamp(14px, 3.8vw, 29px);
  --shell-slot-gap: 6px;
  --shell-bottom-gap: 12px;
  --gateway-max-width: 550px;
  --gateway-content-inline: clamp(18px, 5vw, 39px);
  --member-dock-height: 68px;

  /* Layout: actual approved Welcome values, not a new spacing framework */
  --welcome-max-width: 550px;
  --welcome-desktop-padding-inline: clamp(25px, 6vw, 61px);
  --welcome-desktop-padding-top: 44px;
  --welcome-desktop-padding-bottom: 43px;
  --welcome-mobile-padding-inline: 25px;
  --welcome-mobile-padding-top: 30px;
  --welcome-mobile-padding-bottom: 31px;
  --welcome-small-padding-inline: 20px;
  --action-min-height: 57px;
  --action-gap: 12px;
  --action-radius: 3px;
  --panel-radius: 2px;
}

/* Shared production shell (top bar, stage, gateway frame) for Welcome/Login/Register,
 * plus Welcome content. Owner-approved visual reference; no preview-only styles. */
    *,*::before,*::after{box-sizing:border-box}
    html{min-height:100%;background:var(--bg)}
    body{margin:0;min-height:100svh;font-family:var(--sans);color:var(--text);background:var(--bg);
      background-image:radial-gradient(ellipse 68% 45% at 50% 25%,rgba(113,86,40,.20),transparent 72%),radial-gradient(ellipse 50% 30% at 50% 95%,rgba(97,73,35,.11),transparent 85%)}
    body::before{content:"";position:fixed;inset:0;pointer-events:none;opacity:.19;background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.79' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.17'/%3E%3C/svg%3E")}
    button{font:inherit}
    button:focus-visible,a:focus-visible{outline:2px solid var(--gold-light);outline-offset:4px}
    [hidden]{display:none!important}
    .stage{min-height:100svh;display:flex;flex-direction:column;align-items:center;position:relative;isolation:isolate;overflow:hidden}
    .stage::before,.stage::after{content:"";pointer-events:none;position:absolute;z-index:-1;width:720px;height:720px;border-radius:50%;border:1px solid rgba(179,136,71,.08);left:50%;transform:translateX(-50%)}
    .stage::before{top:-485px;box-shadow:0 0 0 85px rgba(179,136,71,.02),0 0 0 175px rgba(179,136,71,.015)}
    .stage::after{bottom:-655px}
    .topbar{width:min(1140px,100%);padding:29px clamp(20px,4vw,48px);display:flex;align-items:center;justify-content:space-between;gap:16px}
    .brandmark{display:flex;align-items:center;gap:13px}
    .brandmark svg{height:37px;width:37px;overflow:visible}
    .brandmark .wordmark{display:flex;flex-direction:column;gap:2px}
    .brandmark strong{font-size:12px;font-weight:700;letter-spacing:.22em;color:#ead6b2}
    .brandmark small{font-size:9px;letter-spacing:.24em;color:#96866b}
    .locale-segments{display:inline-flex;flex-shrink:0;align-items:center;gap:1px;padding:2px;border:1px solid var(--color-action-secondary-border);border-radius:var(--action-radius);background:var(--surface)}
    .locale-segment{font:inherit;font-size:11px;font-weight:var(--weight-bold);color:var(--color-action-secondary-text);background:transparent;cursor:pointer;border:0;border-radius:2px;min-height:32px;min-width:40px;padding:5px 8px}
    .locale-segment[aria-pressed="true"]{background:var(--color-action-primary-center);color:var(--color-action-primary-text)}
    .hero{width:100%;flex:1;display:flex;align-items:center;justify-content:center;padding:8px 18px 52px}
    .hero > div{width:100%;max-width:var(--welcome-max-width);position:relative}
    .gateway{width:min(100%,var(--welcome-max-width));position:relative;display:flex;flex-direction:column;justify-content:center;text-align:center;padding:var(--welcome-desktop-padding-top) var(--welcome-desktop-padding-inline) var(--welcome-desktop-padding-bottom);background:linear-gradient(155deg,rgba(33,30,24,.91),rgba(15,15,13,.98) 55%,rgba(30,25,18,.94));border:1px solid var(--color-panel-border);border-radius:var(--panel-radius);box-shadow:0 24px 90px rgba(0,0,0,.55),0 0 80px rgba(142,102,42,.07),inset 0 0 0 6px rgba(255,255,255,.009)}
    .gateway::before{content:"";position:absolute;inset:8px;border:1px solid var(--color-panel-inset-border);pointer-events:none}
    .corner{position:absolute;width:44px;height:44px;border-color:rgba(225,187,115,.72);pointer-events:none}
    .corner.tl{left:-1px;top:-1px;border-top:2px solid;border-left:2px solid}
    .corner.tr{right:-1px;top:-1px;border-top:2px solid;border-right:2px solid}
    .corner.bl{left:-1px;bottom:-1px;border-bottom:2px solid;border-left:2px solid}
    .corner.br{right:-1px;bottom:-1px;border-bottom:2px solid;border-right:2px solid}
    .seal-wrap{width:112px;height:112px;margin:0 auto 21px;display:grid;place-items:center;position:relative}
    .seal-wrap::before{content:"";position:absolute;inset:6px;border-radius:50%;border:1px solid rgba(216,184,117,.34)}
    .seal-wrap::after{content:"";position:absolute;inset:-3px;border-radius:50%;border:1px dashed rgba(216,184,117,.30);animation:rotate-slow 100s linear infinite}
    .seal-wrap svg{height:84px;width:84px;filter:drop-shadow(0 1px 17px rgba(216,184,117,.23))}
    @keyframes rotate-slow{to{transform:rotate(360deg)}}
    .eyebrow{font-size:var(--size-eyebrow);color:var(--gold);letter-spacing:.24em;font-weight:var(--weight-bold);margin:0 0 9px}
    h1{font-family:var(--sans);font-weight:var(--weight-bold);letter-spacing:-.025em;color:var(--gold-light);font-size:var(--size-display);line-height:1.35;margin:0 0 3px;text-shadow:0 2px 24px rgba(184,141,74,.22)}
    h2{font-family:var(--sans);font-weight:var(--weight-regular);letter-spacing:-.01em;font-size:var(--size-subheading);line-height:1.6;color:#f0e3c8;margin:2px -15px 0}
    .ornament{display:flex;justify-content:center;align-items:center;gap:15px;margin:22px auto 21px;color:var(--gold)}
    .ornament::before,.ornament::after{content:"";height:1px;width:92px;background:linear-gradient(90deg,transparent,#9a7947)}
    .ornament::after{transform:rotate(180deg)}
    .ornament svg{width:16px;height:16px;stroke:var(--gold);fill:none}
    .lead{color:#e4d4b5;font-weight:var(--weight-regular);font-size:var(--size-body);line-height:1.9;margin:0 0 8px}
    .support{color:var(--muted);font-weight:var(--weight-regular);font-size:var(--size-description);line-height:1.95;margin:0 auto;max-width:390px}
    .actions{margin:30px 0 0;display:flex;flex-direction:column;gap:12px}
    .action{border-radius:var(--action-radius);min-height:var(--action-min-height);padding:13px 17px;display:flex;align-items:center;justify-content:center;gap:var(--action-gap);cursor:pointer;font-weight:var(--weight-bold);line-height:1.5;font-size:var(--size-button);transition:background .16s ease,border-color .16s ease,transform .16s ease;position:relative}
    .action svg{height:17px;width:17px;position:absolute;right:18px;top:50%;transform:translateY(-50%);stroke-width:1.9}
    .action:active{transform:translateY(1px)}
    .action.primary{background:linear-gradient(118deg,var(--color-action-primary-start) 0%,var(--color-action-primary-center) 48%,var(--color-action-primary-end) 100%);border:1px solid var(--color-action-primary-border);color:var(--color-action-primary-text);box-shadow:0 3px 18px rgba(191,148,74,.18)}
    .action.primary:hover{background:linear-gradient(118deg,#d0a760,#f7dfa1,#cfa85e)}
    .action.secondary{color:var(--color-action-secondary-text);background:var(--color-action-secondary-bg);border:1px solid var(--color-action-secondary-border)}
    .action.secondary:hover{background:rgba(221,180,108,.13);border-color:#e9c787}
    .auth-prompt{font-size:12px;color:#b6a991;margin:18px 0 0}
    .auth-prompt button{color:#e2c68d;background:none;border:0;border-bottom:1px solid rgba(226,198,141,.55);cursor:pointer;padding:1px 2px;font-weight:700}
    .gateway-foot{display:flex;align-items:center;justify-content:center;gap:10px;margin:27px 0 0;color:#96866a;font-size:10px;letter-spacing:.12em}
    .gateway-foot::before,.gateway-foot::after{content:"";width:22px;height:1px;background:rgba(206,170,105,.31)}
    @media (max-width:640px){
      .topbar{padding:20px 21px}
      .locale-segment{min-width:34px;font-size:10px;padding:5px 6px}
      .brandmark .wordmark strong{font-size:10px}
      .brandmark .wordmark small{font-size:7px}
      .brandmark svg{height:32px;width:32px}
      .hero{padding:22px 15px 24px;align-items:center}
      .gateway{padding:var(--welcome-mobile-padding-top) var(--welcome-mobile-padding-inline) var(--welcome-mobile-padding-bottom)}
      .seal-wrap{width:90px;height:90px;margin-bottom:15px}
      .seal-wrap svg{width:68px;height:68px}
      .ornament{margin:14px auto 15px}
      h1{font-size:var(--size-display-mobile)}
      h2{font-size:var(--size-subheading-mobile)}
      .lead{font-size:13px}
      .support{font-size:12px}
      .actions{margin-top:23px}
      .gateway-foot{margin-top:23px}
    }
    @media (max-width:360px){
      .gateway{padding:26px var(--welcome-small-padding-inline)}
      .topbar{gap:7px;padding:17px 14px}
      .brandmark{gap:7px}
      .brandmark svg{height:29px;width:29px}
      .brandmark .wordmark strong{font-size:9px;letter-spacing:.09em}
      .brandmark .wordmark small{font-size:7px;letter-spacing:.10em}
      .locale-segment{min-width:31px;font-size:10px;padding:4px 4px}
      .seal-wrap{width:80px;height:80px}
      .seal-wrap svg{width:60px;height:60px}
      h1{font-size:var(--size-display-small)}
      h2{font-size:var(--size-subheading-small)}
      .support{font-size:11px}
      .action{font-size:13px}
    }
    @media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}
    .flow-status{font-size:12px;color:var(--gold-light);margin:12px 0 0;line-height:1.7}

/* Owner-locked NKI GatewayFrame: responsive background geometry, not content-sized.
 * Shared by Welcome, Login, Register, account views and all subsequent screens.
 * The decoration is outside the independently scrollable .gateway-content.
 */
.stage{height:100dvh;min-height:0;overflow:hidden}
.stage .topbar{
  width:min(1140px,100%);flex-shrink:0;
  padding:calc(var(--shell-edge) + env(safe-area-inset-top,0px))
          var(--shell-edge) 0;
}
.stage .hero,.stage.member-stage .account-main{
  display:flex;flex:1 1 0;min-height:0;min-width:0;width:100%;
  justify-content:center;align-items:stretch;
  overflow:hidden;
  padding:var(--shell-edge) var(--shell-edge) var(--shell-bottom-gap);
}
.stage .hero > div,.stage .account-layout{
  width:100%;height:100%;min-height:0;min-width:0;
  max-width:var(--gateway-max-width);position:relative;
  display:flex;flex-direction:column;margin:0 auto;
}
.stage .auth-back,.stage .account-back,.stage .frame-back-slot{
  flex:0 0 44px;height:44px;min-height:44px;
  width:max-content;max-width:100%;margin:0 0 var(--shell-slot-gap);
  align-items:center;
}
.stage .frame-back-slot{pointer-events:none}
.stage .gateway{
  flex:1 1 0;height:100%;max-height:100%;min-height:0;
  width:100%;max-width:100%;min-width:0;
  padding:0;display:flex;flex-direction:column;
  justify-content:stretch;align-items:stretch;
  text-align:left;overflow:hidden;
}
.stage .gateway-content{
  position:relative;z-index:1;
  flex:1 1 0;min-height:0;width:100%;min-width:0;
  display:flex;flex-direction:column;align-items:stretch;justify-content:safe center;
  overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;
  scrollbar-width:thin;scrollbar-color:var(--line) transparent;
  padding:clamp(14px,2.5vh,29px) var(--gateway-content-inline);
}
.stage .gateway[data-design-sot="welcome-content"] .gateway-content{text-align:center}
.stage .auth-gateway .gateway-content{text-align:left}
.stage .account-gateway .gateway-content{text-align:left}
.stage .collection-gateway .gateway-content{justify-content:flex-start}
.stage .dashboard-panel{min-height:0;text-align:center;justify-content:stretch;padding:0}
.stage .dashboard-panel .gateway-content{align-items:center;text-align:center}
.stage.member-stage{
  height:100dvh;min-height:0;overflow:hidden;
  padding-bottom:calc(var(--member-dock-height) + var(--shell-edge) + env(safe-area-inset-bottom,0px));
}
.stage.member-stage .account-main{overflow:hidden}
.stage .account-layout{margin:0 auto}
.stage .account-gateway{padding:0;min-height:0}
.stage .gateway .corner{z-index:2}
.stage .gateway::before{z-index:2}
.stage.member-stage .member-dock{
  width:min(calc(100% - 2 * var(--shell-edge)),var(--gateway-max-width));
  max-width:100%;min-width:0;
  left:50%;right:auto;transform:translateX(-50%);
  bottom:env(safe-area-inset-bottom,0px);
}
@media(max-width:640px){
  .stage .hero,.stage.member-stage .account-main{
    padding:var(--shell-edge) var(--shell-edge) var(--shell-bottom-gap);
  }
  .stage .gateway-content{padding:clamp(12px,2vh,20px) var(--gateway-content-inline)}
  .stage .auth-gateway .gateway-content{padding:clamp(12px,2vh,20px) var(--gateway-content-inline)}
}
@media(max-width:360px){
  .stage .gateway-content{padding:11px 15px}
  .stage .auth-gateway .gateway-content{padding:11px 15px}
}
/* Export tools uses the same shell/frame, but is not a signed-in member page. */
body:has(.tool-gateway){display:block;min-height:0;padding:0}
.stage .tool-layout{width:100%;height:100%;max-width:var(--gateway-max-width);min-height:0;display:flex;flex-direction:column}
.stage .tool-back{display:inline-flex;gap:7px;min-height:44px;color:var(--gold);font-size:12px;text-decoration:none}
.stage .tool-back svg{width:16px;height:16px;flex-shrink:0}
.stage .tool-gateway .gateway-content{justify-content:flex-start}
.stage .tool-gateway .panel{width:100%;max-width:100%;border:0;background:transparent;padding:0;margin:0}
