:root {
  --black: #000000;
  --navy: #00050f;
  --navy-light: #03142d;
  --panel: rgba(0, 8, 23, .92);
  --panel-soft: #061326;
  --gold: #ccaa35;
  --gold-dark: #946113;
  --gold-light: #ceb697;
  --white: #ffffff;
  --muted: #a8aab2;
  --line: rgba(206, 182, 151, .24);
  --danger: #ff8b82;
}

@font-face {
  font-family: "Montserrat";
  src: url("/montserrat-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
::selection { color: var(--white); background: rgba(204, 170, 53, .42); }
html { min-height: 100%; background: var(--black); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--white);
  background:
    linear-gradient(110deg, rgba(0, 5, 15, .95) 8%, rgba(0, 5, 15, .72) 54%, rgba(0, 18, 43, .45)),
    url("/primex-theme-bg.png") center / cover fixed no-repeat,
    var(--navy);
  font-family: "Montserrat", "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.login-shell { width: min(1120px, calc(100% - 40px)); min-height: 100vh; margin: auto; display: grid; place-items: center; padding: 36px 0; }
.login-card { width: 100%; }
.brand-row { min-height: 56px; margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; }
.brand img { display: block; width: auto; height: 46px; object-fit: contain; }
.install-action { min-height: 42px; padding: 0 16px; border: 1px solid rgba(204,170,53,.45); display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; color: var(--white); background: rgba(0,5,15,.78); box-shadow: 0 8px 26px rgba(0,0,0,.24); backdrop-filter: blur(14px); font-size: 12px; font-weight: 700; cursor: pointer; }
.install-action svg { width: 16px; }

.login-grid { overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 390px; border: 1px solid rgba(255,255,255,.12); border-radius: 22px; background: rgba(0,5,15,.94); box-shadow: 0 30px 90px rgba(0,0,0,.5), inset 0 0 60px rgba(0,73,159,.08); backdrop-filter: blur(18px); }
.form-column { padding: clamp(34px, 6vw, 68px); }
.eyebrow { margin: 0 0 10px; color: var(--gold); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(38px, 5vw, 62px); font-weight: 600; line-height: 1; letter-spacing: -.055em; }
.intro { margin: 14px 0 34px; color: var(--muted); font-size: 14px; line-height: 1.6; }

.form-error { margin: 0 0 22px; padding: 12px 14px; border: 1px solid #71342f; border-radius: 14px; display: flex; align-items: center; gap: 10px; color: var(--danger); background: rgba(67,18,16,.74); font-size: 12px; line-height: 1.45; }
.form-error svg { flex: 0 0 auto; width: 18px; }
.field { display: block; margin: 0 0 20px; }
.field > span:first-child { display: block; margin: 0 0 8px; color: #d8d5cd; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.input-wrap { min-height: 54px; padding: 0 14px; border: 1px solid rgba(206,182,151,.28); border-radius: 15px; display: flex; align-items: center; gap: 11px; background: rgba(0,0,0,.42); transition: border-color .2s, box-shadow .2s, background .2s; }
.input-wrap:focus-within { border-color: var(--gold); background: rgba(3,20,45,.72); box-shadow: 0 0 0 3px rgba(204,170,53,.11); }
.input-wrap > svg { flex: 0 0 auto; width: 18px; color: #77736a; }
.input-wrap input { width: 100%; min-width: 0; height: 52px; padding: 0; border: 0; outline: 0; color: var(--white); background: transparent; font-size: 15px; }
.input-wrap input::placeholder { color: #68665f; }
.input-wrap input:-webkit-autofill,
.input-wrap input:-webkit-autofill:hover,
.input-wrap input:-webkit-autofill:focus,
.input-wrap input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--white) !important;
  caret-color: var(--white);
  -webkit-box-shadow: 0 0 0 1000px #050b15 inset !important;
  box-shadow: 0 0 0 1000px #050b15 inset !important;
}
.input-wrap input:autofill { color: var(--white) !important; background-color: #050b15 !important; }
.password-toggle { width: 38px; height: 38px; flex: 0 0 auto; border: 0; display: grid; place-items: center; color: #8e8b82; background: transparent; cursor: pointer; }
.password-toggle .eye-off { display: none; }
.password-toggle.is-visible .eye-on { display: none; }
.password-toggle.is-visible .eye-off { display: block; }

.form-links { margin: -1px 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: var(--muted); font-size: 12px; }
.form-links a, .register a { color: var(--gold-light); text-decoration: none; }
.form-links a:hover, .register a:hover { text-decoration: underline; }
.remember { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.remember input { width: 15px; height: 15px; margin: 0; accent-color: var(--gold); }
.login-button { width: 100%; min-height: 54px; padding: 0 20px; border: 0; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 11px; color: #fff; background: radial-gradient(circle at center, var(--gold) 0%, var(--gold-dark) 100%); font-weight: 800; cursor: pointer; box-shadow: 0 12px 30px rgba(148,97,19,.3); transition: transform .2s, filter .2s; }
.login-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.login-button:disabled { opacity: .7; cursor: wait; transform: none; }
.login-button svg { width: 17px; stroke-width: 2.2; }
.register { margin: 20px 0 0; color: var(--muted); text-align: center; font-size: 12px; }

.security-note { margin-top: 31px; padding-top: 23px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 13px; }
.shield { width: 39px; height: 39px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(204,170,53,.42); border-radius: 13px; color: var(--gold); background: rgba(204,170,53,.08); }
.shield svg { width: 20px; }
.security-note > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.security-note strong { font-size: 11px; letter-spacing: .03em; }
.security-note small { max-width: 470px; color: #77756e; font-size: 10px; line-height: 1.45; }

.member-panel { position: relative; overflow: hidden; padding: 48px 38px; border-left: 1px solid var(--line); background: radial-gradient(circle at 75% 18%, rgba(0,92,201,.3), transparent 38%), linear-gradient(155deg, rgba(3,20,45,.98), rgba(0,5,15,.98) 68%); }
.member-panel::before { content: ""; position: absolute; width: 240px; height: 240px; top: -120px; right: -90px; border: 1px solid rgba(204,170,53,.2); border-radius: 50%; box-shadow: 0 0 0 38px rgba(204,170,53,.035), 0 0 0 76px rgba(204,170,53,.02); }
.panel-kicker { position: relative; color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.member-panel h2 { position: relative; margin: 20px 0 18px; font-size: 35px; line-height: 1.08; letter-spacing: -.045em; }
.member-panel h2 em { color: var(--gold-light); font-style: normal; }
.member-panel > p { position: relative; margin: 0 0 34px; color: #939087; font-size: 13px; line-height: 1.65; }
.member-panel ul { position: relative; margin: 0; padding: 0; list-style: none; }
.member-panel li { min-height: 52px; border-bottom: 1px solid rgba(206,182,151,.17); display: flex; align-items: center; gap: 15px; }
.member-panel li span { color: var(--gold); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.member-panel li strong { color: #dad7ce; font-size: 12px; }
.panel-mark { position: absolute; right: -12px; bottom: -38px; color: rgba(201,162,78,.04); font-size: 150px; font-weight: 900; letter-spacing: -.13em; pointer-events: none; }

.install-help { position: fixed; z-index: 50; inset: 0; padding: 18px; display: grid; place-items: center; background: rgba(0,0,0,.78); backdrop-filter: blur(6px); }
.install-help[hidden] { display: none; }
.install-help > div { position: relative; width: min(370px, 100%); padding: 30px; border: 1px solid rgba(204,170,53,.36); border-radius: 24px; background: var(--navy); text-align: center; box-shadow: 0 24px 70px rgba(0,0,0,.55); }
.install-help [data-close-install]:first-child { position: absolute; right: 10px; top: 9px; width: 38px; height: 38px; border: 0; color: #aaa79f; background: transparent; font-size: 27px; cursor: pointer; }
.app-mark { width: 52px; height: 52px; margin: 0 auto 17px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: radial-gradient(circle at center, var(--gold), var(--gold-dark)); font-weight: 900; }
.install-help h2 { margin: 0; font-size: 24px; }
.install-help p { margin: 12px 0 22px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.help-button { width: 100%; min-height: 48px; border: 0; border-radius: 999px; color: #fff; background: radial-gradient(circle at center, var(--gold), var(--gold-dark)); font-weight: 800; cursor: pointer; }

@keyframes login-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes login-drift {
  from { background-position: 48% center; }
  to { background-position: 52% center; }
}
@keyframes login-glow {
  0%, 100% { box-shadow: 0 12px 30px rgba(148,97,19,.24); }
  50% { box-shadow: 0 14px 38px rgba(204,170,53,.38); }
}
@keyframes install-nudge {
  0%, 72%, 100% { transform: translateY(0); }
  82% { transform: translateY(2px); }
}

body { animation: login-drift 18s ease-in-out infinite alternate; }
.brand-row { animation: login-rise .4s ease-out backwards; }
.login-grid { animation: login-rise .48s .06s ease-out backwards; }
.field:nth-of-type(1) { animation: login-rise .4s .12s ease-out backwards; }
.field:nth-of-type(2) { animation: login-rise .4s .18s ease-out backwards; }
.login-button { animation: login-rise .4s .24s ease-out backwards, login-glow 3s 1s ease-in-out infinite; }
.login-button:active { transform: scale(.985); }
.input-wrap > svg, .password-toggle { transition: color .2s ease, transform .2s ease; }
.input-wrap:focus-within > svg { color: var(--gold); transform: translateY(-1px); }
.install-action svg { animation: install-nudge 2.8s ease-in-out infinite; }

@media (max-width: 820px) {
  .login-shell { width: min(100% - 24px, 520px); padding: 15px 0 24px; }
  .brand-row { margin-bottom: 12px; }
  .brand img { height: 35px; }
  .login-grid { display: block; }
  .form-column { padding: 30px 24px; }
  .member-panel { display: none; }
}

@media (max-width: 480px) {
  .login-shell { width: 100%; padding: max(11px, env(safe-area-inset-top)) 0 0; align-items: start; }
  .login-card { width: 100%; }
  .brand-row { min-height: 50px; padding: 0 18px; }
  .brand img { height: 31px; }
  .install-action { min-height: 38px; padding: 0 11px; font-size: 10px; }
  .login-shell { width: calc(100% - 20px); }
  .login-grid { border-radius: 18px; }
  .form-column { padding: 26px 20px 27px; }
  h1 { font-size: 35px; }
  .intro { margin: 11px 0 25px; }
  .form-links { align-items: flex-start; }
  .member-panel { padding: 29px 20px 36px; }
}

@media (display-mode: standalone) {
  .install-action { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

.form-success { margin: 0 0 24px; padding: 14px 16px; border: 1px solid rgba(69, 201, 164, .36); border-radius: 14px; background: rgba(32, 123, 101, .13); color: #bdf5df; font-size: 13px; line-height: 1.6; }
.register-signin { padding: 10px 16px; border: 1px solid var(--line); border-radius: 999px; color: var(--gold-light); text-decoration: none; font-size: 12px; font-weight: 800; }
.register-grid .form-column { padding-block: clamp(26px, 4vw, 48px); }
.register-grid h1 { font-size: clamp(34px, 4vw, 52px); }
.register-grid .intro { margin-bottom: 24px; }
.register-grid .field { margin-bottom: 14px; }
.register-grid .field em { margin-left: 5px; color: var(--muted); font-style: normal; font-weight: 500; letter-spacing: 0; text-transform: none; }
.register-hint { margin: -1px 0 19px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.coupon-preview { min-height: 13px; margin: -7px 0 12px; color: #f1d17c; font-size: 11px; line-height: 1.4; }
.register-resend { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.register-resend .field { margin-bottom: 10px; }
.register-resend button { width: 100%; min-height: 42px; border: 1px solid rgba(204, 170, 53, .45); border-radius: 12px; color: var(--gold-light); background: rgba(204, 170, 53, .08); font-size: 11px; font-weight: 800; cursor: pointer; }
.register-resend button:hover { background: rgba(204, 170, 53, .17); }
.register-grid .member-panel { display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 820px) { .register-grid .member-panel { display: none; } }
