/* =========================================================================
   RealTAG · Registration.Portal
   Modern split-screen sign-up: a branded value panel paired with the form.
   Full-bleed on desktop and mobile — no floating box.
   Palette: #BF311A (RealTAG red) · ink #161311 · warm #e7e5df canvas.
   Type: system UI stack (Segoe UI on Windows) — crisp and trustworthy.
   ========================================================================= */

:root {
  --red: #BF311A;
  --red-dark: #a52915;
  --red-bright: #f1543a;     /* lifts red on the dark brand panel */
  --ink: #161311;
  --ink-2: #2a2320;
  --ink-soft: #555;
  --muted: #888;
  --canvas: #e7e5df;
  --card: #fff;
  --border: #a9a49b;
  --border-soft: #e7e5e0;
  --ok: #1a8a4a;
  --radius: 8px;
  --radius-sm: 6px;
  --font: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

/* Ensure the [hidden] attribute wins over display rules below. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--card);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::placeholder { color: #b3b0aa; }

/* =========================================================================
   Layout — two full-height columns on desktop, stacked on mobile.
   ========================================================================= */
.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
}

/* =========================================================================
   Brand / value panel
   ========================================================================= */
.brand-panel {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  color: #fff;
  background:
    radial-gradient(120% 90% at 15% 10%, #5c120e 0%, #260b09 52%, #120907 100%);
}

/* Concentric bullseye motif echoing the logo mark — large, faint, bottom-left. */
.brand-rings {
  position: absolute;
  left: -240px;
  bottom: -260px;
  width: 720px;
  height: 720px;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle at center,
      rgba(255, 255, 255, .05) 0 2px,
      transparent 2px 54px);
  -webkit-mask-image: radial-gradient(circle at center, #000 60%, transparent 72%);
          mask-image: radial-gradient(circle at center, #000 60%, transparent 72%);
  pointer-events: none;
}
/* A warm red glow behind the rings for depth. */
.brand-panel::after {
  content: "";
  position: absolute;
  right: -180px;
  top: -160px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(165, 32, 22, .45), transparent 70%);
  pointer-events: none;
}

.brand-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  width: 100%;
  max-width: 620px;
  margin-left: auto;     /* hug the dividing line */
  padding: 56px clamp(40px, 5vw, 80px);
}

/* ---- Hero copy ---- */
.brand-hero { max-width: 46ch; }
.brand-title {
  font: 800 clamp(30px, 3.4vw, 44px)/1.08 var(--font);
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.brand-sub {
  font: 400 clamp(15px, 1.3vw, 17px)/1.6 var(--font);
  color: rgba(255, 255, 255, .72);
  margin: 0 0 32px;
  max-width: 46ch;
}

.brand-points {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* Uniform row height keeps every target evenly spaced, whether the copy
     runs one line or wraps to two. */
  gap: 4px;
}
.brand-points li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-height: 64px;
  font: 400 16.5px/1.5 var(--font);
  color: rgba(255, 255, 255, .9);
}
.brand-points strong { font-weight: 700; color: #fff; }
/* Concentric target rings echoing the RealTAG logo mark, sized to read as
   the bullseye itself rather than an icon inside a badge. */
.bp-ico {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin-top: -2px;   /* optically center the target on the first line */
  border-radius: 50%;
  background: radial-gradient(circle at center,
    var(--red-bright) 0 3px,
    #000 3px 6px,
    var(--red-bright) 6px 8px,
    #000 8px 11px,
    var(--red-bright) 11px 13px,
    transparent 13px);
}

.brand-foot {
  font: 400 13.5px/1.5 var(--font);
  color: rgba(255, 255, 255, .5);
  margin: 0;
}

/* =========================================================================
   Form panel
   ========================================================================= */
.form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--canvas);
  padding: 48px clamp(24px, 4vw, 64px);
}
.form-shell {
  width: 100%;
  max-width: 460px;
}

.brand-logo {
  height: 46px;
  width: auto;
  display: block;
  margin: 0 0 30px;
}

.form-head { margin: 0 0 28px; }
.reg-card h1 {
  font: 800 28px/1.12 var(--font);
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 8px;
}
.lede {
  font: 400 15px/1.55 var(--font);
  color: var(--ink-soft);
  margin: 0;
}

/* =========================================================================
   Fields
   ========================================================================= */
.field { margin: 0 0 16px; }
.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }

label {
  display: block;
  font: 600 11px/1 var(--font);
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 7px;
}
label .optional {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  color: #aaa;
}

.input-wrap { position: relative; }

input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 38px 0 14px;
  font: 400 15px/1 var(--font);
  color: var(--ink);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(191, 49, 26, .12);
}

