/* ==========================================================================
   /tools/teething-tracker
   Inherits hero/FAQ/tip base from maternity-bag.css
   ========================================================================== */
@import url("/assets/css/maternity-bag.css");

:root {
  --tt-erupted: #5bbf6b;       /* появился — зелёный */
  --tt-expected: #cbd1d8;      /* ожидается — серый */
  --tt-late: #f0a85e;          /* опаздывает — янтарный */
  --tt-accent: #e8a3a3;        /* мягкий розовый — десна */
  --tt-tooth: #ffffff;         /* белый зуб */
  --tt-tooth-stroke: #d8d3d0;
}

/* ---------- Page & Hero ---------- */
.tt-page {
  background: #fbf8f5 !important;
}

.tt-hero {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(247, 230, 226, 0.5) 100%),
    url("/assets/images/teething-tracker-hero-bg.webp") center / cover no-repeat,
    linear-gradient(180deg, #ffffff 0%, #fbe9e4 100%) !important;
  border-bottom-color: #f0d4cd !important;
}

.tt-hero .mb-hero-title span::after {
  background: linear-gradient(90deg, rgba(232, 163, 163, 0.55), rgba(247, 220, 111, 0.4));
}

.tt-form-section {
  margin-bottom: 0 !important;
}

/* ==========================================================================
   FORM
   ========================================================================== */
.tt-form-card {
  background: #fff;
  border: 1px solid #f0e4e0;
  border-radius: 20px;
  padding: 28px 32px;
  margin: 0 0 12px;
  box-shadow: 0 4px 20px rgba(17, 17, 17, 0.04);
}

.tt-form-title {
  font-family: "Montserrat", sans-serif;
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 20px !important;
  color: var(--main-bg-color);
}

.tt-form-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
}

.tt-field {
  min-width: 0;
}

.tt-field label {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--main-bg-color);
  margin-bottom: 8px;
}

.tt-field input[type="date"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #f0e4e0;
  border-radius: 12px;
  font-family: "Nunito", sans-serif;
  font-size: 16px;
  color: var(--main-bg-color);
  background: #fafbfc;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tt-field input:focus {
  outline: none;
  border-color: var(--tt-accent);
  box-shadow: 0 0 0 3px rgba(232, 163, 163, 0.2);
}

.tt-field-hint {
  display: block;
  margin-top: 6px;
  font-size: 12.5px;
  color: #777;
  line-height: 1.4;
}

.tt-calc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--main-bg-color);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: "Montserrat", sans-serif;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.1s;
}

.tt-calc-btn:hover { background: #000; }
.tt-calc-btn:active { transform: scale(0.99); }

/* ---------- Summary ---------- */
.tt-progress-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px dashed #f0e4e0;
}

.tt-summary-item {
  padding: 12px 16px;
  background: linear-gradient(135deg, #fff 0%, #fbe9e4 100%);
  border-radius: 12px;
  border: 1px solid #f3d8d0;
}

.tt-summary-label {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.tt-summary-value {
  display: block;
  font-family: "Montserrat", sans-serif;
  font-size: 19px;
  font-weight: 800;
  color: var(--main-bg-color);
  line-height: 1.2;
}

/* ==========================================================================
   SMILE DIAGRAM
   ========================================================================== */
.tt-smile-section {
  background: #fff;
  border: 1px solid #f0e4e0;
  border-radius: 18px;
  padding: 24px 28px;
  margin: 28px 0 20px;
  box-shadow: 0 4px 16px rgba(17, 17, 17, 0.04);
}

.tt-smile-title {
  font-family: "Montserrat", sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px !important;
  color: var(--main-bg-color);
}

.tt-smile-hint {
  margin: 0 0 18px;
  font-size: 13.5px;
  color: #666;
  line-height: 1.5;
}

.tt-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 4px;
  padding: 2px 10px 2px 4px;
  background: #fafafa;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-family: "Montserrat", sans-serif;
}

.tt-legend::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--tt-expected);
}

