/* Customer portal (/account). Brand colors are variables so a future
   per-company theme only has to override these. */
:root {
  --portal-primary: #125078;
  --portal-accent: #0D7F9F;
  --portal-highlight: #FC7701;
  --portal-bg: #f0f4f7;
  --portal-surface: #ffffff;
  --portal-border: #e8ecf0;
  --portal-text: #333333;
  --portal-muted: #888888;
  --portal-danger: #dc2626;
  --portal-success: #16a34a;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--portal-bg); color: var(--portal-text); min-height: 100vh;
}
.portal-wrap { max-width: 640px; margin: 0 auto; padding: 20px 16px 60px; }

.portal-header {
  background: linear-gradient(135deg, var(--portal-primary) 0%, var(--portal-accent) 100%);
  border-radius: 12px 12px 0 0; padding: 26px 24px; text-align: center;
}
.portal-header img {
  width: 60px; height: 60px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.3);
  background: #fff; display: block; margin: 0 auto 10px;
}
.portal-header h1 { color: #fff; font-family: 'Playfair Display', Georgia, serif; font-size: 1.3rem; font-weight: 700; }
.portal-header p { color: rgba(255,255,255,0.8); font-size: 0.82rem; margin-top: 4px; }

.portal-card {
  background: var(--portal-surface); border-radius: 0 0 12px 12px;
  box-shadow: 0 4px 24px rgba(18,80,120,0.08); overflow: hidden;
}
.portal-section { padding: 20px 24px; border-bottom: 1px solid var(--portal-border); }
.portal-section:last-child { border-bottom: none; }
.portal-title {
  font-size: 0.8rem; font-weight: 700; color: var(--portal-primary);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 12px;
}
.portal-lead { font-size: 0.95rem; line-height: 1.5; margin-bottom: 14px; }
.portal-muted { color: var(--portal-muted); font-size: 0.82rem; }

.portal-field { display: block; margin-bottom: 14px; }
.portal-field label { display: block; font-size: 0.8rem; font-weight: 600; margin-bottom: 5px; }
.portal-field input {
  width: 100%; padding: 12px 14px; font-size: 1rem; border: 1px solid #cfd8de;
  border-radius: 8px; font-family: inherit;
}
.portal-field input:focus { outline: 2px solid var(--portal-accent); border-color: var(--portal-accent); }
.portal-code-input { letter-spacing: 8px; text-align: center; font-size: 1.5rem !important; font-weight: 700; }

.portal-btn {
  display: block; width: 100%; text-align: center; text-decoration: none; cursor: pointer;
  background: var(--portal-accent); color: #fff; border: 0; border-radius: 8px;
  padding: 13px 18px; font-size: 1rem; font-weight: 600; font-family: inherit;
}
.portal-btn:hover { filter: brightness(0.95); }
.portal-btn.secondary { background: transparent; color: var(--portal-accent); border: 1px solid var(--portal-accent); }
.portal-btn.small { display: inline-block; width: auto; padding: 8px 14px; font-size: 0.85rem; }

.portal-alert { padding: 11px 14px; border-radius: 8px; font-size: 0.88rem; margin-bottom: 14px; }
.portal-alert.error { background: #fef2f2; color: var(--portal-danger); border: 1px solid #fecaca; }

.portal-topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.portal-topbar form { margin: 0; }
.portal-link-btn { background: none; border: 0; color: var(--portal-accent); font-size: 0.82rem; cursor: pointer; font-family: inherit; }

.portal-res { border: 1px solid var(--portal-border); border-radius: 10px; background: #fff; margin-bottom: 14px; overflow: hidden; }
.portal-res-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; background: #f8fafc; border-bottom: 1px solid var(--portal-border); }
.portal-res-num { font-weight: 700; color: var(--portal-primary); font-size: 0.9rem; }
.portal-note { margin: 0 16px; padding: 10px 12px; border-radius: 8px; background: #fff8e6; border: 1px solid #f3dca0; color: #7a5a00; font-size: 0.84rem; line-height: 1.45; }
.portal-res-actions { display: flex; gap: 10px; flex-wrap: wrap; padding: 14px 16px; }
.portal-res .pay-section { padding: 14px 16px; }
.portal-past > summary { cursor: pointer; font-size: 0.8rem; font-weight: 700; color: var(--portal-primary); text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 0 12px; }
.portal-past[open] > summary { margin-bottom: 0; }
.portal-res-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 4px; }
.portal-res-asset { font-weight: 700; color: var(--portal-primary); }
.portal-res-dates { font-size: 0.86rem; color: #555; }
.portal-badge { font-size: 0.7rem; font-weight: 700; padding: 3px 9px; border-radius: 20px; background: #e6f3f8; color: var(--portal-primary); white-space: nowrap; }
.portal-badge.due { background: #fff3e0; color: #b45309; }
.portal-badge.cancelled { background: #f3f4f6; color: #6b7280; }

.portal-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 0.92rem; }
.portal-row.total { border-top: 2px solid var(--portal-border); margin-top: 6px; padding-top: 10px; font-weight: 700; }
.portal-row .neg { color: var(--portal-success); }
.portal-balance { font-size: 1.15rem; font-weight: 700; color: var(--portal-highlight); }
.portal-empty { text-align: center; color: var(--portal-muted); padding: 10px 0; font-size: 0.9rem; }

.portal-header-link { color: inherit; text-decoration: none; display: block; }
.portal-footer { text-align: center; margin-top: 18px; font-size: 0.85rem; }
.portal-footer a { color: var(--portal-accent); text-decoration: none; font-weight: 600; }

.portal-alert.ok { background: #ecfdf3; color: #146c43; border: 1px solid #b7ebcb; margin-bottom: 0; }
.portal-card-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--portal-border); font-size: 0.92rem; }
.portal-card-actions { display: flex; gap: 14px; }
.portal-link-btn.danger { color: var(--portal-danger); }
.portal-panel { margin-top: 14px; padding: 14px; border: 1px solid var(--portal-border); border-radius: 10px; background: #f8fafc; }
.portal-stripe-field { border: 1px solid #b0cfe0; border-radius: 8px; padding: 14px; background: #fff; min-height: 46px; }
.portal-check { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; }
