/* ============================================================================
   NOVA Markets — client access (login / register)
   Split layout: brand + story panel beside a focused form card.
   Fully token-driven (tokens.css) so light and dark both read correctly.
   Legacy --access-* custom properties are kept as token aliases so the inline
   <head> styles on login.html / register.html stay themed.
   ============================================================================ */

.access-page {
  --access-bg: var(--bg-0);
  --access-panel: var(--bg-1);
  --access-border: var(--border);
  --access-ink: var(--text-1);
  --access-muted: var(--text-2);
  --access-accent: var(--buy);
  background: var(--bg-0);
  color: var(--text-1);
  font-size: 16px;
}

/* ───────────────────────── layout shell ───────────────────────── */
.access-page .auth-main {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(400px, 468px);
  width: min(1240px, calc(100% - 80px));
  max-width: none;
  min-height: 720px;
  flex: 1;
  margin: 0 auto;
  padding: 72px 0 84px;
  gap: 72px;
  align-items: center;
  isolation: isolate;
}

/* ───────────────────────── story / brand panel ───────────────────────── */
.access-story {
  position: relative;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-width: 0;
  max-width: 600px;
  padding: 24px 0 0;
  isolation: isolate;
}
.access-eyebrow {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--buy-text);
  margin: 0 0 22px;
}
.access-story h2 {
  position: relative;
  z-index: 1;
  font-size: clamp(36px, 3.7vw, 52px);
  line-height: 1.08;
  font-weight: 680;
  letter-spacing: -.025em;
  max-width: 590px;
  margin: 0;
  color: var(--text-1);
  text-wrap: balance;
}
html[lang=ja] .access-story h2 {
  font-size: clamp(32px, 3.2vw, 46px);
  line-height: 1.4;
  letter-spacing: 0;
}
html[lang=ja] .access-story h2 .story-phrase { display: block; white-space: normal; }
.access-story > p {
  position: relative;
  z-index: 1;
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--text-2);
  max-width: 440px;
  margin: 22px 0 0;
}

.access-art {
  position: absolute;
  z-index: -1;
  display: block;
  width: calc(100% + 140px);
  max-width: none;
  height: 360px;
  object-fit: contain;
  left: -45px;
  top: 250px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  opacity: .9;
  pointer-events: none;
}
html[data-theme=light] .access-art {
  opacity: .62;
  -webkit-mask-image: radial-gradient(120% 120% at 40% 45%, #000 55%, transparent 100%);
          mask-image: radial-gradient(120% 120% at 40% 45%, #000 55%, transparent 100%);
}

.access-tools {
  display: flex;
  gap: 28px;
  margin-top: auto;
  padding-top: 380px;
  border: 0;
}
.access-tools div { flex: 1; min-width: 0; }
.access-tools strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 6px;
}
.access-tools span {
  display: block;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.7;
}
.access-watermark {
  margin-top: 30px;
  font-size: 11px;
  letter-spacing: .14em;
  font-weight: 500;
  color: var(--text-3);
}

/* ───────────────────────── form card ───────────────────────── */
.access-page .wrap-sm {
  max-width: none;
  padding: 0;
  width: 100%;
  margin: 0;
  position: relative;
  z-index: 1;
}
.access-page .auth-card {
  padding: clamp(28px, 2.4vw, 40px);
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
}
.access-page .auth-hd { margin-bottom: 28px; }
.access-page .auth-hd h1 {
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -.02em;
  font-weight: 650;
  margin: 0 0 10px;
  color: var(--text-1);
}
.access-page .auth-sub {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-2);
  margin: 0;
}

/* ───────────────────────── fields ───────────────────────── */
.access-page .fld { margin-bottom: 20px; }
.access-page .fld-lbl {
  font-size: 13.5px;
  font-weight: 540;
  color: var(--text-2);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.access-page .inp,
.access-page .sel {
  width: 100%;
  background: var(--bg-2);
  color: var(--text-1);
  border: 1px solid var(--border-strong);
  height: 50px;
  border-radius: var(--r-md);
  padding: 0 14px;
  font-size: 16px;
  line-height: 1.5;
  box-shadow: none;
}
.access-page .inp::placeholder { color: var(--text-4); }
.access-page .inp:hover,
.access-page .sel:hover { border-color: var(--text-4); }
.access-page .inp:focus,
.access-page .sel:focus {
  border-color: var(--focus);
  outline: none;
  box-shadow: 0 0 0 3px var(--selection);
}
.access-page .fld-help {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-3);
  margin-top: 7px;
  min-height: 0;
}
.access-page .req { color: var(--buy-text); font-weight: 600; }
.access-page .opt {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 400;
  margin-left: auto;
}

