/* Ratin Special — sign-in / create-account page
   To change the accent colour for this page, edit --accent (and --accent-ink for text on top of it). */
:root {
  --bg: #0a0a0c;
  --surface: #151517;
  --field: #1e1e21;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f0efe9;
  --muted: #87858c;
  --accent: #d8c84a;
  --accent-ink: #1a1900;
  --danger: #ff8a8d;
  --danger-bg: rgba(255, 90, 94, 0.1);
  --ok: #8fe3a4;
  --ok-bg: rgba(110, 220, 140, 0.1);
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.auth-shell {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
}

/* ---------- Left: product stage ---------- */
.auth-stage {
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: start;
  overflow: hidden;
  background: #060706;
}
.auth-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 22% 50%;
  animation: stage-in 1.1s cubic-bezier(.2, .7, .2, 1) both;
}
.auth-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 11, 10, 0) 78%, var(--bg) 100%),
    linear-gradient(180deg, rgba(10, 11, 10, 0.35) 0%, rgba(10, 11, 10, 0) 25%, rgba(10, 11, 10, 0) 75%, rgba(10, 11, 10, 0.5) 100%);
  pointer-events: none;
}
@keyframes stage-in {
  from { opacity: 0; transform: scale(1.04); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---------- Right: form ---------- */
.auth-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 28px clamp(24px, 5vw, 72px) 32px;
}
.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.02em;
  line-height: 1;
}
.auth-brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: block;
}
.auth-brand small {
  display: block;
  margin-top: 4px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0;
  color: var(--muted);
}
.auth-back {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 2px;
  border-bottom: 1px solid transparent;
  transition: color .15s, border-color .15s;
}
.auth-back:hover { color: var(--text); border-color: var(--line-strong); }

.auth-center {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 36px 0;
}
.auth-box { width: 100%; max-width: 410px; }

/* Segmented switch */
.seg {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  margin-bottom: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.seg-thumb {
  position: absolute;
  top: 4px; bottom: 4px; left: 4px;
  width: calc(50% - 4px);
  background: var(--accent);
  border-radius: 8px;
  transition: transform .28s cubic-bezier(.3, .8, .3, 1);
}
.seg[data-active="signup"] .seg-thumb { transform: translateX(100%); }
.seg button {
  position: relative;
  z-index: 1;
  padding: 10px 8px;
  background: none;
  border: 0;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color .2s;
}
.seg button[aria-selected="true"] { color: var(--accent-ink); }
.seg button:not([aria-selected="true"]):hover { color: var(--text); }

.auth-head h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(38px, 4.2vw, 52px);
  line-height: 1;
  letter-spacing: 0.005em;
}
.auth-head p { margin: 0 0 26px; color: var(--muted); font-size: 16px; max-width: 34ch; }

/* Messages */
.alert {
  display: none;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 14.5px;
  line-height: 1.45;
  border: 1px solid transparent;
}
.alert.show { display: flex; }
.alert svg { flex: 0 0 18px; width: 18px; height: 18px; margin-top: 2px; }
.alert-error { background: var(--danger-bg); border-color: rgba(255, 90, 94, 0.35); color: var(--danger); }
.alert-success { background: var(--ok-bg); border-color: rgba(110, 220, 140, 0.35); color: var(--ok); }

/* Fields */
.field { margin-bottom: 18px; }
.field > label, .label-row label {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 600;
  color: #d8d9d2;
}
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.label-row label { margin-bottom: 7px; }
.link-btn {
  background: none; border: 0; padding: 0;
  font-size: 13.5px; font-weight: 500; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong);
  cursor: pointer;
}
.link-btn:hover { color: var(--accent); text-decoration-color: var(--accent); }

.input-wrap { position: relative; }
.input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  background: var(--field);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-size: 16px;
  outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder { color: #666b65; }
.input:hover { border-color: rgba(255, 255, 255, 0.3); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(216, 200, 74, 0.18); background: #181b1a; }
.input.has-toggle { padding-right: 48px; }
.eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: none; border: 0; border-radius: 8px;
  color: var(--muted); cursor: pointer;
}
.eye:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.eye svg { width: 20px; height: 20px; }
.eye .off { display: none; }
.eye[aria-pressed="true"] .on { display: none; }
.eye[aria-pressed="true"] .off { display: block; }

/* Password strength */
.meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 10px; }
.meter i { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); transition: background .2s; }
.meter[data-level="1"] i:nth-child(-n+1) { background: #ff6b6e; }
.meter[data-level="2"] i:nth-child(-n+2) { background: #ffb13b; }
.meter[data-level="3"] i:nth-child(-n+3) { background: var(--accent); }
.meter[data-level="4"] i { background: #6fe08f; }
.hint { margin: 7px 0 0; font-size: 13.5px; color: var(--muted); min-height: 1.4em; }

/* Referral disclosure */
.ref-toggle { margin: -4px 0 18px; }

/* Primary button */
.cta {
  position: relative;
  width: 100%;
  height: 52px;
  margin-top: 6px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: 10px;
  font-size: 16.5px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s, transform .1s;
}
.cta:hover:not(:disabled) { filter: brightness(1.07); }
.cta:active:not(:disabled) { transform: translateY(1px); }
.cta:disabled { cursor: progress; opacity: .85; }
.cta .spin {
  display: none;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(21, 20, 10, 0.25);
  border-top-color: var(--accent-ink);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.cta.is-loading .spin { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-foot { margin-top: 22px; font-size: 14.5px; color: var(--muted); }
.auth-foot button { color: var(--text); font-weight: 600; }
.auth-legal { margin-top: auto; padding-top: 12px; font-size: 13px; color: #6f746e; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-stage { display: none; }
  .auth-main { min-height: 100vh; padding: 20px 20px 24px; }
  .auth-center { align-items: flex-start; padding-top: 28px; }
  .auth-box { max-width: 440px; margin: 0 auto; }
  .auth-head h1 { font-size: 42px; }
}
@media (max-width: 380px) {
  .auth-brand small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-stage img { animation: none; }
  .seg-thumb, .cta, .input, .meter i { transition: none; }
  .cta .spin { animation-duration: 1.6s; }
}

/* Google sign-in */
.or-divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 16px; color: var(--muted); font-size: 13px; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.gbtn {
  width: 100%; height: 50px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--field); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 10px;
  font-size: 15.5px; font-weight: 600; cursor: pointer;
  transition: filter .15s, transform .1s;
}
.gbtn:hover:not(:disabled) { filter: brightness(1.15); }
.gbtn:active:not(:disabled) { transform: translateY(1px); }
.gbtn:disabled { cursor: progress; opacity: .7; }
.gbtn svg { width: 20px; height: 20px; }
