/* Taté Medical — Portal CTA, lead form and tracking UI
   Brand: #009CE0 (brand blue), #1B2A3A (navy), #2D3E4E (charcoal), Montserrat / Barlow */

:root {
  --tp-brand: #009ce0;
  --tp-brand-dark: #0083bd;
  --tp-navy: #1b2a3a;
  --tp-ink: #2d3e4e;
  --tp-line: #e6ebf1;
  --tp-wa: #25d366;
  --tp-wa-dark: #1da851;
  --tp-err: #c62f45;
  --tp-radius: 10px;
}

/* ---------- buttons ---------- */
.tp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border: 0; border-radius: 8px; cursor: pointer;
  font: 600 14px/1 Barlow, system-ui, sans-serif; letter-spacing: .02em; text-decoration: none;
  transition: background-color .15s, box-shadow .15s, transform .15s; white-space: nowrap;
}
.tp-btn:focus-visible { outline: 3px solid rgba(0, 156, 224, .45); outline-offset: 2px; }
.tp-btn-primary { background: var(--tp-brand); color: #fff; }
.tp-btn-primary:hover { background: var(--tp-brand-dark); }
.tp-btn-primary:disabled { opacity: .6; cursor: progress; }
.tp-btn-wa { background: var(--tp-wa); color: #fff; }
.tp-btn-wa:hover { background: var(--tp-wa-dark); }
.tp-btn-ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 1px currentColor; opacity: .9; }
.tp-btn-ghost:hover { opacity: 1; }

/* ---------- sticky bar ---------- */
.tp-bar {
  position: fixed; z-index: 9990; right: 20px; bottom: 20px;
  display: flex; gap: 10px; align-items: center;
}
.tp-bar .tp-btn { box-shadow: 0 8px 24px rgba(10, 25, 41, .28); min-height: 48px; border-radius: 999px; padding: 0 22px; }
.tp-bar-wa { padding: 0 18px !important; }
.tp-show-sm { display: none; }

@media (max-width: 767px) {
  .tp-bar {
    left: 0; right: 0; bottom: 0; gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .97); border-top: 1px solid var(--tp-line);
    box-shadow: 0 -6px 20px rgba(10, 25, 41, .12);
  }
  .tp-bar .tp-btn { box-shadow: none; border-radius: 8px; min-height: 46px; }
  .tp-bar-main { flex: 1; }
  .tp-bar-wa-only .tp-bar-wa { flex: 1; }
  .tp-bar-wa-only .tp-bar-wa .tp-hide-sm { display: inline; }
  .tp-hide-sm { display: none; }
  .tp-show-sm { display: inline; }
  html.tp-has-bar body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
}

/* ---------- inline card under spec table ---------- */
.tp-inline {
  margin: 20px 0 8px; padding: 18px 20px; border-radius: var(--tp-radius);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
  background: rgba(0, 156, 224, .09); box-shadow: inset 0 0 0 1px rgba(0, 156, 224, .35);
  color: inherit; font-family: Barlow, system-ui, sans-serif;
}
.tp-inline-text { display: flex; flex-direction: column; gap: 4px; min-width: 220px; flex: 1; }
.tp-inline-text strong { font: 700 16px/1.3 Montserrat, Barlow, sans-serif; }
.tp-inline-text span { font-size: 14px; opacity: .8; }
.tp-inline-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tp-inline-actions .tp-btn-wa { padding: 0 14px; }
@media (max-width: 520px) {
  .tp-inline-actions { width: 100%; }
  .tp-inline-actions .tp-btn-primary, .tp-inline-actions .tp-btn-ghost { flex: 1; }
}

/* ---------- nudge ---------- */
.tp-nudge {
  position: fixed; z-index: 9991; left: 20px; bottom: 20px; max-width: 340px;
  padding: 18px 18px 16px; border-radius: 12px; background: #fff; color: var(--tp-ink);
  box-shadow: 0 16px 40px rgba(10, 25, 41, .25); font-family: Barlow, system-ui, sans-serif;
  transform: translateY(20px); opacity: 0; transition: transform .25s ease, opacity .25s ease;
  border-top: 3px solid var(--tp-brand);
}
.tp-nudge.tp-in { transform: none; opacity: 1; }
.tp-nudge p { margin: 0 24px 12px 0; font-size: 15px; line-height: 1.4; font-weight: 600; }
.tp-nudge .tp-btn { width: 100%; }
@media (max-width: 767px) {
  .tp-nudge { left: 12px; right: 12px; max-width: none; bottom: calc(78px + env(safe-area-inset-bottom)); }
}