/* ---------- Password show/hide toggle ---------- */
.pw-toggle {
  position: absolute;
  right: 6px;
  top: 23px;                 /* matches the 46px input's vertical center */
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.pw-toggle:hover { color: var(--ink); }
.pw-toggle:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
.pw-toggle svg { width: 20px; height: 20px; display: block; }
.pw-toggle .ico-eye-off { display: none; }
.pw-toggle.is-on .ico-eye { display: none; }
.pw-toggle.is-on .ico-eye-off { display: block; }

/* Reserve room for the toggle, and tuck the validation icon to its left. */
.input-wrap.has-toggle input { padding-right: 66px; }
.input-wrap.has-toggle .status-icon { right: 42px; }

/* ---------- Per-field validation states ---------- */
.field.is-valid input { border-color: var(--ok); }
.field.is-valid input:focus { box-shadow: 0 0 0 3px rgba(26, 138, 74, .14); }
.field.is-invalid input { border-color: var(--red); }
.field.is-invalid input:focus { box-shadow: 0 0 0 3px rgba(191, 49, 26, .14); }

.feedback {
  font: 400 12.5px/1.4 var(--font);
  margin: 6px 0 0;
  min-height: 16px;
  color: var(--muted);
}
.field.is-valid .feedback { color: var(--ok); }
.field.is-invalid .feedback { color: var(--red); }
.field.is-checking .feedback { color: var(--muted); }

/* Status icon inside the input (✓ / ✗ / spinner) */
.status-icon {
  position: absolute;
  right: 12px;
  top: 23px;                 /* vertical center of the 46px input */
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  display: none;
}
.field.is-valid .status-icon,
.field.is-invalid .status-icon,
.field.is-checking .status-icon { display: block; }

.field.is-valid .status-icon::after {
  content: "✓";
  color: var(--ok);
  font-size: 15px;
  font-weight: 700;
  line-height: 18px;
}
.field.is-invalid .status-icon::after {
  content: "✕";
  color: var(--red);
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
}
.field.is-checking .status-icon {
  border: 2px solid #ddd;
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: translateY(-50%) rotate(360deg); } }

/* ---------- Form-level error ---------- */
.form-error {
  background: #fdf3f1;
  border: 1px solid #f0cdc6;
  border-radius: var(--radius-sm);
  color: #7d2414;
  font: 400 14px/1.45 var(--font);
  padding: 12px 14px;
  margin: 0 0 18px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: var(--radius-sm);
  font: 700 16px/1 var(--font);
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background .15s ease, color .15s ease, transform .05s ease, box-shadow .15s ease;
}
.btn-block { width: 100%; height: 50px; margin-top: 6px; }
.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 1px 2px rgba(191, 49, 26, .25);
}
.btn-primary:hover { background: var(--red-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-spinner { display: none; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.5); border-top-color: #fff;
  border-radius: 50%; animation: btnspin .7s linear infinite; }
.btn.is-loading .btn-spinner { display: inline-block; }
.btn.is-loading .btn-label { opacity: .85; }
@keyframes btnspin { to { transform: rotate(360deg); } }

.signin {
  font: 400 14px/1.5 var(--font);
  color: var(--muted);
  text-align: center;
  margin: 22px 0 0;
}
.signin a { color: var(--red); font-weight: 600; text-decoration: none; }
.signin a:hover { text-decoration: underline; }

/* =========================================================================
   Success card
   ========================================================================= */
.success-body { text-align: center; }
.success-check {
  width: 56px; height: 56px; margin: 4px auto 18px;
  border-radius: 50%; background: rgba(26,138,74,.12); color: var(--ok);
  font-size: 28px; line-height: 56px; font-weight: 700;
}
.success-card h1 {
  font: 800 28px/1.12 var(--font); letter-spacing: -0.02em; margin: 0 0 8px;
}
.success-card .lede { text-align: center; margin: 0 auto 24px; }

/* =========================================================================
   Responsive — stack the panels, keep the form edge-to-edge (never a box).
   ========================================================================= */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }

  /* Keep the panel a positioned containing block so overflow:hidden still
     clips the decorative rings/glow — otherwise they spill past the viewport
     and create horizontal scroll into the canvas. */
  .brand-panel {
    position: relative;
    height: auto;
    min-height: auto;
  }
  .brand-inner {
    max-width: none;
    margin: 0;
    gap: 24px;
    padding: 40px clamp(24px, 6vw, 56px) 44px;
  }
  /* Trim the hero to a compact, full-width banner on top. */
  .brand-hero { max-width: none; }
  .brand-title { margin-bottom: 10px; }
  .brand-sub { margin-bottom: 0; max-width: 56ch; }
  .brand-points,
  .brand-foot { display: none; }
  .brand-rings { left: auto; right: -300px; bottom: -360px; }

  .form-panel {
    align-items: flex-start;
    padding: 40px clamp(24px, 6vw, 56px) 56px;
  }
  .form-shell { max-width: 540px; margin: 0 auto; }
}

@media (max-width: 520px) {
  .brand-inner { padding: 30px 22px 34px; }
  .form-panel { padding: 28px 22px 44px; }
  .reg-card h1 { font-size: 24px; }
  .field-row { flex-direction: column; gap: 0; }
}
