:root {
  --blue: #07569c;
  --dark: #073b68;
  --green: #4c8b2b;
  --orange: #f58216;
  --ink: #17202a;
  --muted: #667085;
  --line: #dae5ed;
  --bg: #eef6fb;
  --danger: #a73d22;
  --success: #167245;
  --shadow: 0 14px 40px rgba(7, 59, 104, 0.11);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(160deg, #e9f4fb, #f8fbf6 60%, #fff7ef);
  font:
    16px/1.5 Inter,
    Segoe UI,
    system-ui,
    sans-serif;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}
.network-status {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 10px 16px;
  text-align: center;
  color: #fff;
  background: var(--danger);
  font-weight: 800;
}
.portal-header {
  max-width: 980px;
  margin: 22px auto 0;
  padding: 22px 30px;
  background: #fff;
  border-radius: 22px;
  border-top: 5px solid var(--orange);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 26px;
}
.portal-header img {
  width: min(42%, 360px);
  max-height: 130px;
  object-fit: contain;
}
.portal-header span,
.eyebrow {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.13em;
}
.portal-header h1 {
  color: var(--dark);
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.15;
  margin: 5px 0;
}
.portal-header p {
  margin: 0;
  color: var(--muted);
}
main {
  max-width: 980px;
  margin: auto;
  padding: 18px;
}
.panel,
.account-view {
  background: #fff;
  border: 1px solid #e3ebf0;
  border-radius: 20px;
  padding: 26px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
h2,
h3 {
  color: var(--dark);
  margin: 5px 0 16px;
}
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.choice {
  border: 2px solid #d8e7f2;
  background: #f5faff;
  color: var(--dark);
  min-height: 170px;
  border-radius: 18px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}
.choice.frame {
  background: #f5faef;
  border-color: #dceacb;
}
.choice:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px #07569c1d;
}
.choice-icon {
  font-size: 38px;
  color: var(--orange);
}
.choice b {
  font-size: 21px;
}
.choice small {
  color: var(--muted);
  margin-top: 5px;
}
.install-app {
  display: block;
  width: 100%;
  min-height: 50px;
  margin-top: 18px;
  padding: 11px 18px;
  border-radius: 11px;
  color: #fff;
  background: var(--green);
}
.install-app:hover {
  background: #376d20;
}
.install-help {
  margin: 10px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.login-panel {
  max-width: 620px;
  margin: 0 auto 18px;
}
.login-panel label,
dialog label {
  display: block;
  font-weight: 750;
  color: var(--dark);
  margin: 14px 0;
}
input,
select,
button {
  font: inherit;
}
input,
select {
  display: block;
  width: 100%;
  min-height: 50px;
  margin-top: 6px;
  border: 1px solid #adc2d1;
  border-radius: 11px;
  padding: 11px 13px;
  background: #fff;
}
input:focus,
select:focus {
  outline: 3px solid #1683d52b;
  border-color: var(--blue);
}
button {
  border: 0;
  font-weight: 800;
  cursor: pointer;
}
.primary {
  width: 100%;
  min-height: 50px;
  padding: 11px 18px;
  background: var(--blue);
  color: #fff;
  border-radius: 11px;
}
.primary:hover {
  background: var(--dark);
}
.back,
.refresh {
  padding: 9px 13px;
  border-radius: 9px;
  background: #edf4f8;
  color: var(--dark);
}
.message {
  min-height: 24px;
  color: var(--danger);
  font-weight: 700;
}
.account-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}
.account-head {
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--dark), var(--blue));
  color: #fff;
}
.account-head h2 {
  color: #fff;
  margin: 0;
}
.account-head p {
  margin: 5px 0 0;
  opacity: 0.88;
}
.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 14px 0;
}
.summary-card {
  background: #f2f7fa;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.summary-card small {
  display: block;
  color: var(--muted);
}
.summary-card b {
  font-size: 20px;
  color: var(--dark);
}
.summary-card.due b {
  color: var(--danger);
}
.summary-card.paid b {
  color: var(--success);
}
.invoice {
  display: grid;
  grid-template-columns: 1fr 1.5fr auto;
  gap: 14px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.invoice:last-child {
  border-bottom: 0;
}
.invoice small {
  display: block;
  color: var(--muted);
}
.amounts {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.amounts span {
  font-size: 12px;
  color: var(--muted);
}
.amounts b {
  display: block;
  color: var(--ink);
  font-size: 15px;
}
.pay-button {
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--orange);
  color: #fff;
}
.paid-badge {
  color: var(--success);
  font-weight: 850;
  background: #e9f7ef;
  border-radius: 999px;
  padding: 8px 12px;
}
.frame-account {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.empty {
  padding: 18px;
  text-align: center;
  color: var(--muted);
  background: #f7fafc;
  border-radius: 12px;
}
dialog {
  width: min(92vw, 480px);
  border: 0;
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 30px 80px #001c3370;
}
dialog::backdrop {
  background: #062f507a;
  backdrop-filter: blur(3px);
}
dialog form {
  padding: 26px;
  position: relative;
}
.dialog-close {
  position: absolute;
  right: 14px;
  top: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 28px;
}
.payment-balance {
  padding: 13px;
  background: #fff5e9;
  border-radius: 11px;
  color: var(--danger);
  font-weight: 800;
}
footer {
  text-align: center;
  color: var(--muted);
  padding: 12px 18px 28px;
  font-size: 13px;
}
@media (max-width: 680px) {
  .portal-header {
    margin: 0;
    border-radius: 0 0 20px 20px;
    flex-direction: column;
    text-align: center;
    padding: 18px;
  }
  .portal-header img {
    width: 90%;
    max-height: 95px;
  }
  .portal-header h1 {
    font-size: 21px;
  }
  .portal-header p {
    font-size: 14px;
  }
  main {
    padding: 12px;
  }
  .panel,
  .account-view {
    padding: 18px;
    border-radius: 16px;
  }
  .choice-grid,
  .summary {
    grid-template-columns: 1fr;
  }
  .choice {
    min-height: 135px;
  }
  .account-nav {
    align-items: stretch;
  }
  .invoice {
    grid-template-columns: 1fr;
  }
  .pay-button {
    width: 100%;
    min-height: 46px;
  }
  .summary-card b {
    font-size: 18px;
  }
}