.tt-legend-erupted::before { background: var(--tt-erupted); }
.tt-legend-late::before    { background: var(--tt-late); }

.tt-smile {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.tt-jaw {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 6px;
  padding: 18px 12px;
  background: linear-gradient(180deg, #ffe8e3 0%, #fdd8d0 100%);
  border-radius: 60px 60px 24px 24px;
}

.tt-jaw-lower {
  background: linear-gradient(0deg, #ffe8e3 0%, #fdd8d0 100%);
  border-radius: 24px 24px 60px 60px;
  margin-top: 4px;
}

.tt-jaw-mid {
  font-family: "Montserrat", sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 0;
}

.tt-tooth {
  position: relative;
  aspect-ratio: 1 / 1.2;
  background: var(--tt-tooth);
  border: 2px solid var(--tt-tooth-stroke);
  border-radius: 38% 38% 28% 28%;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Montserrat", sans-serif;
  font-size: 10px;
  font-weight: 700;
  color: transparent;
}

.tt-jaw-lower .tt-tooth {
  border-radius: 28% 28% 38% 38%;
}

.tt-tooth:hover {
  transform: translateY(-2px);
  border-color: var(--tt-accent);
}

.tt-tooth.is-erupted {
  background: var(--tt-erupted);
  border-color: #4ba35a;
  color: #fff;
}

.tt-tooth.is-late {
  background: var(--tt-late);
  border-color: #d68e48;
  color: #fff;
}

.tt-tooth.is-erupted::after,
.tt-tooth.is-late::after {
  content: "✓";
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}

.tt-tooth.is-erupted::after { content: "✓"; }
.tt-tooth.is-late::after    { content: "!"; }

.tt-tooth-tip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #2a2a2a;
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  font-family: "Nunito", sans-serif;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 10;
}

.tt-tooth:hover .tt-tooth-tip {
  opacity: 1;
}

/* ==========================================================================
   TIMELINE
   ========================================================================== */
.tt-timeline {
  background: #fff;
  border: 1px solid #f0e4e0;
  border-radius: 18px;
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(17, 17, 17, 0.04);
}

.tt-timeline-title {
  font-family: "Montserrat", sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 18px !important;
  color: var(--main-bg-color);
}

.tt-timeline-list {
  list-style: none;
  margin: 0 0 16px !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tt-timeline-item {
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  background: #fafbfc;
  border: 1px solid #f0e4e0;
  border-radius: 12px;
  transition: background 0.15s, border-color 0.15s;
}

.tt-timeline-item:hover {
  background: #fff6f3;
  border-color: #f3d8d0;
}

.tt-timeline-item.is-erupted {
  background: linear-gradient(135deg, #fff 0%, #eaf6ec 100%);
  border-color: #c3e4ca;
}

.tt-timeline-item.is-late {
  background: linear-gradient(135deg, #fff 0%, #fff0e0 100%);
  border-color: #f0d8b5;
}

.tt-timeline-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--tt-expected);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: #888;
}

.tt-timeline-item.is-erupted .tt-timeline-num {
  background: var(--tt-erupted);
  border-color: #4ba35a;
  color: #fff;
}

.tt-timeline-item.is-late .tt-timeline-num {
  background: var(--tt-late);
  border-color: #d68e48;
  color: #fff;
}

.tt-timeline-name {
  font-family: "Nunito", sans-serif;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--main-bg-color);
  line-height: 1.3;
}

.tt-timeline-date {
  font-family: "Montserrat", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  white-space: nowrap;
}

.tt-timeline-date-empty {
  color: #aaa;
  font-weight: 500;
}

.tt-timeline-toggle {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 2px solid #d8d3d0;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.tt-timeline-toggle:hover {
  border-color: var(--tt-accent);
}

.tt-timeline-item.is-erupted .tt-timeline-toggle {
  background: var(--tt-erupted);
  border-color: #4ba35a;
}

.tt-timeline-item.is-erupted .tt-timeline-toggle::before {
  content: "✓";
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}

.tt-timeline-note {
  margin: 14px 0 0 !important;
  padding: 10px 14px;
  background: #fef9ea;
  border-left: 3px solid var(--tt-late);
  border-radius: 6px;
  font-size: 13px;
  color: #555;
  line-height: 1.5;
}

/* ==========================================================================
   SYMPTOMS
   ========================================================================== */
.tt-symptoms-card {
  background: #fff;
  border: 1px solid #f0e4e0;
  border-radius: 18px;
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(17, 17, 17, 0.04);
}

.tt-symptoms-title {
  font-family: "Montserrat", sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px !important;
  color: var(--main-bg-color);
}

.tt-symptoms-hint {
  margin: 0 0 18px;
  font-size: 13.5px;
  color: #666;
  line-height: 1.5;
}

.tt-symptoms-list {
  list-style: none !important;
  margin: 0 0 16px !important;
  padding: 0 !important;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.tt-symptom {
  margin: 0 !important;
}

.tt-symptom-label {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  background: #fafbfc;
  border: 1px solid #f0e4e0;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.tt-symptom-icon {
  display: none;
}

.tt-symptom-label:hover {
  background: #fff6f3;
  border-color: #f3d8d0;
}

.tt-symptom-label input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 1.5px solid #d8d3d0;
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}

.tt-symptom-label input[type="checkbox"]:checked {
  background: var(--tt-erupted);
  border-color: #4ba35a;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='10' viewBox='0 0 12 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 5L4.5 8.5L11 1.5' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.tt-symptom-icon {
  font-size: 22px;
  line-height: 1.2;
}

.tt-symptom-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: "Nunito", sans-serif;
  line-height: 1.4;
}

.tt-symptom-text strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--main-bg-color);
}

