/* MyMedeWeb — light, warm, clinical. Cream + brand blue + teal accents. */
:root {
  --bg: #FAF3E3;
  --surface: #FFFDF7;
  --surface-alt: #F5EDD9;
  --border: #E9DFC6;
  --ink: #2B2620;
  --muted: #7A6F5E;
  --blue: #1D6ED6;
  --blue-dark: #155BB5;
  --blue-soft: #E3EEFB;
  --teal: #14B8A6;
  --teal-soft: #DFF7F3;
  --danger: #C0392B;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(60, 45, 20, 0.08);
}
* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0 0 0.5em; line-height: 1.15; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
a { color: var(--blue); }

/* Header */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-logo { width: 34px; height: 34px; }
.brand-word { font-weight: 900; font-size: 1.35rem; letter-spacing: -0.01em; display: flex; align-items: center; }
.word-e { width: 1.05em; height: 1.05em; margin: 0 0.02em; }
.site-nav { display: flex; align-items: center; gap: 10px; }
.nav-user { font-weight: 700; color: var(--muted); }
.linklike { background: none; border: none; color: var(--blue); font: inherit; font-weight: 800; cursor: pointer; padding: 8px 10px; border-radius: 10px; }
.linklike:hover { background: var(--blue-soft); }

/* Buttons */
.btn {
  font: inherit; font-weight: 800; border: none; border-radius: 999px;
  padding: 13px 30px; cursor: pointer; transition: transform .06s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 6px 18px rgba(29, 110, 214, 0.35); }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary { background: var(--surface); color: var(--ink); border: 2px solid var(--border); }
.btn-secondary:hover { border-color: var(--blue); color: var(--blue); }
.btn-block { width: 100%; margin-top: 6px; }
.btn-sm { padding: 9px 22px; font-size: .95rem; }
.btn-danger { background: #FBE9E6; color: var(--danger); border-radius: 10px; padding: 8px 14px; font-size: .9rem; }
.btn-danger:hover { background: #F6D5CF; }

/* Brand blue "e" inside MyMedeWeb wordmarks written in text */
.blue-e { color: var(--blue); }

/* Hero */
.hero { padding: 28px 28px 20px; }
.hero-inner { max-width: 880px; margin: 0 auto; text-align: center; }
.hero-logo {
  width: min(370px, 100%); height: auto; display: block;
  margin: 0 auto 14px; filter: drop-shadow(0 12px 28px rgba(29, 110, 214, 0.14));
}
.hero-headline {
  font-size: 1.9rem; font-weight: 900; letter-spacing: -0.02em;
  text-wrap: balance; max-width: 22em; margin: 0 auto 0.4em;
}
.tagline { font-size: 1.05rem; color: var(--muted); font-weight: 600; max-width: 36em; text-wrap: balance; margin: 0 auto 1em; }
.ekg { width: min(300px, 80%); height: 40px; margin: 8px auto; display: block; }
.trust-strip { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; font-weight: 700; color: var(--muted); }
.trust-item { display: inline-flex; align-items: center; gap: 6px; }
.trust-cross { color: var(--teal); font-weight: 900; font-size: 1.15em; }
.trust-sep { opacity: .5; }

/* Auth */
.auth-panel-wrap { max-width: 640px; margin: 0 auto; padding: 0 28px; }
.auth-panel {
  margin-top: 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  animation: slideDown .25s ease;
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.auth-form { padding: 26px; }
.auth-form h2 { font-size: 1.5rem; }
.auth-form label { display: block; font-weight: 800; font-size: .92rem; margin: 14px 0 0; }
.auth-form input[type="text"], .auth-form input[type="tel"],
.auth-form input[type="date"], .auth-form input[type="password"] {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px;
  font: inherit; border: 2px solid var(--border); border-radius: 12px; background: #fff;
}
.auth-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.consent { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 600 !important; color: var(--muted); font-size: .92rem; }
.consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--blue); flex: none; }
.form-error {
  background: #FBE9E6; color: var(--danger); border-radius: 10px;
  padding: 10px 14px; font-weight: 700; font-size: .92rem; margin: 12px 0 0;
}
.auth-alt { text-align: center; margin: 10px 0 0; }

/* Section cards */
.sections { max-width: 1080px; margin: 26px auto 0; padding: 0 28px; }
.sections h2, .how h2 { font-size: 1.6rem; text-align: center; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-top: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 16px; text-align: left; cursor: pointer; font: inherit; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .08s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); border-color: var(--blue); }
.card-icon { font-size: 1.7rem; }
.card-icon .card-img { width: 46px; height: 46px; display: block; }
.ph-icon .card-img { width: 64px; height: 64px; }
.card h3 { font-size: 1.05rem; margin: 10px 0 4px; }
.card p { font-size: .88rem; color: var(--muted); margin: 0 0 10px; }
.pill {
  display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  background: var(--blue-soft); color: var(--blue); border-radius: 999px; padding: 4px 12px;
}

