:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17324d;
  background: #f3f8fa;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(38, 138, 145, 0.13), transparent 34rem),
    #f3f8fa;
}

button,
input,
select,
textarea {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.portal-page {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 14px 48px;
}

.portal-card {
  overflow: hidden;
  border: 1px solid #d8e6eb;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(23, 50, 77, 0.09);
}

.brand {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 18px;
  padding: 22px 20px;
  border-bottom: 1px solid #e1ebef;
  background: #fbfdfd;
}

.brand-copy {
  min-width: 0;
}

.clinic-name {
  margin: 0 0 5px;
  color: #983333;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.clinic-contact {
  display: grid;
  gap: 2px;
  margin-top: 13px;
  color: #607888;
  font-size: 11px;
  line-height: 1.4;
}

.clinic-contact span {
  overflow-wrap: anywhere;
}

.brand-logo {
  display: block;
  width: min(210px, 68%);
  height: auto;
  object-fit: contain;
}

h1,
h2,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  color: #102f48;
  font-size: 24px;
  line-height: 1.15;
}

h2 {
  margin: 0 0 10px;
  color: #17324d;
  font-size: 19px;
  line-height: 1.3;
}

p {
  margin: 0;
  color: #526b7b;
  line-height: 1.55;
}

.state-panel {
  padding: 42px 22px;
  text-align: center;
}

.state-panel p {
  max-width: 520px;
  margin-right: auto;
  margin-left: auto;
}

.state-panel .button {
  margin-top: 24px;
}

.state-panel.compact {
  padding-top: 52px;
  padding-bottom: 52px;
}

.state-panel.neutral,
.state-panel.error {
  margin: 22px;
  padding: 28px 18px;
  border-radius: 14px;
  background: #f4f8f9;
}

.state-panel.error {
  border: 1px solid #efd8d5;
  background: #fff8f7;
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 18px;
  border: 3px solid #c8dfe2;
  border-top-color: #176f76;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
    border-color: #176f76;
  }
}

.button {
  min-height: 46px;
  padding: 11px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.2;
}

.button:focus-visible {
  outline: 3px solid rgba(23, 111, 118, 0.28);
  outline-offset: 3px;
}

.button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.button-primary {
  background: #176f76;
  color: #ffffff;
}

.button-primary:hover:not(:disabled) {
  background: #115b61;
}

.button-secondary {
  border-color: #b9cdd5;
  background: #ffffff;
  color: #264e62;
}

.button-secondary:hover:not(:disabled) {
  background: #edf5f6;
}

.account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid #e1ebef;
}

.account-copy {
  min-width: 0;
}

.account-label,
.account-value {
  display: block;
}

.account-label {
  color: #607888;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.account-value {
  margin-top: 2px;
  color: #17324d;
  font-size: 14px;
  font-weight: 650;
}

.content-section {
  padding: 24px 20px;
}

.content-section + .content-section {
  border-top: 1px solid #e1ebef;
}

.patient-list,
.booking-list,
.package-list {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.patient-card,
.booking-card,
.package-card {
  border: 1px solid #d8e6eb;
  border-radius: 12px;
  background: #fbfdfd;
}

.patient-card {
  padding: 14px 16px;
}

.patient-name {
  color: #17324d;
  font-weight: 750;
}

.patient-detail {
  margin-top: 4px;
  color: #607888;
  font-size: 14px;
}

.booking-groups {
  display: grid;
  gap: 22px;
  margin-top: 16px;
}

.booking-group-title {
  margin: 0;
  color: #31596c;
  font-size: 15px;
}

.booking-card {
  padding: 15px 16px;
}

.booking-service {
  color: #17324d;
  font-size: 16px;
  font-weight: 750;
}

.booking-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 12px;
  margin-top: 10px;
  color: #526b7b;
  font-size: 14px;
}

.booking-status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #dff2eb;
  color: #176148;
  font-size: 13px;
  font-weight: 750;
}

.empty-bookings {
  padding: 18px;
  border: 1px dashed #bdcfd6;
  border-radius: 12px;
  background: #fbfdfd;
  text-align: center;
}

.package-group + .package-group {
  margin-top: 22px;
}

.package-group-title {
  margin: 16px 0 0;
  color: #31596c;
  font-size: 15px;
}

.package-card {
  min-width: 0;
  padding: 15px 16px;
}

.package-name {
  color: #17324d;
  font-size: 16px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.package-validity {
  margin-top: 7px;
  color: #526b7b;
  font-size: 14px;
}

.package-sessions {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  color: #31596c;
  font-size: 14px;
  font-weight: 650;
}

.section-message {
  margin-top: 14px;
  padding: 18px;
  border: 1px dashed #bdcfd6;
  border-radius: 12px;
  background: #fbfdfd;
  text-align: center;
}

.section-message-error {
  border-color: #d8e6eb;
  background: #f4f8f9;
}

@media (min-width: 600px) {
  .portal-page {
    padding-top: 44px;
  }

  .brand,
  .account-bar,
  .content-section {
    padding-right: 30px;
    padding-left: 30px;
  }

  .state-panel {
    padding-right: 34px;
    padding-left: 34px;
  }

  .brand {
    grid-template-columns: minmax(0, 1fr) minmax(190px, 240px);
    gap: 30px;
  }

  .brand-logo {
    width: 100%;
    margin-top: 2px;
  }
}
