/* ══════════════════════════════════════════════════════════════════════
   MNORY — Registration pages (/register/ and /register/affiliate/)
   Split card: gradient brand panel (matches the header) + form panel.
   Inputs need !important on bg/color/border: combined.css forces them.
   ══════════════════════════════════════════════════════════════════════ */

.rg {
  --rg-surface: #ffffff;
  --rg-soft: #f8fafc;
  --rg-border: #e2e8f0;
  --rg-text: #0f172a;
  --rg-muted: #64748b;
  --rg-brand: var(--mn-brand, #2563eb);
  --rg-brand-soft: rgba(37, 99, 235, .08);
  --rg-ring: rgba(37, 99, 235, .18);
  --rg-danger: #dc2626;
  --rg-radius: 24px;
  padding: 2.5rem 0 3.5rem;
  color: var(--rg-text);
}
body.dark-mode .rg {
  --rg-surface: #151a24;
  --rg-soft: #0f141d;
  --rg-border: #283245;
  --rg-text: #f1f5f9;
  --rg-muted: #94a3b8;
  --rg-brand: #60a5fa;
  --rg-brand-soft: rgba(96, 165, 250, .12);
  --rg-ring: rgba(96, 165, 250, .25);
  --rg-danger: #f87171;
}

.rg-card {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  max-width: 1080px;
  margin-inline: auto;
  background: var(--rg-surface);
  border: 1px solid var(--rg-border);
  border-radius: var(--rg-radius);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 24px 60px rgba(15, 23, 42, .08);
  overflow: hidden;
}
body.dark-mode .rg-card { box-shadow: 0 24px 60px rgba(0, 0, 0, .4); }

/* ── Brand panel ──────────────────────────────────────────────────── */
.rg-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding: 2.25rem 2rem;
  color: #fff;
  background: linear-gradient(160deg, #4f8bff 0%, var(--mn-brand, #2563eb) 45%, #000 100%);
  isolation: isolate;
}
.rg-aside::before {
  content: "";
  position: absolute;
  inset: auto -30% -20% auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .14), transparent 70%);
  z-index: -1;
}
.rg-aside-logo img { height: 42px; width: auto; display: block; }
.rg-aside-body { flex: 1; }
.rg-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  font-size: .78rem;
  font-weight: 700;
}
.rg-eyebrow .material-icons { font-size: 16px; }
.rg-aside .rg-aside-title {
  margin: 1rem 0 1.5rem;
  color: #fff;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.35;
}
.rg-benefits { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.rg-benefits li { display: flex; align-items: flex-start; gap: .75rem; font-size: .9rem; line-height: 1.55; color: rgba(255, 255, 255, .88); }
.rg-benefits li strong { color: #fff; }
.rg-benefits .material-icons {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .14);
  font-size: 18px;
}
.rg-stats { display: flex; gap: .75rem; margin-top: 1.75rem; }
.rg-stats > div {
  flex: 1;
  padding: .8rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, .1);
  text-align: center;
}
.rg-stats strong { display: block; font-size: 1.35rem; font-weight: 800; color: #fff; }
.rg-stats span { font-size: .76rem; color: rgba(255, 255, 255, .75); }
.rg-aside-foot {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0;
  font-size: .78rem;
  color: rgba(255, 255, 255, .7);
}
.rg-aside-foot .material-icons { font-size: 17px; }

/* ── Form panel ───────────────────────────────────────────────────── */
.rg-main { padding: 2.25rem 2.5rem 2rem; min-width: 0; }
.rg-head h1 { margin: 0; font-size: 1.6rem; font-weight: 800; color: var(--rg-text); }
.rg-head p { margin: .35rem 0 0; color: var(--rg-muted); font-size: .92rem; }
.rg-head + .rg-form { margin-top: 1.75rem; }

/* Account type switcher */
.rg-types {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
  margin: 1.5rem 0 1.75rem;
}
.rg-type {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .8rem .9rem;
  border: 1.5px solid var(--rg-border);
  border-radius: 16px;
  background: var(--rg-surface);
  color: var(--rg-text);
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.rg-type:hover { border-color: var(--rg-brand); color: var(--rg-text); }
.rg-type.active { border-color: var(--rg-brand); background: var(--rg-brand-soft); box-shadow: 0 0 0 3px var(--rg-ring); }
.rg-type-icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--rg-soft);
  color: var(--rg-brand);
  font-size: 21px;
  transition: background .15s ease, color .15s ease;
}
.rg-type.active .rg-type-icon { background: var(--rg-brand); color: #fff; }
.rg-type-text { display: flex; flex-direction: column; min-width: 0; }
.rg-type-text strong { font-size: .92rem; font-weight: 700; }
.rg-type-text small { color: var(--rg-muted); font-size: .76rem; line-height: 1.35; }
.rg-type-check {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 18px;
  color: var(--rg-brand);
  opacity: 0;
  transform: scale(.6);
  transition: opacity .15s ease, transform .15s ease;
}
.rg-type.active .rg-type-check { opacity: 1; transform: scale(1); }
[dir="rtl"] .rg-type-check { right: auto; left: 8px; }

/* When a type is chosen, the switcher compacts into a single row of chips */
.rg.has-type .rg-types { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1.5rem; }
.rg.has-type .rg-type { flex-direction: column; justify-content: center; gap: .35rem; padding: .7rem .4rem; text-align: center; }
.rg.has-type .rg-type-text small,
.rg.has-type .rg-type-check { display: none; }
.rg.has-type .rg-type-icon { width: 34px; height: 34px; font-size: 19px; border-radius: 10px; }
.rg.has-type .rg-type-text strong { font-size: .84rem; }

/* Sections */
.rg-section { margin: 0 0 1.5rem; padding: 0; border: 0; min-width: 0; }
.rg-section legend {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  margin-bottom: 1rem;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--rg-border);
  font-size: .95rem;
  font-weight: 700;
  color: var(--rg-text);
  float: none;
}
.rg-section legend .material-icons { font-size: 19px; color: var(--rg-brand); }

