/* =========================================================
   Revomart registration — aligned with root homepage visual system
   Marketplace → Trust → Vault
   ========================================================= */

:root {
  --rg-navy: #0e1a2b;
  --rg-navy-mid: #162538;
  --rg-ink: #121820;
  --rg-muted: #5c6b7a;
  --rg-line: #e4e9ef;
  --rg-line-soft: rgba(255, 255, 255, 0.14);
  --rg-fog: #f4f6f8;
  --rg-paper: #fbfcfd;
  --rg-surface: #ffffff;
  --rg-gold: #b8944f;
  --rg-gold-soft: #c9a86a;
  --rg-danger: #9b2c2c;
  --rg-danger-bg: #fdecec;
  --rg-success: #1f6b45;
  --rg-success-bg: #e8f6ee;
  --rg-sans: "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --rg-serif: "IBM Plex Serif", "Songti SC", "Noto Serif SC", Georgia, serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body.rg-page {
  margin: 0;
  color: var(--rg-ink);
  background: var(--rg-paper);
  font-family: var(--rg-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.rg-hidden {
  display: none !important;
}

/* ---------- Shell ---------- */
.rg-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(420px, 1.08fr);
}

/* ---------- Brand panel ---------- */
.rg-brand {
  position: relative;
  min-height: 100vh;
  color: #fff;
  background:
    linear-gradient(165deg, rgba(14, 26, 43, 0.88) 0%, rgba(14, 26, 43, 0.72) 45%, rgba(22, 37, 56, 0.9) 100%),
    url("/images/home/towers.jpg") center / cover no-repeat,
    linear-gradient(160deg, #0e1a2b 0%, #162538 55%, #1b2430 100%);
  overflow: hidden;
}

.rg-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 82%);
  pointer-events: none;
}

.rg-brand-inner {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 40px 48px 36px;
}

.rg-brand-top {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.rg-mark {
  width: 44px;
  height: 44px;
  border-radius: 0;
  display: block;
  background: none;
  border: 0;
  padding: 0;
  object-fit: contain;
}

.rg-brand-text strong {
  display: block;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.rg-brand-text span {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.62);
}

.rg-brand-main {
  margin-top: 14vh;
  max-width: 440px;
}

.rg-kicker {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rg-gold-soft);
}

.rg-brand-main h1 {
  margin: 0 0 18px;
  font-family: var(--rg-serif);
  font-size: clamp(32px, 3.6vw, 44px);
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.02em;
}

.rg-brand-main h1 em {
  font-style: normal;
  color: var(--rg-gold-soft);
}

.rg-brand-lead {
  margin: 0;
  font-size: 16px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.78);
}

.rg-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.88);
}

.rg-chain i {
  font-style: normal;
  color: var(--rg-gold-soft);
  opacity: 0.9;
}

.rg-chain-labels {
  margin-top: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.02em;
}

.rg-brand-foot {
  margin-top: auto;
  padding-top: 32px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.42);
}

/* ---------- Form panel ---------- */
.rg-form-panel {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 36px 48px;
  background:
    linear-gradient(180deg, #eef1f5 0%, var(--rg-fog) 120px, var(--rg-paper) 100%);
}

.rg-form-shell {
  width: 100%;
  max-width: 560px;
}

.rg-top-link {
  text-align: right;
  margin: 0 4px 18px;
  font-size: 14px;
  color: var(--rg-muted);
}

.rg-top-link a {
  margin-left: 6px;
  color: var(--rg-navy);
  font-weight: 700;
}

.rg-top-link a:hover {
  color: var(--rg-gold);
}

.rg-card {
  background: var(--rg-surface);
  border: 1px solid var(--rg-line);
  border-radius: 14px;
  padding: 32px 32px 28px;
  box-shadow: 0 18px 48px rgba(14, 26, 43, 0.06);
}

.rg-card-header {
  margin-bottom: 22px;
}

.rg-card-header .rg-kicker {
  color: var(--rg-gold);
}

.rg-card-header h2 {
  margin: 0 0 10px;
  font-family: var(--rg-serif);
  font-size: clamp(26px, 3vw, 32px);
  font-weight: 600;
  color: var(--rg-navy);
  line-height: 1.25;
}

.rg-card-header p {
  margin: 0;
  font-size: 15px;
  color: var(--rg-muted);
  line-height: 1.7;
}

.rg-invite-context {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(184, 148, 79, 0.35);
  background: rgba(184, 148, 79, 0.08);
  color: #5a4a28;
  font-size: 13px;
  line-height: 1.55;
}

.rg-invite-context[hidden] {
  display: none !important;
}

.rg-invite-context span {
  display: block;
  margin-top: 4px;
  opacity: 0.9;
}

.rg-invite-context a {
  color: var(--rg-navy);
  font-weight: 700;
}

/* ---------- Messages ---------- */
.rg-message {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 600;
}

.rg-message.is-error {
  display: block;
  background: var(--rg-danger-bg);
  color: var(--rg-danger);
  border: 1px solid #f0c9c9;
}

.rg-message.is-success {
  display: block;
  background: var(--rg-success-bg);
  color: var(--rg-success);
  border: 1px solid #bfe0cc;
}

/* ---------- Path selector ---------- */
.rg-paths {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.rg-path {
  position: relative;
  display: block;
}

.rg-path input[name="startPath"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rg-path-body {
  display: block;
  padding: 18px 18px 16px;
  border: 1px solid var(--rg-line);
  border-radius: 12px;
  background: var(--rg-paper);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.rg-path:hover .rg-path-body {
  border-color: #cfd7e1;
}

.rg-path-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
}

.rg-path-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--rg-gold);
  margin-bottom: 8px;
}

.rg-path-body h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--rg-navy);
}

