/* ==========================================================================
   RulePDF V11 Platform Stylesheet
   Covers: Editorial /login/ (Stepper + 3+3 Tactile OTP + Warm Parchment Vault),
   /workspace/ (@uvain Data Table + Isometric Empty State), /upsell/, Legal,
   and /admin/ Executive Operator Console
   ========================================================================== */

.rp-plat-shell {
  min-height: 100dvh;
  background: var(--paper-ivory);
  display: flex;
  flex-direction: column;
}

.rp-plat-main {
  flex: 1;
  padding: clamp(1.5rem, 3.8vw, 2.8rem) 0;
}

/* ==================== EDITORIAL SPLIT LOGIN (/login/) ==================== */
.rp-login-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.04fr);
  background: var(--paper-white);
}

.rp-login-form-pane {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.25rem, 2.8vw, 2.1rem) clamp(1.25rem, 4.5vw, 3.6rem);
  background: var(--paper-white);
  border-right: 1px solid var(--rule-line);
}

.rp-login-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.rp-login-box {
  width: 100%;
  max-width: 420px;
  margin: 1.75rem auto;
}

/* 3-Step Architectural Stepper (#34833 @uvain Adapted) */
.rp-auth-stepper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.45rem;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.rp-auth-step {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
}

.rp-auth-step-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--rule-strong);
  background: var(--paper-ivory);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.rp-auth-step.is-active {
  color: var(--ink-obsidian);
}

.rp-auth-step.is-active .rp-auth-step-dot {
  background: var(--ink-obsidian);
  border-color: var(--ink-obsidian);
  color: var(--paper-white);
}

.rp-auth-step.is-done {
  color: var(--signal-emerald);
}

.rp-auth-step.is-done .rp-auth-step-dot {
  background: var(--signal-emerald-tint);
  border-color: var(--signal-emerald-border);
  color: var(--signal-emerald);
}

.rp-auth-step-line {
  width: 22px;
  height: 1px;
  background: var(--rule-strong);
}

.rp-login-h1 {
  font-size: clamp(1.65rem, 2.7vw, 2.1rem);
  font-weight: 800;
  line-height: 1.11;
  letter-spacing: -0.032em;
  color: var(--ink-obsidian);
  margin-bottom: 0.55rem;
}

.rp-login-sub {
  margin: 0 0 1.55rem;
  font-size: 0.92rem;
  line-height: 1.54;
  color: var(--ink-body);
}

.rp-login-input {
  min-height: 48px;
  font-size: 0.96rem;
}

/* Tactile 3+3 Visual OTP Slots Backed by Single Accessible <input> (#34833 + sms-otp-form) */
.rp-otp-stage {
  position: relative;
  margin-top: 0.25rem;
}

.rp-otp-slots {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.42rem;
  pointer-events: none;
}

.rp-otp-sep {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--rule-strong);
  padding: 0 2px;
}

.rp-otp-slot {
  flex: 1;
  height: 54px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--rule-strong);
  background: var(--paper-ivory);
  font-family: var(--font-mono);
  font-size: 1.32rem;
  font-weight: 700;
  color: var(--ink-obsidian);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.rp-otp-slot.is-filled {
  background: var(--paper-white);
  border-color: var(--ink-obsidian);
}

.rp-otp-stage:focus-within .rp-otp-slot.is-cursor {
  background: var(--paper-white);
  border-color: var(--accent-cobalt);
  box-shadow: 0 0 0 3px var(--accent-cobalt-ring);
}

.rp-otp-native-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  font-size: 1.25rem; /* >= 16px prevents iOS auto-zoom */
  cursor: text;
  border: 0;
  padding: 0;
  margin: 0;
}

.rp-login-help-box {
  margin-top: 1.5rem;
  padding: 0.88rem 1rem;
  border-radius: var(--r-sm);
  background: var(--paper-ivory);
  border: 1px solid var(--rule-line);
  font-size: 0.82rem;
  color: var(--ink-body);
  line-height: 1.46;
}

.rp-login-help-box strong {
  display: block;
  color: var(--ink-obsidian);
  font-weight: 700;
  margin-bottom: 2px;
}

.rp-login-help-box a {
  color: var(--accent-cobalt);
  font-weight: 700;
  text-decoration: none;
}

.rp-login-help-box a:hover {
  text-decoration: underline;
}

