/* Heart 2 Heart customer portal */
.h2h-portal {
  --h2h-teal: #0f766e;
  --h2h-teal-dark: #115e59;
  --h2h-ink: #0f172a;
  --h2h-muted: #64748b;
  --h2h-border: #e2e8f0;
  --h2h-bg: #f0fdfa;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--h2h-ink);
  font-family: "Segoe UI", Georgia, "Times New Roman", serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(15, 118, 110, 0.18), transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(14, 116, 144, 0.12), transparent 50%),
    linear-gradient(180deg, #ecfeff 0%, #f8fafc 42%, #ffffff 100%);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

.h2h-portal a { color: var(--h2h-teal-dark); }
.h2h-portal__shell {
  max-width: min(1280px, 100%);
  margin: 0 auto;
  padding: max(1.25rem, env(safe-area-inset-top, 0px)) 1rem max(3rem, calc(1.5rem + env(safe-area-inset-bottom, 0px)));
  box-sizing: border-box;
}
@media (min-width: 1440px) {
  .h2h-portal__shell { max-width: 1440px; }
}
@media (min-width: 1920px) {
  .h2h-portal__shell { max-width: 1600px; }
}
.h2h-portal__top {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem;
}
.h2h-portal__brand { display: flex; gap: .85rem; align-items: center; }
.h2h-portal__brand img { width: 72px; height: auto; object-fit: contain; }
.h2h-portal__brand strong { display: block; font-size: 1.1rem; }
.h2h-portal__brand span { color: var(--h2h-muted); font-size: .92rem; }
.h2h-portal__nav { display: flex; flex-wrap: nowrap; gap: .35rem; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; padding-bottom: .15rem; }
.h2h-portal__nav a,
.h2h-portal__nav-link {
  text-decoration: none; font: 600 .82rem system-ui, sans-serif; color: #334155; white-space: nowrap;
  padding: .45rem .7rem; border-radius: 8px; background: rgba(255,255,255,.7); border: 1px solid var(--h2h-border);
  display: inline-flex; align-items: center; gap: .35rem;
}
.h2h-portal__nav a.is-active, .h2h-portal__nav a:hover,
.h2h-portal__nav-link.is-active, .h2h-portal__nav-link:hover { background: #0f766e; color: #fff; border-color: #115e59; }
.h2h-portal__nav-link:focus-visible { outline: 2px solid #0f766e; outline-offset: 2px; }

.h2h-portal__panel {
  background: #fff; border: 1px solid var(--h2h-border); border-radius: 14px;
  padding: 1.25rem 1.35rem; box-shadow: 0 10px 30px rgba(15, 23, 42, .06); margin-bottom: 1rem;
}
.h2h-portal__panel h1, .h2h-portal__panel h2 { margin: 0 0 .75rem; }
.h2h-portal__panel h1 { font-size: 1.55rem; color: var(--h2h-teal-dark); }
.h2h-portal__panel h2 { font-size: 1.15rem; }
.h2h-portal__muted { color: var(--h2h-muted); }

.h2h-portal__cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .85rem; margin-bottom: 1.25rem;
}
.h2h-portal__card {
  background: #fff; border: 1px solid var(--h2h-border); border-radius: 12px; padding: 1rem 1.1rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
}
.h2h-portal__card-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--h2h-muted); font-weight: 700; font-family: system-ui, sans-serif; }
.h2h-portal__card-value { font-size: 1.4rem; font-weight: 750; margin-top: .3rem; }

