@import url("https://fonts.googleapis.com/css2?family=Barlow:wght@500;600;700&family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@500;600;700&display=swap");

:root {
  --auth-ink: #121212;
  --auth-muted: #6b7280;
  --auth-line: #e5e7eb;
  --auth-soft: #f3f4f6;
  --auth-panel: #ffffff;
  --auth-btn: #171717;
  --auth-btn-hover: #000000;
  --auth-radius: 12px;
  --auth-radius-sm: 10px;
  --auth-font: "Inter", system-ui, sans-serif;
  --auth-display: "Playfair Display", Georgia, serif;
  --auth-btn-font: "Barlow", "Inter", sans-serif;
  --auth-shadow: 0 24px 60px rgba(15, 23, 42, 0.12);
}

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

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

body.rbq-auth {
  font-family: var(--auth-font);
  color: var(--auth-ink);
  background: #fafafa;
  -webkit-font-smoothing: antialiased;
  /* Keep iOS from inflating text in landscape and from flashing grey taps. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

.rbq-auth-shell {
  min-height: 100vh;
  /* dvh tracks the collapsing Safari toolbar so nothing hides behind it. */
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(320px, 46%) minmax(0, 54%);
  background: var(--auth-panel);
}

.rbq-auth-form-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3.5rem) clamp(1.25rem, 5vw, 5rem);
  max-width: 34rem;
  width: 100%;
  margin-inline: auto;
}

.rbq-auth-brand {
  display: inline-flex;
  align-items: center;
  margin-bottom: 1.75rem;
  text-decoration: none;
  color: inherit;
  animation: auth-rise 0.7s ease both;
}

.rbq-auth-brand picture {
  display: inline-flex;
}

.rbq-auth-brand img {
  /* Full lockup is wide (~3.6:1); size by height so the wordmark stays readable. */
  width: auto;
  height: 3.25rem;
  max-width: min(100%, 17.5rem);
  object-fit: contain;
  display: block;
}

.rbq-auth-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.28rem;
  border: 1px solid var(--auth-line);
  border-radius: 999px;
  background: #fff;
  width: fit-content;
  margin-bottom: 1.75rem;
  animation: auth-rise 0.75s ease 0.05s both;
}