/* ---------- modal ---------- */
html.tp-lock, html.tp-lock body { overflow: hidden; }
.tp-overlay {
  position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center;
  padding: 16px; background: rgba(10, 22, 36, .62); backdrop-filter: blur(2px);
}
.tp-modal {
  position: relative; width: 100%; max-width: 620px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: #fff; color: var(--tp-ink); border-radius: 14px; padding: 28px 28px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3); font-family: Barlow, system-ui, sans-serif;
  -webkit-overflow-scrolling: touch;
}
.tp-modal h2 { margin: 0 32px 6px 0; font: 700 22px/1.25 Montserrat, Barlow, sans-serif; color: var(--tp-navy); }
.tp-eyebrow { margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--tp-brand); }
.tp-sub { margin: 0 0 18px; font-size: 14px; color: #5b6b7c; }
.tp-x {
  position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: transparent; color: #7a8a9a; font-size: 26px; line-height: 1; cursor: pointer;
}
.tp-x:hover { background: #f1f4f8; color: var(--tp-navy); }
@media (max-width: 600px) {
  .tp-overlay { padding: 0; align-items: flex-end; }
  .tp-modal { max-width: none; max-height: 94vh; border-radius: 16px 16px 0 0; padding: 22px 16px calc(18px + env(safe-area-inset-bottom)); }
  .tp-modal h2 { font-size: 19px; }
}

/* ---------- form ---------- */
.tp-form { font-family: Barlow, system-ui, sans-serif; color: var(--tp-ink); }
.tp-form-inline { background: #fff; border-radius: 12px; }
.tp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.tp-wide { grid-column: 1 / -1; }
@media (max-width: 600px) { .tp-grid { grid-template-columns: 1fr; } }
.tp-field label { display: block; }
.tp-label { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 600; color: #4b5b6b; letter-spacing: .02em; }
.tp-form input:not([type=checkbox]):not([type=radio]), .tp-form select, .tp-form textarea {
  width: 100%; box-sizing: border-box; min-height: 44px; padding: 10px 12px;
  border: 1px solid #d5dde6; border-radius: 8px; background: #fff; color: var(--tp-navy);
  font: 400 16px/1.3 Barlow, system-ui, sans-serif; /* 16px stops iOS zoom */
  transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
.tp-form select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235b6b7c' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
.tp-form textarea { resize: vertical; min-height: 84px; }
.tp-form input:focus, .tp-form select:focus, .tp-form textarea:focus { outline: none; border-color: var(--tp-brand); box-shadow: 0 0 0 3px rgba(0, 156, 224, .18); }
.tp-invalid input, .tp-invalid select, .tp-invalid textarea { border-color: var(--tp-err) !important; }
.tp-err { display: block; min-height: 0; margin-top: 3px; font-size: 12px; color: var(--tp-err); }
.tp-err:empty { display: none; }

.tp-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tp-chip { position: relative; cursor: pointer; }
.tp-chip input { position: absolute; opacity: 0; pointer-events: none; }
.tp-chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid #d5dde6; font-size: 14px; color: var(--tp-ink); background: #fff; transition: all .15s;
}
.tp-chip input:checked + span { background: var(--tp-navy); border-color: var(--tp-navy); color: #fff; }
.tp-chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0, 156, 224, .35); }
.tp-invalid .tp-chip span { border-color: var(--tp-err); }

.tp-consent { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 4px; font-size: 12.5px; line-height: 1.45; color: #5b6b7c; cursor: pointer; }
.tp-consent input { width: 18px; height: 18px; margin-top: 1px; flex: none; accent-color: var(--tp-brand); }
.tp-consent.tp-invalid span { color: var(--tp-err); }
.tp-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.tp-form-msg { min-height: 0; margin: 8px 0; font-size: 13px; color: var(--tp-err); }
.tp-form-msg:empty { margin: 0; }
.tp-form-msg a { color: var(--tp-wa-dark); font-weight: 600; }
.tp-submit { width: 100%; margin-top: 8px; min-height: 50px; font-size: 15px; }

/* ---------- thank-you ---------- */
.tp-thanks { text-align: center; padding: 18px 4px 6px; font-family: Barlow, system-ui, sans-serif; color: var(--tp-ink); }
.tp-thanks h3 { margin: 10px 0 6px; font: 700 20px/1.3 Montserrat, Barlow, sans-serif; color: var(--tp-navy); }
.tp-thanks p { margin: 0 0 18px; color: #5b6b7c; }
.tp-check { width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; background: rgba(0, 156, 224, .12); color: var(--tp-brand); font-size: 28px; line-height: 56px; font-weight: 700; }

@media (prefers-reduced-motion: reduce) { .tp-nudge, .tp-btn { transition: none; } }

/* Public nav: hide the Admin link (the CMS stays reachable at /admin/login) */
header a[href$="/admin/login"], nav a[href$="/admin/login"] { display: none !important; }