.rg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 1rem; }
.rg-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rg-full { grid-column: 1 / -1; }

/* Field */
.rg-field { display: flex; flex-direction: column; gap: .35rem; min-width: 0; }
.rg-field > label,
.rg-label {
  display: flex;
  align-items: center;
  gap: .3rem;
  margin: 0;
  font-size: .82rem;
  font-weight: 600;
  color: var(--rg-text);
  text-transform: none;
  letter-spacing: 0;
}
.rg-req { color: var(--rg-danger); }
.rg-opt { color: var(--rg-muted); font-weight: 500; font-size: .74rem; }
.rg-opt::before { content: "("; }
.rg-opt::after { content: ")"; }

.rg-control { position: relative; }
.rg .rg-control input,
.rg .rg-control select,
.rg .rg-control textarea {
  width: 100%;
  min-height: 46px;
  padding: .65rem .9rem;
  border: 1.5px solid var(--rg-border) !important;
  border-radius: 12px !important;
  background: var(--rg-soft) !important;
  color: var(--rg-text) !important;
  font-size: .92rem;
  box-shadow: none !important;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.rg .rg-control textarea { min-height: 96px; resize: vertical; line-height: 1.6; }
.rg .rg-control select { background-position: left .9rem center; }
[dir="ltr"] .rg .rg-control select { background-position: right .9rem center; }
.rg .rg-control input::placeholder,
.rg .rg-control textarea::placeholder { color: var(--rg-muted); opacity: .7; }
.rg .rg-control input:focus,
.rg .rg-control select:focus,
.rg .rg-control textarea:focus {
  outline: 0;
  border-color: var(--rg-brand) !important;
  background: var(--rg-surface) !important;
  box-shadow: 0 0 0 4px var(--rg-ring) !important;
}
/* Physical padding: LTR-forced inputs (email, phone…) would otherwise put
   their logical padding on the wrong side of the icon in RTL. */
.rg .rg-control.has-icon input,
.rg .rg-control.has-icon select { padding-left: 2.6rem; }
.rg .rg-control.has-toggle input { padding-right: 2.8rem; }
[dir="rtl"] .rg .rg-control.has-icon input,
[dir="rtl"] .rg .rg-control.has-icon select { padding-left: .9rem; padding-right: 2.6rem; }
[dir="rtl"] .rg .rg-control.has-toggle input { padding-left: 2.8rem; }
.rg .rg-control.is-ltr input { direction: ltr; }
[dir="rtl"] .rg .rg-control.is-ltr input { text-align: right; }
[dir="rtl"] .rg .rg-control.is-ltr input:not(:placeholder-shown) { text-align: left; }

/* Physical left/right, not inset-inline-*: .material-icons forces direction:ltr,
   so logical insets on the icon itself would always resolve to the left. */
.rg-control-icon {
  position: absolute;
  top: 50%;
  left: .85rem;
  transform: translateY(-50%);
  font-size: 19px;
  color: var(--rg-muted);
  pointer-events: none;
  transition: color .15s ease;
}
.rg-control:focus-within .rg-control-icon { color: var(--rg-brand); }
[dir="rtl"] .rg-control-icon { left: auto; right: .85rem; }

.rg .rg-eye {
  position: absolute;
  top: 50%;
  inset-inline-end: .4rem;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0 !important;
  border-radius: 10px;
  background: transparent !important;
  color: var(--rg-muted);
  cursor: pointer;
}
.rg .rg-eye:hover { color: var(--rg-brand); background: var(--rg-brand-soft) !important; }
.rg-eye .material-icons { font-size: 19px; }

.rg-hint { color: var(--rg-muted); font-size: .76rem; line-height: 1.45; }
.rg-error { display: flex; align-items: flex-start; gap: .3rem; color: var(--rg-danger); font-size: .78rem; line-height: 1.45; }
.rg-error .material-icons { font-size: 15px; margin-top: 1px; }
.rg .has-error .rg-control input,
.rg .has-error .rg-control select,
.rg .has-error .rg-control textarea { border-color: var(--rg-danger) !important; }

/* Password strength */
.rg-strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.rg-strength span { height: 4px; border-radius: 4px; background: var(--rg-border); transition: background .2s ease; }
.rg-strength[data-score="1"] span:nth-child(-n+1) { background: #ef4444; }
.rg-strength[data-score="2"] span:nth-child(-n+2) { background: #f59e0b; }
.rg-strength[data-score="3"] span:nth-child(-n+3) { background: #84cc16; }
.rg-strength[data-score="4"] span { background: #10b981; }

/* Upload */
.rg-upload {
  position: relative;
  display: flex;
  align-items: center;
  gap: .9rem;
  margin: 0;
  padding: .75rem;
  border: 1.5px dashed var(--rg-border);
  border-radius: 14px;
  background: var(--rg-soft);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.rg-upload:hover, .rg-upload:focus-within { border-color: var(--rg-brand); background: var(--rg-brand-soft); }
.rg-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.rg-upload-preview {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--rg-surface);
  border: 1px solid var(--rg-border);
  color: var(--rg-brand);
  overflow: hidden;
}
.rg-upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.rg-upload.has-file .rg-upload-preview > .material-icons { display: none; }
.rg-upload-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.rg-upload-text strong { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg-upload-text small { color: var(--rg-muted); font-size: .76rem; }
.rg-upload-btn {
  flex-shrink: 0;
  padding: .45rem .9rem;
  border-radius: 10px;
  background: var(--rg-surface);
  border: 1px solid var(--rg-border);
  font-size: .8rem;
  font-weight: 600;
  color: var(--rg-brand);
}

/* Alert */
.rg-alert {
  display: flex;
  gap: .6rem;
  margin-bottom: 1.25rem;
  padding: .8rem 1rem;
  border-radius: 12px;
  background: rgba(220, 38, 38, .08);
  border: 1px solid rgba(220, 38, 38, .25);
  color: var(--rg-danger);
  font-size: .86rem;
}
.rg-alert .material-icons { font-size: 19px; }
.rg-alert ul { margin: 0; padding: 0; list-style: none; }

/* Submit */
.rg .rg-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  min-height: 52px;
  margin-top: .5rem;
  border: 0 !important;
  border-radius: 14px;
  background: linear-gradient(135deg, #4f8bff, var(--mn-brand, #2563eb) 70%) !important;
  color: #fff !important;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(37, 99, 235, .3);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.rg .rg-submit:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 14px 30px rgba(37, 99, 235, .38); }
.rg-submit .material-icons { font-size: 20px; }
[dir="rtl"] .rg-flip { transform: scaleX(-1); }

.rg-terms { margin: .85rem 0 0; text-align: center; color: var(--rg-muted); font-size: .78rem; }
.rg-terms a, .rg-foot a { color: var(--rg-brand); font-weight: 600; text-decoration: none; }
.rg-terms a:hover, .rg-foot a:hover { text-decoration: underline; }

.rg-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .4rem 1.5rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rg-border);
  font-size: .86rem;
  color: var(--rg-muted);
}
.rg-foot p { margin: 0; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 991.98px) {
  .rg-card { grid-template-columns: 1fr; }
  .rg-aside { gap: 1.25rem; padding: 1.5rem; }
  .rg-aside .rg-aside-title { font-size: 1.25rem; margin: .75rem 0 1rem; }
  .rg-benefits { gap: .65rem; }
  .rg-benefits li { font-size: .85rem; }
  .rg-aside-foot, .rg-stats { display: none; }
}
@media (max-width: 575.98px) {
  .rg { padding: 1rem 0 2rem; }
  .rg-card { border-radius: 20px; }
  .rg-main { padding: 1.5rem 1.15rem; }
  .rg-head h1 { font-size: 1.35rem; }
  .rg-types { grid-template-columns: 1fr; }
  .rg.has-type .rg-types { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rg.has-type .rg-type-text strong { font-size: .74rem; }
  .rg-grid, .rg-grid--3 { grid-template-columns: 1fr; }
  .rg-foot { flex-direction: column; text-align: center; }
}