/* How it works */
.how { max-width: 1080px; margin: 40px auto 0; padding: 0 28px 10px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; padding: 0; list-style: none; }
.steps li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.fineprint { font-size: .85rem; color: var(--muted); margin-top: 14px; text-align: center; max-width: 60em; margin-left: auto; margin-right: auto; }

/* App mode (signed in) */
.tab-bar { background: var(--surface); border-bottom: 1px solid var(--border); }
.tab-bar[hidden] { display: none; }
.tab-scroll {
  max-width: 1080px; margin: 0 auto; padding: 0 28px;
  display: flex; gap: 2px; overflow-x: auto;
}
.app-tab {
  background: none; border: none; font: inherit; font-weight: 800; font-size: .95rem;
  color: var(--muted); padding: 14px 16px 11px; cursor: pointer;
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.app-tab:hover { color: var(--ink); }
.app-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.app-wrap { max-width: 1080px; margin: 0 auto; padding: 36px 28px 20px; }
.app-placeholder { text-align: center; padding: 56px 20px; max-width: 560px; margin: 0 auto; }
.app-placeholder .ph-icon { font-size: 3rem; }
.app-placeholder h2 { font-size: 1.9rem; margin-top: 10px; }
.app-placeholder .pill { margin: 8px 0 12px; }

/* My Information */
.info-wrap { max-width: 640px; margin: 0 auto; }
.info-wrap > h2 { text-align: center; font-size: 1.7rem; }
.info-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 16px;
}
.info-card h3 { font-size: 1.15rem; margin-bottom: 2px; }
.info-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.info-row:last-of-type { border-bottom: none; }
.info-row > span { color: var(--muted); font-weight: 700; }
.info-row > strong { text-align: right; }
.info-actions { margin-top: 14px; display: flex; gap: 10px; }
.info-card .auth-form { padding: 0; }
.info-card label { display: block; font-weight: 800; font-size: .92rem; margin: 14px 0 0; }
.info-card input[type="text"], .info-card input[type="tel"],
.info-card input[type="date"], .info-card input[type="password"] {
  display: block; width: 100%; margin-top: 6px; padding: 12px 14px;
  font: inherit; border: 2px solid var(--border); border-radius: 12px; background: #fff;
}
.info-card input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }

/* My Records */
.demo-banner {
  background: var(--blue-soft); border: 1px solid #BFD9F5; color: var(--ink);
  border-radius: var(--radius); padding: 12px 18px; font-size: .92rem;
  margin-bottom: 18px; text-align: center;
}
.rec-tabs {
  display: flex; gap: 2px; overflow-x: auto; margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.rec-tab {
  background: none; border: none; font: inherit; font-weight: 800; font-size: .9rem;
  color: var(--muted); padding: 10px 14px 8px; cursor: pointer;
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.rec-tab:hover { color: var(--ink); }
.rec-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

.sum-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.sum-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.sum-card h3 { font-size: 1rem; margin-bottom: 8px; }
.sum-card ul { margin: 0; padding-left: 18px; font-size: .92rem; }
.sum-card li { margin-bottom: 4px; }

.rec-list { display: flex; flex-direction: column; gap: 10px; }
.rec-row {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; display: flex; align-items: center; gap: 14px;
}
.rec-row.clickable { cursor: pointer; text-align: left; font: inherit; color: var(--ink); width: 100%; }
.rec-row.clickable:hover { border-color: var(--blue); }
.rec-row .grow { flex: 1; min-width: 0; }
.rec-row h4 { margin: 0 0 2px; font-size: 1rem; }
.rec-row .sub { font-size: .85rem; color: var(--muted); }
.flag-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.flag-green { background: #2E7D32; }
.flag-yellow { background: #F9A825; }
.flag-red { background: #D32F2F; }
.flag-none { background: var(--border); }
.rec-value { font-weight: 900; font-size: 1.1rem; white-space: nowrap; }
.rec-actions { display: flex; gap: 8px; flex: none; }
.mini-btn {
  background: var(--blue-soft); color: var(--blue); border: none; border-radius: 999px;
  font: inherit; font-weight: 800; font-size: .8rem; padding: 7px 14px; cursor: pointer; white-space: nowrap;
}
.mini-btn:hover { background: #CFE3F8; }
.mini-btn.ghost { background: var(--surface-alt); color: var(--muted); }

.trend-wrap {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; margin: -4px 0 6px;
}
.trend-wrap h4 { margin-bottom: 6px; }
.hist-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: 10px; }
.hist-table th, .hist-table td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.hist-table th { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }

/* Modal */
.modal {
  position: fixed; inset: 0; background: rgba(43, 38, 32, 0.45);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal[hidden] { display: none; }
.modal-card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  max-width: 640px; width: 100%; max-height: 85vh; overflow-y: auto; padding: 28px; position: relative;
}
.modal-x {
  position: absolute; top: 12px; right: 12px; background: none; border: none;
  font-size: 1.4rem; cursor: pointer; color: var(--muted); padding: 6px 10px;
}
.modal-card h2 { font-size: 1.4rem; padding-right: 32px; }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: .92rem; margin: 12px 0; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; }
.report-text {
  background: var(--surface-alt); border-radius: 12px; padding: 16px;
  font-size: .9rem; white-space: pre-wrap; margin-top: 12px;
}
.flag-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; margin-top: 10px; }
.flag-legend span { display: inline-flex; align-items: center; gap: 6px; }

.device-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.device-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.device-card h4 { margin: 0 0 4px; }
.device-card .sub { font-size: .82rem; color: var(--muted); margin-bottom: 8px; }
.status-pill {
  display: inline-block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  border-radius: 999px; padding: 3px 10px; margin-bottom: 8px;
}
.status-connected { background: #E3F2E8; color: #2E7D32; }
.status-pending { background: #FFF4DE; color: #9A6B00; }
.connect-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.connect-opt {
  background: var(--surface); border: 2px solid var(--border); border-radius: 12px;
  padding: 14px 10px; font: inherit; font-weight: 800; font-size: .88rem; cursor: pointer; color: var(--ink);
}
.connect-opt:hover { border-color: var(--blue); color: var(--blue); }
.fit-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.fit-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.fit-card h3 { font-size: 1rem; margin-bottom: 4px; }
.fit-card .big { font-size: 1.6rem; font-weight: 900; }
.fit-card .unit { font-size: .85rem; color: var(--muted); font-weight: 700; }

/* Placeholder */
.placeholder { max-width: 560px; margin: 70px auto; text-align: center; padding: 0 24px; }
.ph-icon { font-size: 3rem; }
.placeholder h2 { font-size: 2rem; margin-top: 10px; }
.placeholder .pill { margin: 6px 0 12px; }

/* Admin */
.admin-wrap { max-width: 980px; margin: 40px auto; padding: 0 28px; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.admin-table th, .admin-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.admin-table th { background: var(--surface-alt); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.admin-table tr:last-child td { border-bottom: none; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .03em; }

.site-footer {
  margin-top: 60px; padding: 26px 28px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--muted); font-weight: 700; font-size: .9rem;
  background: var(--surface);
}

@media (max-width: 860px) {
  .hero-headline { font-size: 1.5rem; }
  .site-header { padding: 12px 16px; }
  .btn-sm { padding: 8px 16px; font-size: .88rem; }
  .hero, .sections, .how, .admin-wrap { padding-left: 16px; padding-right: 16px; }
  .auth-panel-wrap { padding: 0 16px; }
}