.tt-symptom-text em {
  font-size: 12.5px;
  color: #777;
  font-style: normal;
}

.tt-symptoms-alarm {
  padding: 14px 16px;
  background: #fdf2f2;
  border: 1px solid #f4cccb;
  border-left: 4px solid #c25656;
  border-radius: 10px;
  font-size: 13.5px;
  color: #5a2727;
  line-height: 1.5;
}

.tt-symptoms-alarm strong {
  color: #8a2c2c;
}

/* ==========================================================================
   REFERENCE TABLE
   ========================================================================== */
.tt-ref-section {
  margin-bottom: 36px;
}

.tt-ref-title {
  font-family: "Montserrat", sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 14px !important;
  color: var(--main-bg-color);
}

.tt-ref-wrap {
  background: #fff;
  border: 1px solid #f0e4e0;
  border-radius: 16px;
  overflow-x: auto;
  box-shadow: 0 4px 16px rgba(17, 17, 17, 0.04);
}

.tt-ref-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Nunito", sans-serif;
  min-width: 460px;
}

.tt-ref-table th,
.tt-ref-table td {
  text-align: left;
  padding: 12px 18px;
  border-bottom: 1px solid #f5ebe7;
  font-size: 14px;
}

.tt-ref-table th {
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #777;
  background: #fff6f3;
}

.tt-ref-table tbody tr:last-child td { border-bottom: none; }

.tt-ref-table tr.tt-ref-total {
  background: #fbe9e4;
}

/* ==========================================================================
   SOURCES (shared pattern)
   ========================================================================== */
