@font-face {
  font-family: "Rubik";
  src: url("/assets/fonts/Rubik-Regular.ttf") format("truetype");
  font-weight: 400;
}

@font-face {
  font-family: "Rubik";
  src: url("/assets/fonts/Rubik-Medium.ttf") format("truetype");
  font-weight: 500;
}

@font-face {
  font-family: "Unageo";
  src: url("/assets/fonts/UnageoBold-Regular.ttf") format("truetype");
  font-weight: 700;
}

:root {
  --brand-cyan: #49b8d7;
  --brand-magenta: #982c92;
  --brand-ink: #191b20;
  --brand-slate: #6f7583;
  --brand-line: rgba(25, 27, 32, 0.08);
  --brand-card: rgba(255, 255, 255, 0.9);
  --brand-bg: #eef4fb;
  --brand-shadow: 0 24px 60px rgba(25, 27, 32, 0.12);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Rubik", sans-serif;
  color: var(--brand-ink);
  background:
    radial-gradient(circle at top left, rgba(73, 184, 215, 0.22), transparent 30%),
    radial-gradient(circle at right 20%, rgba(152, 44, 146, 0.14), transparent 24%),
    linear-gradient(180deg, #f8fbff 0%, var(--brand-bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), transparent 45%),
    repeating-linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.12) 0,
      rgba(255, 255, 255, 0.12) 14px,
      transparent 14px,
      transparent 28px
    );
  opacity: 0.45;
}

.app-shell {
  position: relative;
  width: min(1220px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 20px 0 48px;
}

.topbar {
  padding: 6px 0 20px;
}

.brand-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(25, 27, 32, 0.08);
}

.brand-logo {
  width: min(420px, 100%);
  max-height: 54px;
  object-fit: contain;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-patient {
  color: white;
  background: linear-gradient(135deg, var(--brand-cyan), var(--brand-magenta));
}

.badge-doctor {
  color: white;
  background: linear-gradient(135deg, var(--brand-ink), var(--brand-magenta));
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}

.doctor-grid .hero-card,
.hero-card {
  grid-column: 1 / -1;
}

.panel,
.hero-card {
  border-radius: var(--radius-xl);
  background: var(--brand-card);
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: var(--brand-shadow);
  backdrop-filter: blur(20px);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 30px;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  width: 260px;
  min-width: 260px;
  align-self: stretch;
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(73, 184, 215, 0.9), rgba(152, 44, 146, 0.82)),
    url("/assets/img/logo-icon.svg") center/48% no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.hero-copy {
  max-width: 640px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand-magenta);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: "Unageo", sans-serif;
}

h1 {
  font-size: clamp(32px, 4vw, 54px);
  line-height: 0.96;
  letter-spacing: -0.03em;
}

h2 {
  font-size: 26px;
}

.hero-text,
.panel-note,
.inline-hint,
.meta-line,
.empty-state,
.history-meta {
  color: var(--brand-slate);
}

.hero-text {
  margin: 18px 0 0;
  font-size: 17px;
  line-height: 1.6;
}

.hero-status {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 190px;
  z-index: 1;
}

.status-chip {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--brand-line);
  background: rgba(255, 255, 255, 0.7);
}

.status-chip span {
  display: block;
  font-size: 13px;
  color: var(--brand-slate);
}

.status-chip strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.panel {
  padding: 24px;
}

#activationPanel,
#loginPanel {
  grid-column: span 4;
}

#currentDosePanel,
#detailPanel {
  grid-column: span 8;
}

#historyPanel,
#searchPanel,
#planPanel {
  grid-column: span 6;
}

.panel-accent {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 255, 0.88)),
    linear-gradient(145deg, rgba(73, 184, 215, 0.08), rgba(152, 44, 146, 0.08));
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-note {
  font-size: 14px;
}

.empty-state {
  padding: 22px;
  border: 1px dashed rgba(25, 27, 32, 0.16);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.62);
  line-height: 1.6;
}

.dose-card,
.history-item,
.pillbox-item,
.overview-card,
.photo-thumb {
  border-radius: var(--radius-lg);
  border: 1px solid var(--brand-line);
  background: rgba(255, 255, 255, 0.8);
}

.dose-card {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.dose-head,
.history-head,
.pillbox-head,
.overview-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.dose-main strong,
.history-main strong,
.pillbox-main strong {
  font-size: 22px;
}

.meta-line {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
}

.status-pending {
  background: rgba(73, 184, 215, 0.14);
  color: #0e6a84;
}

.status-taken {
  background: rgba(58, 177, 124, 0.16);
  color: #166744;
}

.status-skipped,
.status-missed {
  background: rgba(152, 44, 146, 0.14);
  color: #7c2375;
}

.stack-form {
  display: grid;
  gap: 14px;
}

.stack-form label {
  display: grid;
  gap: 8px;
  font-size: 14px;
  color: var(--brand-slate);
}

input,
button,
textarea {
  font: inherit;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="file"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(25, 27, 32, 0.14);
  background: rgba(255, 255, 255, 0.92);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

input:focus {
  outline: none;
  border-color: rgba(73, 184, 215, 0.9);
  transform: translateY(-1px);
}

.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 14px 18px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(25, 27, 32, 0.12);
}

.button-primary {
  color: white;
  background: linear-gradient(135deg, var(--brand-cyan), var(--brand-magenta));
}

.button-secondary {
  color: var(--brand-ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(25, 27, 32, 0.08);
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.history-list,
.pillbox-list,
.recent-grid {
  display: grid;
  gap: 12px;
}

.history-item,
.pillbox-item {
  padding: 16px 18px;
}

.pillbox-item {
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.pillbox-item:hover,
.pillbox-item.is-active {
  transform: translateY(-1px);
  border-color: rgba(73, 184, 215, 0.55);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.overview-card {
  padding: 16px;
}

.overview-card strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.photo-thumb {
  overflow: hidden;
}

.photo-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.photo-thumb span {
  display: block;
  padding: 10px 12px 12px;
  font-size: 13px;
  color: var(--brand-slate);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1080px) {
  #activationPanel,
  #currentDosePanel,
  #historyPanel,
  #loginPanel,
  #searchPanel,
  #detailPanel,
  #planPanel {
    grid-column: 1 / -1;
  }

  .hero-card {
    flex-direction: column;
  }

  .hero-card::after {
    width: 100%;
    min-width: 0;
    min-height: 180px;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 18px, 100%);
    padding-bottom: 24px;
  }

  .brand-line {
    border-radius: 26px;
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-card,
  .panel {
    padding: 20px;
    border-radius: 22px;
  }

  .toolbar,
  .actions-row {
    flex-direction: column;
  }

  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
