/* Daybreak Sobriety Tracker: the Notifications pop-up (js/notifications.js).
   Self-contained so it looks the same on the home page and the account page. */

.nf-dialog {
  --nf-bg: #ffffff;
  --nf-ink: #24353f;
  --nf-soft: #566a75;
  --nf-line: #dbe8ee;
  --nf-tint: #eaf6f5;
  --nf-accent: #2f6f95;
  --nf-accent-hover: #265c7c;
  --nf-on-accent: #ffffff;
  --nf-focus: #4aa7a3;
  --nf-error-bg: #fbeeee;
  --nf-error-ink: #8a2f2f;
  --nf-shadow: rgba(36, 53, 63, 0.2);
  --nf-backdrop: rgba(36, 53, 63, 0.35);

  border: none;
  border-radius: 18px;
  padding: 26px 22px 20px;
  width: calc(100% - 24px);
  max-width: 480px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: var(--nf-bg);
  color: var(--nf-ink);
  box-shadow: 0 20px 60px var(--nf-shadow);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

@media (prefers-color-scheme: dark) {
  .nf-dialog {
    --nf-bg: #102b3a;
    --nf-ink: #e4f0f3;
    --nf-soft: #a3bec9;
    --nf-line: #24475a;
    --nf-tint: #0f2c36;
    --nf-accent: #4fb3b8;
    --nf-accent-hover: #86d4d6;
    --nf-on-accent: #0a1b26;
    --nf-focus: #4fb3b8;
    --nf-error-bg: #3a1f24;
    --nf-error-ink: #f2b8b8;
    --nf-shadow: rgba(0, 0, 0, 0.5);
    --nf-backdrop: rgba(0, 0, 0, 0.55);
  }
}

.nf-dialog::backdrop { background: var(--nf-backdrop, rgba(36, 53, 63, 0.35)); }

.nf-dialog h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: normal;
  font-size: 1.5rem;
  line-height: 1.25;
  margin: 0 0 6px;
  text-align: center;
}

.nf-dialog .nf-intro { margin: 0 0 16px; text-align: center; color: var(--nf-soft); }

.nf-table { width: 100%; border-collapse: collapse; margin: 0 0 6px; }
.nf-table th, .nf-table td { padding: 9px 4px; text-align: left; vertical-align: middle; }
.nf-table thead th {
  font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--nf-soft); text-align: center; width: 4.5rem; padding-bottom: 6px;
}
.nf-table thead th:first-child { text-align: left; width: auto; }
.nf-table tbody th[scope="row"] { font-weight: normal; border-top: 1px solid var(--nf-line); }
.nf-table td { text-align: center; border-top: 1px solid var(--nf-line); }
.nf-table tr.nf-group th {
  padding: 14px 4px 4px; border-top: none;
  font-size: .85rem; font-weight: 600; color: var(--nf-soft);
}
.nf-table tr.nf-group:first-child th { padding-top: 4px; }
.nf-sub { display: block; font-size: .85rem; color: var(--nf-soft); }

.nf-dialog input[type="checkbox"] {
  width: 22px; height: 22px; margin: 0; accent-color: var(--nf-accent); cursor: pointer;
}
.nf-dialog input[type="checkbox"]:disabled { cursor: not-allowed; opacity: .4; }
.nf-off { opacity: .55; }
.nf-table td.nf-off { opacity: 1; }

.nf-check {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 16px 0 4px; padding-top: 14px; border-top: 1px solid var(--nf-line);
  font-size: .97rem; cursor: pointer;
}
.nf-check input { flex: none; margin-top: 1px; }

.nf-note {
  margin: 10px 0 0; padding: 10px 12px;
  background: var(--nf-tint); border: 1px solid var(--nf-line); border-radius: 12px;
  font-size: .9rem; color: var(--nf-ink);
}
.nf-note a, .nf-link {
  color: var(--nf-accent); font-weight: 600; text-decoration: underline;
  background: none; border: none; padding: 0; font: inherit; font-weight: 600; cursor: pointer;
}

.nf-msg {
  margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; font-size: .95rem;
  background: var(--nf-tint); border: 1px solid var(--nf-line);
}
.nf-msg.nf-error { background: var(--nf-error-bg); color: var(--nf-error-ink); border-color: transparent; }

.nf-actions { display: grid; gap: 10px; margin-top: 18px; }
.nf-btn {
  display: block; width: 100%;
  font: inherit; font-size: 1rem; text-align: center;
  background: var(--nf-accent); color: var(--nf-on-accent);
  border: 1px solid transparent; border-radius: 999px;
  padding: 12px 20px; cursor: pointer;
}
.nf-btn:hover { background: var(--nf-accent-hover); }
.nf-btn[disabled] { opacity: .6; cursor: default; }
.nf-btn.nf-secondary { background: transparent; color: var(--nf-ink); border-color: var(--nf-line); }
.nf-btn.nf-secondary:hover { background: var(--nf-tint); }

.nf-dialog :focus-visible { outline: 3px solid var(--nf-focus); outline-offset: 2px; }
.nf-status { text-align: center; color: var(--nf-soft); padding: 18px 0; margin: 0; }
.nf-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
