/* Rentrexa tenant portal — layered on top of styles.css. Mobile-first. */

/* Background art: bg-waves-2.svg (bottom waves). Swap to bg-waves.svg for the corner-swoosh design. */
body.tenant-portal { background: #f3f5fa url('/assets/bg-waves-2.svg') center bottom / cover no-repeat fixed; }

/* ---------- Header & tabs ---------- */
.t-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.t-header-in { max-width: 980px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.t-brand img { height: 24px; display: block; }
.t-icon-btn { position: relative; color: var(--ink-2); padding: 7px; border-radius: 10px; display: grid; place-items: center; }
.t-icon-btn:hover { background: var(--bg); }
.t-icon-btn svg { width: 22px; height: 22px; }
.t-avatar { background: var(--brand); color: #fff; text-decoration: none; width: 34px; height: 34px; }
.t-avatar:hover { text-decoration: none; }
i.dot {
  position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px;
  background: var(--bad); color: #fff; border-radius: 99px; font-size: 10.5px; font-style: normal; font-weight: 700;
  display: grid; place-items: center; border: 2px solid #fff;
}

.t-tabs-top { display: none; }
.t-tabs-bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.t-tabs-bottom a {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 11.5px; font-weight: 600; color: var(--muted); text-decoration: none; padding: 4px 0; border-radius: 10px;
}
.t-tabs-bottom a svg { width: 22px; height: 22px; }
.t-tabs-bottom a.active { color: var(--brand); }
.t-tabs-bottom a.active svg { stroke-width: 2.3; }
.t-tabs-bottom i.dot { top: 0; right: calc(50% - 20px); }

/* "Light up" on the active tab: a glowing blue lamp on the bar's edge with a beam falling on the tab. */
.t-tabs-bottom a > *, .t-tabs-top a > * { position: relative; z-index: 1; }
.t-tabs-bottom a.active::before, .t-tabs-top a.active::before {
  content: ''; position: absolute; left: 50%; width: 38px; height: 4px; margin-left: -19px; z-index: 2;
  background: var(--brand); box-shadow: 0 0 10px 2px rgba(23, 61, 237, 0.75), 0 0 22px 6px rgba(23, 61, 237, 0.28);
  animation: lamp-on 0.35s ease-out;
}
.t-tabs-bottom a.active::after, .t-tabs-top a.active::after {
  content: ''; position: absolute; left: 50%; width: 68px; margin-left: -34px; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(23, 61, 237, 0.26) 0%, rgba(23, 61, 237, 0.08) 60%, rgba(23, 61, 237, 0) 100%);
  clip-path: polygon(30% 0, 70% 0, 100% 100%, 0 100%);
  animation: beam-on 0.45s ease-out;
}
.t-tabs-bottom a.active::before { top: -7px; border-radius: 0 0 5px 5px; }
.t-tabs-bottom a.active::after { top: -3px; height: calc(100% + 3px); }
.t-tabs-bottom a.active svg { filter: drop-shadow(0 0 5px rgba(23, 61, 237, 0.4)); }
@keyframes lamp-on { from { opacity: 0; transform: scaleX(0.3); } to { opacity: 1; transform: none; } }
@keyframes beam-on { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .t-tabs-bottom a.active::before, .t-tabs-bottom a.active::after, .t-tabs-top a.active::before, .t-tabs-top a.active::after { animation: none; }
}

.t-main { max-width: 760px; margin: 0 auto; padding: 18px 16px 100px; }
.t-title { font-size: 22px; margin-bottom: 14px; }
.t-back { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }

/* ---------- Home ---------- */
.t-greet { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.t-greet h1 { font-size: 23px; }
.t-greet .pill { align-self: flex-start; }
.t-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.t-actions a {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 8px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  font-size: 12.5px; font-weight: 600; color: var(--ink); text-decoration: none; box-shadow: var(--shadow);
}
.t-actions a:hover { border-color: var(--brand); text-decoration: none; }
.t-actions .icon-dot { width: 42px; height: 42px; border-radius: 13px; }
.t-actions .icon-dot svg { width: 20px; height: 20px; }
.t-actions i.dot { top: 8px; right: 8px; }

/* ---------- Choice tiles ---------- */
.t-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.t-choices-4 { grid-template-columns: repeat(4, 1fr); }
.t-choices label, .t-cats label {
  border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; background: #fff;
}
.t-choices input, .t-cats input { position: absolute; opacity: 0; pointer-events: none; }
.t-choices label:has(input:checked), .t-cats label:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.t-choices label:has(input:focus-visible), .t-cats label:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.t-choices b { display: block; font-size: 13.5px; }
.t-choices span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.t-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.t-cats label { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 12px 6px; }
.t-cats svg { width: 22px; height: 22px; color: var(--brand); }

/* ---------- Profile ---------- */
.t-profile { display: flex; align-items: center; gap: 14px; }
.t-menu { display: flex; align-items: center; gap: 14px; padding: 15px 18px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line-2); }
.t-menu:last-child { border-bottom: 0; }
.t-menu:hover { background: var(--brand-50); text-decoration: none; }
.t-menu > svg:first-child { width: 22px; height: 22px; color: var(--brand); flex: none; }
.t-menu > svg:last-child { color: var(--muted); }

/* ---------- Messages ---------- */
.tenant-portal .messenger { height: calc(100vh - 200px); }
body.in-chat .t-main { padding-bottom: 76px; }

/* ---------- Auth ---------- */
.auth-tenant .auth-hero { background: linear-gradient(160deg, var(--brand) 0%, #1129b8 100%); }

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
  .t-tabs-bottom { display: none; }
  .t-tabs-top { display: flex; gap: 4px; align-self: stretch; }
  .t-tabs-top a {
    position: relative; display: flex; align-items: center; gap: 7px; padding: 0 13px; border-radius: 10px;
    font-weight: 600; font-size: 14px; color: var(--ink-2); text-decoration: none;
  }
  .t-tabs-top a svg { width: 18px; height: 18px; }
  .t-tabs-top a:hover { background: var(--bg); }
  .t-tabs-top a.active { color: var(--brand); }
  .t-tabs-top a.active:hover { background: none; }
  .t-tabs-top a.active::before { top: -10px; border-radius: 0 0 5px 5px; }
  .t-tabs-top a.active::after { top: -10px; height: calc(100% + 20px); width: 110%; left: -5%; margin-left: 0; clip-path: polygon(22% 0, 78% 0, 100% 100%, 0 100%); }
  .t-tabs-top i.dot { top: 2px; right: 0; }
  .t-main { padding: 28px 16px 60px; }
  .tenant-portal .messenger { height: calc(100vh - 150px); }
  body.in-chat .t-main { max-width: 980px; }
  .t-main:has(.messenger) { max-width: 980px; }
}

/* ---------- Small phones: chat takes the whole screen ---------- */
@media (max-width: 860px) {
  body.in-chat .t-main { padding: 0; max-width: none; }
  body.in-chat .t-main .messenger { height: calc(100dvh - 55px - 64px); border-radius: 0; border: 0; box-shadow: none; }
}
@media (max-width: 520px) {
  .t-actions { grid-template-columns: repeat(2, 1fr); }
  .t-choices, .t-choices-4 { grid-template-columns: 1fr 1fr; }
  .t-cats { grid-template-columns: repeat(2, 1fr); }
}

/* Welcome page (after signing a lease) */
.welcome-card .amount { font-size: 27px; line-height: 1.2; margin: 8px 0 6px; }
.welcome-card .note { font-size: 14px; line-height: 1.55; max-width: 560px; }
.welcome-facts .cell-sub { margin-bottom: 1px; }

/* Pay screen: the landlord's bank details for an EFT */
.t-sub { font-size: 16px; margin: 22px 0 10px; }
.t-bank { margin: 0; display: grid; gap: 10px; }
.t-bank > div { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.t-bank dt { color: var(--muted); font-size: 13px; }
.t-bank dd { margin: 0; display: flex; align-items: center; gap: 8px; font-weight: 600; text-align: right; }
.t-bank .ref { padding-top: 10px; border-top: 1px dashed var(--line); }
.t-bank .ref b { font-size: 17px; letter-spacing: 0.04em; color: var(--brand); }