.h2h-portal__btn {
  display: inline-flex; align-items: center; gap: .4rem; padding: .6rem 1rem; border-radius: 8px;
  border: 1px solid transparent; font: 600 .92rem system-ui, sans-serif; text-decoration: none; cursor: pointer;
  background: #e2e8f0; color: #0f172a;
}
.h2h-portal__btn--primary { background: var(--h2h-teal); color: #fff; }
.h2h-portal__btn--primary:hover { background: var(--h2h-teal-dark); color: #fff; }
.h2h-portal__btn--secondary { background: #fff; border-color: var(--h2h-border); }

.h2h-portal__alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-family: system-ui, sans-serif; }
.h2h-portal__alert--ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.h2h-portal__alert--err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

.h2h-portal__form { display: grid; gap: .85rem; max-width: 420px; }
.h2h-portal__form label { display: block; font-size: .82rem; font-weight: 700; color: #334155; margin-bottom: .3rem; font-family: system-ui, sans-serif; }
.h2h-portal__form input, .h2h-portal__form select, .h2h-portal__form textarea {
  width: 100%; padding: .6rem .7rem; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; box-sizing: border-box;
}

.h2h-portal__table { width: 100%; border-collapse: collapse; font-size: .92rem; font-family: system-ui, sans-serif; }
.h2h-portal__table th, .h2h-portal__table td { padding: .65rem .5rem; border-bottom: 1px solid var(--h2h-border); text-align: left; }
.h2h-portal__table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--h2h-muted); }

.h2h-portal__auth {
  max-width: 460px; margin: 2.5rem auto; background: #fff; border: 1px solid var(--h2h-border);
  border-radius: 16px; padding: 1.75rem 1.5rem; box-shadow: 0 16px 40px rgba(15, 23, 42, .08);
}
.h2h-portal__auth-brand { text-align: center; margin-bottom: 1.25rem; }
.h2h-portal__auth-brand img { width: 110px; height: auto; object-fit: contain; }
.h2h-portal__auth-brand h1 { margin: .75rem 0 .25rem; font-size: 1.35rem; color: var(--h2h-teal-dark); }
.h2h-portal__auth-brand p { margin: 0; color: var(--h2h-muted); font-size: .95rem; }

.h2h-portal__charts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 1rem;
}
.h2h-portal__chart-wrap { text-align: center; }
.h2h-portal__donut {
  width: 160px; height: 160px; border-radius: 50%; margin: 0 auto .75rem;
  background: conic-gradient(var(--h2h-teal) 0 var(--p1, 40%), #99f6e4 var(--p1, 40%) var(--p2, 70%), #e2e8f0 var(--p2, 70%) 100%);
  mask: radial-gradient(circle 52px at center, transparent 98%, #000 100%);
  -webkit-mask: radial-gradient(circle 52px at center, transparent 98%, #000 100%);
}
.h2h-portal__chart-legend { font-size: .85rem; color: var(--h2h-muted); font-family: system-ui, sans-serif; line-height: 1.5; }

.h2h-portal__footer {
  margin-top: 2rem; text-align: center; color: var(--h2h-muted); font-size: .88rem; font-family: system-ui, sans-serif;
}

@media (max-width: 700px) {
  .h2h-portal__top { align-items: flex-start; flex-direction: column; }
  .h2h-portal__auth { margin: 1rem auto; width: calc(100% - 0.5rem); max-width: none; box-sizing: border-box; }
  .h2h-portal__form { max-width: none; }
  .h2h-portal__form input,
  .h2h-portal__form select,
  .h2h-portal__form textarea { font-size: 16px; }
  .h2h-portal__btn--primary { width: 100%; justify-content: center; min-height: 44px; }
  .h2h-portal__nav a,
  .h2h-portal__nav-link { min-height: 44px; }
  .h2h-portal__cards { grid-template-columns: 1fr; }
  .h2h-portal__table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .h2h-portal__table.h2h-table--cards thead { display: none; }
  .h2h-portal__table.h2h-table--cards tr {
    display: block; border: 1px solid var(--h2h-border); border-radius: 10px;
    margin-bottom: .75rem; padding: .75rem; background: #fff;
  }
  .h2h-portal__table.h2h-table--cards td {
    display: flex; justify-content: space-between; gap: .75rem;
    border: 0; padding: .3rem 0; text-align: right;
  }
  .h2h-portal__table.h2h-table--cards td::before {
    content: attr(data-label); font-weight: 700; color: var(--h2h-muted);
    text-align: left; flex: 0 0 40%;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  .h2h-portal__shell { padding-top: .75rem; padding-bottom: 1rem; }
  .h2h-portal__auth { margin: .5rem auto; padding: 1rem; }
}