.sr-sources-block {
  margin: 32px 0 8px;
  padding: 26px 30px 22px !important;
  background: linear-gradient(180deg, #ffffff 0%, #faf8f1 100%);
  border: 1px solid #ece5cf;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(189, 160, 0, 0.05);
}
.sr-sources-head {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 18px; padding-bottom: 14px;
  border-bottom: 1px dashed #e3dcc2;
}
.sr-sources-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; background: var(--gold-color); color: #fff;
  border-radius: 10px; flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(189, 160, 0, 0.25);
}
.sr-sources-head h2 {
  font-family: "Montserrat", sans-serif;
  font-size: 20px !important; font-weight: 800 !important;
  margin: 0 !important; letter-spacing: -0.02em;
  color: var(--main-bg-color);
}
.sr-sources {
  counter-reset: sr-source;
  list-style: none !important; margin: 0 !important; padding: 0 !important;
  font-size: 13.5px !important; line-height: 1.6 !important;
  color: var(--main-bg-color);
}
.sr-sources li {
  position: relative; counter-increment: sr-source;
  padding: 10px 12px 10px 42px !important; margin: 0 !important;
  border-radius: 10px; transition: background 0.2s ease;
}
.sr-sources li:hover { background: rgba(189, 160, 0, 0.04); }
.sr-sources li::before {
  content: counter(sr-source);
  position: absolute; left: 8px; top: 9px;
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1.5px solid #e3dcc2; border-radius: 50%;
  font-family: "Montserrat", sans-serif;
  font-size: 11px; font-weight: 800; color: var(--gold-color);
}
.sr-sources-authors { font-weight: 700; color: var(--main-bg-color); margin-right: 4px; }
.sr-sources cite { font-style: italic; color: var(--main-bg-color); }
.sr-sources a {
  color: var(--main-bg-color); text-decoration: underline;
  text-decoration-color: rgba(189, 160, 0, 0.5);
  text-decoration-thickness: 1.5px; text-underline-offset: 2px;
  transition: text-decoration-color 0.2s, color 0.2s;
}
.sr-sources a:hover { color: #8a7600; text-decoration-color: var(--gold-color); }
.sr-sources a[target="_blank"]::after {
  content: "\2197"; display: inline-block; margin-left: 3px;
  font-size: 0.85em; color: var(--gold-color);
  text-decoration: none; vertical-align: middle;
}
.sr-sources-tag {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  background: rgba(189, 160, 0, 0.12); color: #8a7600;
  border-radius: 999px;
  font-family: "Montserrat", sans-serif;
  font-size: 10.5px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  vertical-align: middle; white-space: nowrap;
}
.sr-sources-note {
  margin: 16px 0 0 !important; padding: 10px 14px !important;
  background: rgba(255, 255, 255, 0.6);
  border-left: 3px solid var(--gold-color);
  border-radius: 8px;
  font-size: 12.5px !important; line-height: 1.5 !important;
  color: #444; font-style: italic;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
  .tt-form-card { padding: 22px 18px; }
  .tt-form-row { grid-template-columns: 1fr; }
  .tt-calc-btn { width: 100%; }
  .tt-progress-summary { grid-template-columns: 1fr; gap: 8px; }
  .tt-smile-section,
  .tt-timeline,
  .tt-symptoms-card { padding: 20px 18px; }
  .tt-jaw { padding: 12px 6px; gap: 4px; }
  .tt-symptoms-list { grid-template-columns: 1fr; }
  .tt-timeline-item {
    grid-template-columns: 32px 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
  }
  .tt-timeline-num    { grid-row: 1 / 3; }
  .tt-timeline-name   { grid-column: 2; grid-row: 1; }
  .tt-timeline-date   { grid-column: 2; grid-row: 2; font-size: 11.5px; color: #888; }
  .tt-timeline-toggle { grid-column: 3; grid-row: 1 / 3; align-self: center; }
}

@media (max-width: 576px) {
  .tt-form-card { padding: 18px 14px; }
  .tt-smile-title,
  .tt-timeline-title,
  .tt-symptoms-title,
  .tt-ref-title { font-size: 18px; }
  .tt-jaw { grid-template-columns: repeat(10, 1fr); gap: 3px; padding: 10px 4px; border-radius: 40px 40px 16px 16px; }
  .tt-jaw-lower { border-radius: 16px 16px 40px 40px; }
}

/* ==========================================================================
   WIDGET (embedded in articles)
   ========================================================================== */
.tool-widget-tt {
  background: linear-gradient(135deg, #fbe9e4 0%, #fdf7eb 100%);
  border: 1px solid #f3d8d0;
}
.tool-widget-tt .tool-widget-tag {
  background: var(--tt-accent);
  color: #fff;
}
.tool-widget-tt .tool-widget-bag em {
  color: #8a4a4a;
}