.rp-login-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.77rem;
  color: var(--ink-muted);
  padding-top: 1rem;
  border-top: 1px solid var(--rule-line);
}

.rp-login-foot a {
  color: var(--ink-body);
  text-decoration: none;
  font-weight: 600;
}

/* Right Pane: Warm Archival Parchment Vault Showcase (Zero Dark Neon Clutter!) */
.rp-login-showcase {
  background-color: var(--paper-parchment);
  background-image:
    linear-gradient(to right, rgba(17, 19, 24, 0.038) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(17, 19, 24, 0.038) 1px, transparent 1px);
  background-size: 28px 28px;
  color: var(--ink-obsidian);
  padding: clamp(1.6rem, 3.8vw, 3rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.rp-showcase-inner {
  width: 100%;
  max-width: 468px;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.rp-vault-illos-card {
  background: var(--paper-white);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-md);
  padding: 1.1rem 1.2rem 1rem;
  box-shadow: var(--shadow-card);
}

.rp-vault-illos-svg {
  width: 100%;
  max-width: 340px;
  margin: 0 auto 0.6rem;
  display: block;
}

.rp-vault-perks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--rule-line);
}

.rp-vault-perk strong {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--ink-obsidian);
}

.rp-vault-perk span {
  display: block;
  font-size: 0.69rem;
  color: var(--ink-muted);
  line-height: 1.35;
  margin-top: 1px;
}

.rp-vault-window {
  background: var(--paper-white);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-md);
  padding: 1.05rem 1.15rem;
  box-shadow: var(--shadow-card);
}

.rp-vault-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.7rem;
  margin-bottom: 0.7rem;
  border-bottom: 1px solid var(--rule-line);
}

.rp-vault-head strong {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--ink-obsidian);
}

.rp-vault-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rp-vault-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 0.68rem;
  border-radius: var(--r-xs);
  background: var(--paper-ivory);
  border: 1px solid var(--rule-line);
}

.rp-vault-ic {
  min-width: 40px;
  height: 30px;
  padding: 0 6px;
  border-radius: var(--r-2xs);
  background: var(--paper-white);
  border: 1px solid var(--rule-strong);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--ink-obsidian);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rp-vault-meta {
  flex: 1;
  min-width: 0;
}

.rp-vault-meta strong {
  display: block;
  font-size: 0.81rem;
  font-weight: 700;
  color: var(--ink-obsidian);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-vault-meta span {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rp-vault-ready {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: var(--signal-emerald-tint);
  border: 1px solid var(--signal-emerald-border);
  color: var(--signal-emerald);
  font-size: 0.67rem;
  font-weight: 800;
  flex-shrink: 0;
}

.rp-login-quote {
  padding: 0.95rem 1.1rem;
  border-radius: var(--r-md);
  background: var(--paper-white);
  border: 1px solid var(--rule-line);
}

.rp-login-quote p {
  margin: 0.45rem 0 0.7rem;
  font-size: 0.83rem;
  line-height: 1.48;
  color: var(--ink-body);
}

.rp-login-quote-author {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.rp-login-quote-author img {
  width: 34px;
  height: 34px;
  border-radius: var(--r-2xs);
  object-fit: cover;
  border: 1px solid var(--rule-strong);
}

.rp-login-quote-author strong {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-obsidian);
}

.rp-login-quote-author span {
  display: block;
  font-size: 0.7rem;
  color: var(--ink-muted);
}

@media (max-width: 940px) {
  .rp-login-shell {
    grid-template-columns: minmax(0, 1fr);
  }
  .rp-login-form-pane {
    border-right: 0;
    border-bottom: 1px solid var(--rule-line);
    padding: 1.15rem 1rem 1.55rem;
  }
  .rp-login-box {
    margin: 1.25rem auto;
  }
  .rp-login-showcase {
    padding: 1.65rem 1rem 2.2rem;
  }
  .rp-vault-perks {
    grid-template-columns: 1fr;
  }
}

/* ==================== AUTH GATES, POST-INTERACTION VALIDATION & CHIPS ==================== */
.rp-auth-wrap {
  max-width: 440px;
  margin: clamp(1rem, 5vh, 3.5rem) auto;
  background: var(--paper-white);
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  padding: clamp(1.5rem, 4vw, 2.2rem);
}

.rp-auth-h1 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.028em;
  margin-bottom: 0.35rem;
}

.rp-auth-sub {
  margin: 0 0 1.3rem;
  font-size: 0.89rem;
  color: var(--ink-body);
}

:is(:user-invalid, .user-invalid-fallback) {
  border-color: var(--signal-crimson) !important;
  background-color: var(--signal-crimson-tint);
}

.rp-field-err-msg {
  display: none;
  margin-top: 0.28rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--signal-crimson);
}