.rg-path-body > p {
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: var(--rg-muted);
}

.rg-path-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--rg-muted);
}

.rg-path-indicator {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 50%;
  border: 1.5px solid #c5ced8;
  background: #fff;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.rg-path input[name="startPath"]:checked + .rg-path-body,
.rg-path.is-active .rg-path-body {
  border-color: rgba(184, 148, 79, 0.65);
  background: linear-gradient(180deg, #fff 0%, #faf7f1 100%);
  box-shadow: 0 0 0 3px rgba(184, 148, 79, 0.1);
}

.rg-path input[name="startPath"]:checked + .rg-path-body .rg-path-indicator,
.rg-path.is-active .rg-path-indicator {
  border-color: var(--rg-gold);
  background: var(--rg-gold);
  box-shadow: inset 0 0 0 4px #fff;
}

.rg-path input[name="startPath"]:focus-visible + .rg-path-body {
  outline: 2px solid var(--rg-gold);
  outline-offset: 2px;
}

/* Marketplace path: radio is sibling; body is following div */
.rg-path.is-marketplace input[name="startPath"]:checked ~ .rg-path-body,
.rg-path.is-marketplace.is-active .rg-path-body {
  border-color: rgba(184, 148, 79, 0.65);
  background: linear-gradient(180deg, #fff 0%, #faf7f1 100%);
  box-shadow: 0 0 0 3px rgba(184, 148, 79, 0.1);
}

/* Nested Marketplace roles */
.rg-mp-roles {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(228, 233, 239, 0.95);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.28s ease, opacity 0.2s ease, margin 0.2s ease, padding 0.2s ease;
}

.rg-path.is-marketplace.is-active .rg-mp-roles {
  max-height: 220px;
  opacity: 1;
}

.rg-mp-label {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rg-gold);
}

.rg-mp-options {
  display: grid;
  gap: 8px;
}

.rg-mp-option {
  position: relative;
  display: block;
  cursor: pointer;
}

.rg-mp-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rg-mp-option span {
  display: block;
  padding: 12px 14px;
  border: 1px solid var(--rg-line);
  border-radius: 8px;
  background: #fff;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.rg-mp-option strong {
  display: block;
  font-size: 14px;
  color: var(--rg-navy);
  margin-bottom: 2px;
}

.rg-mp-option em {
  font-style: normal;
  font-size: 12px;
  color: var(--rg-muted);
}

.rg-mp-option input:checked + span {
  border-color: var(--rg-navy);
  background: #f4f6f8;
}

.rg-path:not(.is-active) .rg-mp-option {
  pointer-events: none;
}

/* ---------- Fields ---------- */
.rg-field {
  margin-bottom: 16px;
}

.rg-field label {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 700;
  color: var(--rg-navy);
}

.rg-req {
  margin-left: 4px;
  color: var(--rg-gold);
}

.rg-input-wrap {
  position: relative;
}

.rg-input-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 72px 0 14px;
  border: 1px solid var(--rg-line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--rg-ink);
  font-size: 15px;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.rg-input-wrap input:focus {
  outline: none;
  border-color: rgba(184, 148, 79, 0.7);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(184, 148, 79, 0.12);
}

.rg-toggle-pw {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--rg-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
}

.rg-toggle-pw:hover {
  color: var(--rg-navy);
}

.rg-submit {
  width: 100%;
  margin-top: 8px;
  appearance: none;
  border: 0;
  border-radius: 8px;
  min-height: 50px;
  padding: 0 20px;
  background: linear-gradient(180deg, #c4a36a, #a8843f);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.2s ease;
}

.rg-submit:hover:not(:disabled) {
  filter: brightness(1.05);
}

.rg-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.rg-agreement {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--rg-muted);
}

.rg-bottom-login {
  margin: 12px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--rg-muted);
}

.rg-bottom-login a {
  color: var(--rg-navy);
  font-weight: 700;
}

.rg-bottom-login a:hover {
  color: var(--rg-gold);
}

.rg-arch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--rg-line);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--rg-muted);
}

.rg-arch i {
  font-style: normal;
  color: var(--rg-gold);
}

.rg-arch-sub {
  margin: 6px 0 0;
  text-align: center;
  font-size: 12px;
  color: #8a96a4;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .rg-shell {
    grid-template-columns: 1fr;
  }

  .rg-brand {
    min-height: auto;
  }

  .rg-brand-inner {
    min-height: auto;
    padding: 28px 24px 32px;
  }

  .rg-brand-main {
    margin-top: 28px;
  }

  .rg-brand-foot {
    display: none;
  }

  .rg-form-panel {
    padding: 28px 20px 40px;
    align-items: flex-start;
  }

  .rg-card {
    padding: 26px 20px 22px;
  }
}

@media (max-width: 520px) {
  .rg-brand-main h1 {
    font-size: 28px;
  }

  .rg-path-body h3 {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rg-mp-roles,
  .rg-path-body,
  .rg-path-indicator {
    transition: none;
  }
}
