/* ============================================================
   ReceiptRadar — Portal (login + dashboard)
   Loads after colors_and_type.css and uses its tokens; same
   "Soft Mint" direction as the homepage, app-chrome flavored.
   ============================================================ */

* { box-sizing: border-box; }

body.portal {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- Header ---------- */
.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rr-space-4);
  padding: var(--rr-space-4) clamp(20px, 4vw, 40px);
  background: var(--rr-card);
  border-bottom: 1px solid var(--rr-border);
}

.portal-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--rr-font-display);
  font-weight: 800;
  font-size: var(--rr-text-lg);
  letter-spacing: -0.02em;
  color: var(--rr-fg-1);
  text-decoration: none;
}

.portal-wordmark-accent { color: var(--rr-green); }

.portal-header-right {
  display: flex;
  align-items: center;
  gap: var(--rr-space-3);
  min-width: 0;
}

.portal-user-email {
  font-size: var(--rr-text-sm);
  color: var(--rr-fg-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Buttons ---------- */
.pt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: var(--rr-radius-pill);
  padding: 12px 22px;
  font-family: var(--rr-font-display);
  font-weight: 700;
  font-size: var(--rr-text-base);
  line-height: 1;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--rr-dur-fast) var(--rr-ease),
              border-color var(--rr-dur-fast) var(--rr-ease);
}

.pt-btn:focus-visible { outline: none; box-shadow: var(--rr-shadow-focus); }

.pt-btn--primary {
  background: var(--rr-sprout);
  color: var(--rr-fg-on-lime);
}
.pt-btn--primary:hover { background: var(--rr-sprout-hover); }

.pt-btn--ghost {
  background: transparent;
  border-color: var(--rr-border-strong);
  color: var(--rr-fg-1);
}
.pt-btn--ghost:hover { background: var(--rr-surface-2); }

.pt-btn--sm {
  padding: 8px 16px;
  font-size: var(--rr-text-sm);
}

/* ---------- Cards ---------- */
.pt-card {
  background: var(--rr-card);
  border: 1px solid var(--rr-border);
  border-radius: var(--rr-radius-xl);
  box-shadow: var(--rr-shadow-md);
  padding: clamp(24px, 4vw, 36px);
}

/* ---------- Auth pages (login, verify, onboarding) ---------- */
.auth-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(40px, 8vh, 96px) var(--rr-space-5) var(--rr-space-16);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  display: grid;
  gap: var(--rr-space-4);
}

.auth-title {
  font-size: var(--rr-text-3xl);
  letter-spacing: -0.02em;
}

/* ---------- Forms ---------- */
.pt-form {
  display: grid;
  gap: var(--rr-space-4);
  margin-top: var(--rr-space-2);
}

.pt-field { display: grid; gap: 6px; }

.pt-field label {
  font-weight: 600;
  font-size: var(--rr-text-sm);
  color: var(--rr-fg-1);
}

.pt-field input {
  width: 100%;
  border: 1px solid var(--rr-border-strong);
  border-radius: var(--rr-radius-md);
  background: var(--rr-card);
  padding: 12px 14px;
  font-family: var(--rr-font-body);
  font-size: var(--rr-text-base);
  color: var(--rr-fg-1);
}

.pt-field input::placeholder { color: var(--rr-fg-3); }

.pt-field input:focus-visible {
  outline: none;
  border-color: var(--rr-sprout);
  box-shadow: var(--rr-shadow-focus);
}

.pt-resend { display: grid; }

.pt-alert {
  margin: 0;
  padding: var(--rr-space-3) var(--rr-space-4);
  border: 1px solid var(--rr-alert-border);
  border-radius: var(--rr-radius-md);
  background: var(--rr-alert-bg);
  color: var(--rr-alert-text);
  font-size: var(--rr-text-sm);
}

/* ---------- Dashboard ---------- */
.dashboard-main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: var(--rr-space-8) var(--rr-space-5) var(--rr-space-16);
  display: grid;
  gap: var(--rr-space-5);
  align-content: start;
}

.address-card { display: grid; gap: var(--rr-space-2); }

.address-value {
  margin: 0;
  font-size: var(--rr-text-lg);
  color: var(--rr-green);
  word-break: break-all;
  background: var(--rr-sprout-soft);
  border-radius: var(--rr-radius-md);
  padding: var(--rr-space-3) var(--rr-space-4);
  width: fit-content;
  max-width: 100%;
}

.pending-note {
  margin: 0;
  padding: var(--rr-space-3) var(--rr-space-4);
  border: 1px solid var(--rr-warning-border);
  border-radius: var(--rr-radius-md);
  background: var(--rr-warning-bg);
  color: var(--rr-warning);
  font-size: var(--rr-text-sm);
}

.list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--rr-space-3);
  margin-bottom: var(--rr-space-4);
}

.receipt-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.receipt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rr-space-4);
  padding: var(--rr-space-3) 0;
  border-top: 1px solid var(--rr-border);
}

.receipt-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.receipt-retailer {
  font-weight: 600;
  color: var(--rr-fg-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt-meta {
  font-size: var(--rr-text-sm);
  color: var(--rr-fg-3);
}

.receipt-total {
  font-size: var(--rr-text-base);
  color: var(--rr-fg-1);
  white-space: nowrap;
}

.empty-state {
  margin: 0;
  color: var(--rr-fg-2);
  font-size: var(--rr-text-base);
}

.empty-state .rr-data {
  color: var(--rr-green);
  word-break: break-all;
}