.rbq-auth-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--auth-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  min-height: 2.6rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.rbq-auth-tab svg {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.rbq-auth-tab.is-active {
  background: var(--auth-soft);
  color: var(--auth-ink);
}

.rbq-auth-tab:hover:not(.is-active) {
  color: var(--auth-ink);
}

.rbq-auth-heading {
  margin: 0 0 0.45rem;
  font-family: var(--auth-display);
  font-size: clamp(2rem, 3.2vw, 2.55rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  animation: auth-rise 0.8s ease 0.08s both;
}

.rbq-auth-sub {
  margin: 0 0 1.75rem;
  color: var(--auth-muted);
  font-size: 0.98rem;
  line-height: 1.5;
  animation: auth-rise 0.8s ease 0.12s both;
}

.rbq-auth-panel[hidden] {
  display: none !important;
}

.rbq-auth-panel {
  animation: auth-fade 0.35s ease both;
}

.rbq-auth-field {
  margin-bottom: 1rem;
}

.rbq-auth-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.rbq-auth-field label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: #1f2937;
}

.rbq-auth-link {
  color: var(--auth-ink);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}

.rbq-auth-link:hover {
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.rbq-auth-field input,
.rbq-auth-field select {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  border: 1px solid var(--auth-line);
  border-radius: var(--auth-radius-sm);
  background: #fff;
  color: var(--auth-ink);
  padding: 0.85rem 0.95rem;
  /* 16px floor stops iOS Safari from zooming the page on focus. */
  font-size: max(1rem, 16px);
  min-height: 3rem;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.rbq-auth-field input::placeholder {
  color: #9ca3af;
}

.rbq-auth-field input:focus,
.rbq-auth-field select:focus {
  border-color: #9ca3af;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.06);
}

.rbq-auth-password-wrap {
  position: relative;
}

.rbq-auth-password-wrap input {
  padding-right: 3.1rem;
}

.rbq-auth-eye {
  position: absolute;
  top: 50%;
  right: 0.15rem;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #9ca3af;
  /* 44px minimum hit area (HIG). */
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rbq-auth-eye:hover {
  color: var(--auth-ink);
}

.rbq-auth-eye svg {
  width: 1.15rem;
  height: 1.15rem;
}

.rbq-auth-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.rbq-auth-submit {
  width: 100%;
  margin-top: 0.35rem;
  border: 0;
  border-radius: var(--auth-radius);
  background: linear-gradient(180deg, #2a2a2a 0%, var(--auth-btn) 100%);
  color: #fff;
  font-family: var(--auth-btn-font);
  font-weight: 700;
  font-size: 0.98rem;
  padding: 0.95rem 1rem;
  min-height: 3.1rem;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.rbq-auth-submit:active {
  transform: scale(0.985);
}

.rbq-auth-submit:hover {
  background: var(--auth-btn-hover);
  transform: translateY(-1px);
}

.rbq-auth-submit:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.rbq-auth-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.85rem;
  margin: 1.25rem 0 1rem;
  color: #9ca3af;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.rbq-auth-divider::before,
.rbq-auth-divider::after {
  content: "";
  height: 1px;
  background: var(--auth-line);
}

.rbq-auth-social {
  display: grid;
  gap: 0.65rem;
}

.rbq-auth-social-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  border: 1px solid var(--auth-line);
  border-radius: var(--auth-radius-sm);
  background: #fff;
  color: var(--auth-ink);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.78rem 1rem;
  min-height: 2.95rem;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.rbq-auth-social-btn:active {
  transform: scale(0.985);
}

.rbq-auth-social-btn:hover {
  background: #fafafa;
  border-color: #d1d5db;
  transform: translateY(-1px);
}

.rbq-auth-social-btn svg,
.rbq-auth-social-btn img {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
}

.rbq-auth-foot {
  margin: 1.35rem 0 0;
  text-align: center;
  color: var(--auth-muted);
  font-size: 0.9rem;
}

.rbq-auth-back {
  display: inline-flex;
  align-items: center;
  margin: 0 0 1.15rem;
  color: var(--auth-muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  animation: auth-rise 0.7s ease both;
}

.rbq-auth-back:hover {
  color: var(--auth-ink);
}

.rbq-auth-sub strong {
  color: var(--auth-ink);
  font-weight: 700;
}

.rbq-auth-dev {
  margin: 0 0 1.25rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px dashed #c4c4c4;
  background: linear-gradient(180deg, #f7f7f7 0%, #efefef 100%);
  animation: auth-rise 0.75s ease both;
}

.rbq-auth-dev[hidden] {
  display: none !important;
}

.rbq-auth-dev-top {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
  color: #374151;
  font-size: 0.8rem;
  font-weight: 600;
}

.rbq-auth-dev-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #171717;
  color: #fff;
  font-family: var(--auth-btn-font);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rbq-auth-dev-code {
  margin: 0 0 0.7rem;
  font-family: var(--auth-btn-font);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: #111;
  line-height: 1.1;
}

.rbq-auth-dev-fill {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: #171717;
  color: #fff;
  font-family: var(--auth-btn-font);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
}

.rbq-auth-dev-fill:hover {
  background: #000;
}

.rbq-auth-otp {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.55rem;
}

/* Scoped so the shared `.rbq-auth-field input` sizing does not win over these. */
.rbq-auth-otp .rbq-auth-otp-digit {
  width: 100%;
  aspect-ratio: 1;
  max-height: 3.4rem;
  min-height: 3rem;
  padding: 0.5rem 0.25rem;
  border: 1px solid var(--auth-line);
  border-radius: var(--auth-radius-sm);
  background: #fff;
  color: var(--auth-ink);
  text-align: center;
  font-family: var(--auth-btn-font);
  font-size: 1.25rem;
  font-weight: 700;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.rbq-auth-otp .rbq-auth-otp-digit:focus {
  border-color: #9ca3af;
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.06);
}

.rbq-auth-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem 1.15rem;
  margin-top: 1.5rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--auth-line);
}

.rbq-auth-legal a {
  color: var(--auth-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.rbq-auth-legal a:hover {
  color: var(--auth-ink);
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

.rbq-auth-foot button {
  border: 0;
  background: none;
  padding: 0;
  color: var(--auth-ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.16em;
  cursor: pointer;
}

.rbq-auth-msg {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
}

.rbq-auth-msg[data-tone="error"] {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.rbq-auth-msg[data-tone="ok"] {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.rbq-auth-msg[hidden] {
  display: none !important;
}

.rbq-auth-demo {
  margin-top: 0.85rem;
  width: 100%;
  border: 1px dashed #d1d5db;
  border-radius: var(--auth-radius-sm);
  background: #fafafa;
  color: #374151;
  font-weight: 600;
  font-size: 0.86rem;
  padding: 0.7rem 0.9rem;
  cursor: pointer;
}

.rbq-auth-demo[hidden] {
  display: none !important;
}

.rbq-auth-hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 1rem;
  animation: auth-hero-in 0.9s ease both;
}

.rbq-auth-hero-frame {
  position: relative;
  height: calc(100vh - 2rem);
  height: calc(100dvh - 2rem);
  border-radius: 22px;
  overflow: hidden;
  background-color: #1c1c1e;
  box-shadow: var(--auth-shadow);
}

.rbq-auth-hero-bg {
  position: absolute;
  inset: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  transform: scale(1.02);
  transition: opacity 0.45s ease, transform 0.7s ease;
  will-change: opacity, transform;
}

.rbq-auth-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.42));
  pointer-events: none;
}

.rbq-auth-hero-bg.is-fading {
  opacity: 0;
  transform: scale(1.05);
}

.rbq-auth-quote {
  position: absolute;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 2;
  padding: 1.35rem 1.4rem 1.15rem;
  border-radius: 18px;
  color: #fff;
  background: rgba(28, 28, 30, 0.42);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
}

.rbq-auth-quote p {
  margin: 0 0 1rem;
  font-family: var(--auth-display);
  font-size: clamp(1.05rem, 1.5vw, 1.28rem);
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.rbq-auth-quote-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.rbq-auth-quote-meta strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 800;
}

.rbq-auth-quote-meta span {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 500;
}

.rbq-auth-quote-nav {
  display: inline-flex;
  gap: 0.45rem;
}

.rbq-auth-quote-nav button {
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

.rbq-auth-quote-nav button:hover {
  transform: translateY(-1px);
  background: #fff;
}

.rbq-auth-quote-nav svg {
  width: 0.95rem;
  height: 0.95rem;
}

@keyframes auth-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes auth-fade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes auth-hero-in {
  from {
    opacity: 0;
    transform: scale(1.02);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Mobile — Apple Human Interface Guidelines
   Clarity (legible type, generous targets), deference (content leads),
   depth (layered glass, real press feedback).
   ========================================================================== */

/* Content clears the notch, Dynamic Island and home indicator. */
@supports (padding: env(safe-area-inset-bottom)) {
  .rbq-auth-form-col {
    padding-left: max(clamp(1.25rem, 5vw, 5rem), env(safe-area-inset-left));
    padding-right: max(clamp(1.25rem, 5vw, 5rem), env(safe-area-inset-right));
    padding-bottom: calc(clamp(1.5rem, 4vw, 3.5rem) + env(safe-area-inset-bottom));
  }

  .rbq-auth-hero {
    padding-top: max(1rem, env(safe-area-inset-top));
  }
}

/* Visible focus for keyboard and switch-control users. */
.rbq-auth a:focus-visible,
.rbq-auth button:focus-visible,
.rbq-auth input:focus-visible {
  outline: 2px solid var(--auth-ink);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Autofill should not repaint fields yellow. */
.rbq-auth-field input:-webkit-autofill,
.rbq-auth-field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--auth-ink);
  -webkit-box-shadow: 0 0 0 100px #fff inset;
}

@media (max-width: 980px) {
  .rbq-auth-shell {
    grid-template-columns: 1fr;
  }

  .rbq-auth-hero {
    order: -1;
    min-height: auto;
    /* Hero leads on mobile, so it owns the status-bar inset. */
    padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem 0;
  }

  .rbq-auth-hero-frame {
    height: min(38dvh, 20rem);
    border-radius: 20px;
  }

  .rbq-auth-quote p {
    font-size: 1rem;
  }

  .rbq-auth-form-col {
    max-width: 32rem;
    padding-top: 1.5rem;
    padding-bottom: calc(2.25rem + env(safe-area-inset-bottom));
  }
}

@media (max-width: 560px) {
  .rbq-auth-grid {
    grid-template-columns: 1fr;
  }

  .rbq-auth-brand img {
    height: 2.6rem;
  }

  /* Segmented control: two equal halves, thumb-sized. */
  .rbq-auth-tabs {
    display: flex;
    width: 100%;
  }

  .rbq-auth-tab {
    flex: 1 1 0;
    justify-content: center;
    min-height: 2.75rem;
  }

  .rbq-auth-heading {
    font-size: 1.85rem;
  }

  .rbq-auth-hero-frame {
    height: min(30dvh, 13rem);
  }

  .rbq-auth-quote {
    left: 0.6rem;
    right: 0.6rem;
    bottom: 0.6rem;
    padding: 0.9rem 1rem;
  }

  .rbq-auth-quote p {
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    line-height: 1.4;
  }

  /* Square-ish boxes get too small on narrow phones — favour tap height. */
  .rbq-auth-otp {
    gap: 0.4rem;
  }

  .rbq-auth-otp .rbq-auth-otp-digit {
    aspect-ratio: auto;
    max-height: none;
    min-height: 3.25rem;
    font-size: 1.15rem;
  }

  .rbq-auth-legal {
    gap: 0.35rem 0.85rem;
  }

  /* Legal links become full-height rows so they are easy to hit. */
  .rbq-auth-legal a {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    padding: 0 0.15rem;
  }
}

/* Landscape phones: drop the imagery so the form owns the short viewport. */
@media (max-width: 900px) and (max-height: 480px) and (orientation: landscape) {
  .rbq-auth-hero {
    display: none;
  }

  .rbq-auth-form-col {
    justify-content: flex-start;
  }
}

/* Touch devices: hover lifts never trigger, so press states carry feedback. */
@media (hover: none) {
  .rbq-auth-submit:hover,
  .rbq-auth-social-btn:hover,
  .rbq-auth-quote-nav button:hover {
    transform: none;
  }

  .rbq-auth-social-btn:hover {
    background: #fff;
    border-color: var(--auth-line);
  }

  .rbq-auth-quote-nav button:active {
    transform: scale(0.94);
  }

  .rbq-auth-tab:active {
    transform: scale(0.985);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rbq-auth *,
  .rbq-auth *::before,
  .rbq-auth *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}

