/* MediTime — стилі сайту для родичів. Мобільний і десктопний вигляд. */

:root {
  --brand: #2f62d8;
  --brand-deep: #1e3a8a;
  --brand-soft: #e8eefc;
  --taken: #12996b;
  --taken-soft: #e3f6ee;
  --missed: #d8453a;
  --missed-soft: #fdeae8;
  --upcoming: #d9971b;
  --upcoming-soft: #fdf3e0;
  --bg: #f6f8fc;
  --panel: #ffffff;
  --fg: #1f2a44;
  --muted: #6b7488;
  --border: #e3e8f2;
  --radius: 18px;
  --shadow: 0 12px 32px rgba(24, 40, 80, 0.08);
  --container: 1120px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
  font-weight: 700;
}

h1 {
  font-size: clamp(28px, 5vw, 44px);
}

h2 {
  font-size: clamp(22px, 3.4vw, 32px);
}

h3 {
  font-size: clamp(18px, 2.4vw, 22px);
}

p {
  margin: 0;
}

ul {
  margin: 0;
  padding-left: 20px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.center {
  text-align: center;
}

.hidden {
  display: none !important;
}

/* ---------- Шапка ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--fg);
}

.brand:hover {
  text-decoration: none;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.brand-name {
  font-size: 18px;
  letter-spacing: -0.2px;
}

.brand-beta {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 2px 8px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 10px;
}

.site-nav a:hover {
  color: var(--brand);
  background: var(--brand-soft);
  text-decoration: none;
}

.site-nav a.is-active {
  color: var(--brand);
  background: var(--brand-soft);
}

/* ---------- Кнопки і поля ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: var(--brand);
  color: #fff;
  transition:
    filter 0.2s ease,
    background 0.2s ease;
}

.btn:hover {
  filter: brightness(1.06);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn-ghost {
  background: #fff;
  color: var(--brand);
  border-color: var(--border);
}

.btn-soft {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.btn-light {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-sm {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 12px;
}

.btn-block {
  width: 100%;
}

label.field {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

input[type='text'],
input[type='url'],
input[type='password'] {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--fg);
  background: #fff;
}

input:focus {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.code-input {
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 600;
}

/* ---------- Секції ---------- */

.hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
  padding: 48px 0 56px;
}

.hero-grid {
  display: grid;
  gap: 28px;
  align-items: start;
}

.hero h1,
.hero h2 {
  color: #fff;
}

.hero p {
  color: rgba(255, 255, 255, 0.88);
  max-width: 560px;
}

.hero .card {
  color: var(--fg);
}

.hero .card h3,
.hero .card .muted {
  color: var(--fg);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-elevated {
  box-shadow: var(--shadow);
  border-color: transparent;
}

.section {
  padding: 48px 0;
}

.section-head {
  max-width: 640px;
  margin-bottom: 24px;
  display: grid;
  gap: 8px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--brand);
}

.grid {
  display: grid;
  gap: 16px;
}

.grid-2 {
  grid-template-columns: 1fr;
}

.grid-3 {
  grid-template-columns: 1fr;
}

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

.feature h3 {
  margin-bottom: 6px;
}

.feature-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  display: grid;
  place-items: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.step-number {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  margin-bottom: 10px;
}

/* ---------- Панель родича ---------- */

.stat {
  display: grid;
  gap: 4px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}

.stat-label {
  font-size: 13px;
  color: var(--muted);
}

.profile-card {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--brand);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.dose-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.dose-row:last-child {
  border-bottom: 0;
}

.dose-time {
  min-width: 56px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.dose-main {
  flex: 1;
  min-width: 0;
}

.dose-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.badge {
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 5px 10px;
  white-space: nowrap;
}

.badge-taken {
  background: var(--taken-soft);
  color: var(--taken);
}

.badge-skipped {
  background: var(--upcoming-soft);
  color: var(--upcoming);
}

.badge-missed {
  background: var(--missed-soft);
  color: var(--missed);
}

.badge-due {
  background: var(--brand-soft);
  color: var(--brand);
}

.badge-upcoming {
  background: #eef1f7;
  color: var(--muted);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.dot-brand {
  background: var(--brand);
}

.dot-taken {
  background: var(--taken);
}

.dot-missed {
  background: var(--missed);
}

.dot-upcoming {
  background: var(--upcoming);
}

.dot-deep {
  background: var(--brand-deep);
}

/* Календар */

.calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.calendar-title {
  font-weight: 700;
  text-transform: capitalize;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.calendar-weekday {
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  padding-bottom: 4px;
}

.calendar-day {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--fg);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.calendar-day.is-empty {
  border: 0;
  background: transparent;
  cursor: default;
}

.calendar-day.is-plain {
  color: var(--muted);
  font-weight: 500;
}

.calendar-day.is-taken {
  background: var(--taken-soft);
  border-color: var(--taken);
  color: var(--taken);
}

.calendar-day.is-partial {
  background: var(--upcoming-soft);
  border-color: var(--upcoming);
  color: var(--upcoming);
}

.calendar-day.is-missed {
  background: var(--missed-soft);
  border-color: var(--missed);
  color: var(--missed);
}

.calendar-day.is-planned {
  background: var(--brand-soft);
  border-color: var(--brand-soft);
  color: var(--brand-deep);
}

.calendar-day.is-selected {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
}

td:first-child,
th:first-child {
  white-space: normal;
  min-width: 160px;
}

.saved-code {
  display: flex;
  align-items: center;
  gap: 8px;
}

.saved-code button.pick {
  flex: 1;
  text-align: left;
  background: var(--brand-soft);
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  font-family: inherit;
  cursor: pointer;
  color: var(--brand-deep);
  font-weight: 600;
}

.saved-code button.drop {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  color: var(--missed);
  font-family: inherit;
}

.notice {
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
}

.notice-error {
  background: var(--missed-soft);
  color: #8f2b23;
}

.notice-info {
  background: var(--brand-soft);
  color: var(--brand-deep);
}

.spinner {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 3px solid var(--brand-soft);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

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

pre.snippet {
  background: #0f172a;
  color: #e6edff;
  border-radius: 14px;
  padding: 14px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.5;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: #fff;
  padding: 28px 0;
  margin-top: 12px;
}

.site-footer .container {
  display: grid;
  gap: 10px;
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.stack {
  display: grid;
  gap: 12px;
}

.stack-sm {
  display: grid;
  gap: 8px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.space-between {
  justify-content: space-between;
}

@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .hero {
    padding: 64px 0 72px;
  }

  .hero-grid {
    grid-template-columns: 1.15fr 0.85fr;
    gap: 40px;
  }

  .section {
    padding: 64px 0;
  }
}