:is(:user-invalid, .user-invalid-fallback) ~ .rp-field-err-msg {
  display: block;
}

.rp-notice-ok {
  padding: 0.65rem 0.85rem;
  border-radius: var(--r-sm);
  background: var(--signal-emerald-tint);
  border: 1px solid var(--signal-emerald-border);
  color: #065F46;
  font-size: 0.83rem;
  font-weight: 600;
  margin-bottom: 0.9rem;
}

/* ==================== WORKSPACE, EMPTY STATE & UPSELL ==================== */
.rp-card-box {
  background: var(--paper-white);
  border: 1px solid var(--rule-line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xs);
  padding: clamp(1.15rem, 2.4vw, 1.6rem);
  margin-bottom: 1.2rem;
}

.rp-ws-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.rp-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  font-size: 0.73rem;
  font-weight: 700;
  background: var(--signal-emerald-tint);
  border: 1px solid var(--signal-emerald-border);
  color: var(--signal-emerald);
}

.rp-status-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.rp-status-chip.is-blue {
  background: var(--accent-cobalt-tint);
  border-color: var(--accent-cobalt-border);
  color: var(--accent-cobalt);
}

.rp-status-chip.is-warn {
  background: var(--signal-amber-tint);
  border-color: #FCD34D;
  color: var(--signal-amber);
}

.rp-status-chip.is-gray {
  background: var(--paper-parchment);
  border-color: var(--rule-strong);
  color: var(--ink-body);
}

/* Isometric Empty Tray State (#39677 @navedux Adapted) */
.rp-empty-illos {
  padding: 2.2rem 1.25rem;
  text-align: center;
  background: var(--paper-ivory);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--r-md);
}

.rp-empty-illos svg {
  width: 100%;
  max-width: 280px;
  height: auto;
  margin: 0 auto 0.85rem;
  display: block;
}

.rp-empty-illos h3 {
  font-size: 1.02rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.rp-empty-illos p {
  margin: 0 auto 1rem;
  font-size: 0.85rem;
  color: var(--ink-body);
  max-width: 40ch;
}

/* Upsell Special Layout */
.rp-upsell-wrap {
  max-width: 680px;
  margin: 0 auto;
}

.rp-upsell-confirmed {
  background: var(--signal-emerald-tint);
  border: 1px solid var(--signal-emerald-border);
  border-radius: var(--r-md);
  padding: 1.2rem 1.35rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.rp-upsell-offer {
  background: var(--paper-white);
  border: 1.5px solid var(--ink-obsidian);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-hero);
  padding: clamp(1.35rem, 3.2vw, 2.1rem);
}

.rp-upsell-kicker {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--r-2xs);
  background: var(--paper-parchment);
  border: 1px solid var(--rule-strong);
  font-family: var(--font-mono);
  color: var(--ink-obsidian);
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
}

.rp-check-list {
  list-style: none;
  padding: 0;
  margin: 1rem 0 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.58rem;
}

.rp-check-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: var(--ink-obsidian);
  font-weight: 600;
}

.rp-check-list li svg {
  color: var(--signal-emerald);
  flex-shrink: 0;
  margin-top: 3px;
}

/* Legal Document Typography */
.rp-legal-doc {
  max-width: 760px;
  margin: 0 auto;
  background: var(--paper-white);
  border: 1px solid var(--rule-line);
  border-radius: var(--r-md);
  padding: clamp(1.5rem, 4vw, 2.65rem);
}

.rp-legal-doc h1 {
  font-size: clamp(1.55rem, 2.8vw, 2.05rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}

.rp-legal-doc h2 {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 1.55rem 0 0.45rem;
}

.rp-legal-doc p,
.rp-legal-doc li {
  font-size: 0.91rem;
  color: var(--ink-body);
  line-height: 1.64;
}

/* ==================== EDITORIAL DATA TABLES (#33506 @uvain + @container) ==================== */
.rp-table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(560px, 78vh);
  container-type: inline-size;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-sm);
  background: var(--paper-white);
}