/* password reveal + strength meter */
.access-page .pw-eye { color: var(--text-3); }
.access-page .pw-eye:hover { color: var(--text-1); background: var(--bg-3); }
.access-page .pw-eye:focus-visible { outline: 2px solid var(--focus); }

/* ───────────────────────── submit + links ───────────────────────── */
.access-page .btn--primary {
  background: var(--buy);
  border-color: var(--buy);
  color: var(--on-buy);
  font-size: 15px;
  font-weight: 620;
  min-height: 52px;
  border-radius: var(--r-md);
  margin-top: 4px;
}
.access-page .btn--primary:hover {
  background: var(--buy-hover);
  border-color: var(--buy-hover);
  filter: none;
}
.access-page .btn--primary:disabled { opacity: .5; }
.access-page .spin { border-color: rgba(255, 255, 255, .5); border-top-color: #fff; }

.access-page .auth-alt {
  margin: 24px 0 0;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.8;
  text-align: center;
}
.access-page .auth-alt a,
.access-page .terms a,
.access-page .registration-policy a { color: var(--link); }

/* ───────────────────────── terms + validation + alert ───────────────────────── */
.access-page .terms {
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-2);
  margin: 10px 0 22px;
  align-items: flex-start;
  gap: 10px;
}
.access-page input[type=checkbox] { accent-color: var(--buy); flex-shrink: 0; }
.access-page .terms.is-invalid { color: var(--danger-text); }
.access-page .terms.is-invalid input[type=checkbox] { outline: 2px solid var(--danger-text); outline-offset: 2px; }

.access-page .alert {
  font-size: 13.5px;
  line-height: 1.7;
  border-radius: var(--r-md);
  margin-bottom: 20px;
}
.access-page .is-invalid .inp { border-color: var(--danger-text); }
.access-page .is-invalid .fld-help { color: var(--danger-text); }

.registration-policy {
  grid-column: 1 / -1;
  font-size: 12.5px;
  line-height: 1.9;
  text-align: center;
  color: var(--text-3);
  margin: 18px 0 0;
}
.registration-policy a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ───────────────────────── register: two-column form ───────────────────────── */
.access-register .auth-main { grid-template-columns: minmax(0, 1fr) minmax(430px, 512px); min-height: 820px; }
.access-register #form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.access-register #fld-name,
.access-register #fld-email,
.access-register .terms,
.access-register #submit,
.access-register .registration-policy { grid-column: 1 / -1; }
.access-register .fld { margin-bottom: 16px; }
.access-register .auth-hd { margin-bottom: 24px; }

/* ───────────────────────── responsive ───────────────────────── */
@media (max-width: 1100px) {
  .access-page .auth-main { gap: 44px; width: calc(100% - 64px); grid-template-columns: minmax(0, 1fr) minmax(380px, 440px); }
  .access-register .auth-main { grid-template-columns: minmax(0, 1fr) minmax(400px, 460px); }
  .access-art { left: -35px; width: calc(100% + 70px); height: 330px; top: 255px; }
  .access-tools { gap: 18px; padding-top: 350px; }
}

@media (max-width: 860px) {
  .access-page .auth-main,
  .access-register .auth-main {
    display: block;
    width: calc(100% - 40px);
    min-height: 0;
    padding: 40px 0 56px;
    overflow: clip;
  }
  .access-story { width: 100%; max-width: 560px; margin: 0 auto; padding: 0; min-height: 180px; }
  .access-eyebrow { margin-bottom: 14px; }
  .access-story h2,
  html[lang=ja] .access-story h2 { font-size: 28px; line-height: 1.35; max-width: 420px; }
  .access-story > p { max-width: 400px; font-size: 14px; margin-top: 14px; }
  .access-art {
    width: 260px; height: 210px; top: 0; left: auto; right: -30px; opacity: .16;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 35%);
            mask-image: linear-gradient(90deg, transparent, #000 35%);
  }
  html[data-theme=light] .access-art { opacity: .3; }
  .access-tools, .access-watermark { display: none; }
  .access-page .wrap-sm { max-width: 560px; margin: 24px auto 0; }
  .access-page .auth-card { padding: clamp(24px, 5vw, 34px); }
  .access-register #form { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 520px) {
  .access-story { min-height: 150px; }
  .access-story h2,
  html[lang=ja] .access-story h2 { font-size: 24px; max-width: 300px; }
  .access-story > p { max-width: 280px; }
  .access-art { right: -44px; width: 220px; height: 180px; opacity: .13; }
  .access-register #form { display: block; }
  .access-page .auth-hd h1 { font-size: 25px; }
  .access-page .auth-alt { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .access-page * { scroll-behavior: auto !important; transition: none !important; }
}