.rp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
}

.rp-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  background: var(--paper-parchment);
}

.rp-table th,
.rp-table td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--rule-line);
  vertical-align: middle;
}

.rp-table thead th {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  white-space: nowrap;
}

.rp-table tbody th {
  position: sticky;
  inset-inline-start: 0;
  background: var(--paper-white);
  font-weight: 700;
  color: var(--ink-obsidian);
  z-index: 1;
}

.rp-table tbody tr:hover th,
.rp-table tbody tr:hover td {
  background: var(--paper-ivory);
}

.rp-table tbody tr:last-child th,
.rp-table tbody tr:last-child td {
  border-bottom: 0;
}

@container (width < 460px) {
  .rp-table,
  .rp-table thead,
  .rp-table tbody,
  .rp-table tr,
  .rp-table th,
  .rp-table td {
    display: block;
  }

  .rp-table thead { display: none; }

  .rp-table tbody tr {
    margin: 0.6rem;
    border: 1px solid var(--rule-strong);
    border-radius: var(--r-xs);
    overflow: hidden;
  }

  .rp-table tbody th {
    position: static;
    background: var(--paper-parchment);
    border-bottom: 1px solid var(--rule-line);
    padding: 0.58rem 0.78rem;
  }

  .rp-table td {
    padding: 0.48rem 0.78rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    text-align: right;
  }

  .rp-table td::before {
    content: attr(data-label);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.71rem;
    color: var(--ink-muted);
    text-align: left;
  }
}

/* ==================== EXECUTIVE ADMIN COMMAND CENTER (/admin/) ==================== */
.rp-admin-layout {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  background: var(--paper-ivory);
}

.rp-admin-sidebar {
  background: var(--ink-obsidian);
  color: var(--paper-white);
  padding: 1.2rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  position: sticky;
  top: 0;
  height: 100dvh;
}

.rp-admin-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.4rem 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.rp-admin-tag {
  padding: 2px 6px;
  border-radius: var(--r-2xs);
  background: var(--accent-cobalt);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
}

.rp-admin-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.rp-admin-tab {
  width: 100%;
  min-height: 40px;
  padding: 0.5rem 0.72rem;
  border-radius: var(--r-xs);
  border: 0;
  background: transparent;
  color: #CBD5E1;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.rp-admin-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}

.rp-admin-tab.is-active {
  background: var(--paper-white);
  color: var(--ink-obsidian);
  font-weight: 800;
}

.rp-admin-content {
  padding: clamp(1.1rem, 2.4vw, 1.9rem);
  min-width: 0;
}

.rp-admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.rp-admin-h1 {
  font-size: clamp(1.32rem, 2.1vw, 1.68rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.rp-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.rp-kpi-card {
  background: var(--paper-white);
  border: 1px solid var(--rule-line);
  border-radius: var(--r-sm);
  padding: 0.95rem 1.05rem;
  box-shadow: var(--shadow-xs);
}

.rp-kpi-lbl {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 0.28rem;
}

.rp-kpi-val {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink-obsidian);
}

.rp-kpi-sub {
  font-size: 0.74rem;
  color: var(--ink-body);
  margin-top: 0.2rem;
}

.rp-admin-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.rp-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.rp-inline-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.rp-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem;
}

/* Tactile Coss Switch Row (#11654 Adapted) */
.rp-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--r-sm);
  background: var(--paper-ivory);
  border: 1px solid var(--rule-line);
  cursor: pointer;
}

.rp-switch-row input[type="checkbox"] {
  width: 38px;
  height: 22px;
  accent-color: var(--ink-obsidian);
  cursor: pointer;
  flex-shrink: 0;
}

.rp-tag-blue {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent-cobalt);
  margin-left: 4px;
}

@media (max-width: 960px) {
  .rp-admin-layout {
    grid-template-columns: 1fr;
  }
  .rp-admin-sidebar {
    position: static;
    height: auto;
  }
  .rp-admin-nav {
    flex-direction: row;
    overflow-x: auto;
  }
  .rp-admin-tab {
    width: auto;
    white-space: nowrap;
  }
  .rp-kpi-grid,
  .rp-admin-split,
  .rp-settings-grid {
    grid-template-columns: 1fr;
  }
}
