/* Onboarding + splash chrome. Sits in front of Eva's own UI. Injected by boot.js. */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --nbf-bg:         #FAF8FF;
  --nbf-fg:         #1D142A;
  --nbf-muted:      #6E6578;
  --nbf-border:     rgba(29,20,42,0.12);
  --nbf-field-bg:   #FFFFFF;
  --nbf-hover-bg:   rgba(124,58,237,0.07);
  --nbf-hover-border: rgba(124,58,237,0.20);
  --nbf-accent:     #7C3AED;
  --nbf-accent-fg:  #FFFFFF;
  --nbf-error:      #B4237A;
  --nbf-link:       #6D28D9;
  --nbf-link-hover: #4C1D95;
  --nbf-gradient:   linear-gradient(90deg, #8A38F5 0%, #FB75FC 100%);
}

html.dark body {
  background: #0A0517 !important;
}

html.dark {
  --nbf-bg:         #0A0517;
  --nbf-fg:         #F5F5F5;
  --nbf-muted:      #9a9a9a;
  --nbf-border:     rgba(255,255,255,0.10);
  --nbf-field-bg:   #110125;
  --nbf-hover-bg:   rgba(255,255,255,0.07);
  --nbf-hover-border: rgba(255,255,255,0.18);
  --nbf-accent:     #8A38F5;
  --nbf-accent-fg:  #ffffff;
  --nbf-error:      #fb75fc;
  --nbf-link:       #B989FF;
  --nbf-link-hover: #D7C1FF;
}

.nbf-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--nbf-bg);
  padding: 24px;
  overflow: auto;
  z-index: 9999;
  font-family: 'Poppins', system-ui, sans-serif;
}

.nbf-card {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nbf-logo {
  font-size: 40px;
  line-height: 1;
  display: flex;
  justify-content: center;
}

.nbf-title {
  margin: 4px 0 0;
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  color: var(--nbf-fg);
}

.nbf-sub {
  margin: 0 0 6px;
  font-size: 13.5px;
  line-height: 1.5;
  text-align: center;
  color: var(--nbf-muted);
}

.nbf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nbf-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--nbf-fg);
}

.nbf-hint {
  font-size: 11.5px;
  color: var(--nbf-muted);
}

.nbf-input {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 13px;
  font-size: 14.5px;
  color: var(--nbf-fg);
  background: var(--nbf-field-bg);
  border: 1px solid var(--nbf-border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s ease;
  font-family: inherit;
}

.nbf-input:focus {
  border-color: var(--nbf-accent);
}

.nbf-textarea {
  resize: vertical;
  min-height: 64px;
}

.nbf-providers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nbf-chip {
  padding: 7px 13px;
  font-size: 13px;
  border: 1px solid var(--nbf-border);
  background: var(--nbf-field-bg);
  color: var(--nbf-fg);
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nbf-chip.is-active {
  background: var(--nbf-accent);
  color: var(--nbf-accent-fg);
  border-color: var(--nbf-accent);
}

.nbf-submit {
  margin-top: 4px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Poppins', system-ui, sans-serif;
  color: var(--nbf-accent-fg);
  background: var(--nbf-gradient);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.nbf-submit:hover {
  opacity: 0.88;
}

.nbf-link {
  background: none;
  border: none;
  color: var(--nbf-muted);
  font-size: 12.5px;
  cursor: pointer;
  text-decoration: underline;
  padding: 2px;
}

.nbf-more-btn {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--nbf-muted);
  font-size: 12px;
  font-weight: 400;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-align: center;
}

.nbf-more-btn:hover {
  color: var(--nbf-fg);
}

.nbf-more-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nbf-error {
  min-height: 16px;
  font-size: 12.5px;
  color: var(--nbf-error);
  text-align: center;
}

.nbf-splash {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--nbf-bg);
  color: var(--nbf-muted);
  font-size: 14px;
  font-family: 'Poppins', system-ui, sans-serif;
  z-index: 9999;
}

.nbf-splash-dot {
  width: 9px;
  height: 9px;
  border-radius: 9999px;
  background: currentColor;
  animation: nbf-pulse 1s ease-in-out infinite;
}

@keyframes nbf-pulse {
  0%, 100% { transform: scale(0.85); opacity: 0.45; }
  50% { transform: scale(1); opacity: 0.9; }
}

/* Backup / restore modal */

.nbf-modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 56px 16px;
  z-index: 10000;
  pointer-events: none;
}

.nbf-modal-card {
  pointer-events: all;
  width: min(360px, calc(100vw - 32px));
  background: var(--nbf-bg);
  border: 1px solid var(--nbf-border);
  border-radius: 18px;
  box-shadow: 0 18px 54px rgba(0,0,0,0.34);
  overflow: hidden;
  animation: nbf-modal-in 0.15s ease;
}

@keyframes nbf-modal-in {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.nbf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 0;
}

.nbf-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--nbf-fg);
}

.nbf-modal-close {
  background: none;
  border: none;
  color: var(--nbf-muted);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
}

.nbf-modal-close:hover { color: var(--nbf-fg); }

.nbf-modal-body {
  margin: 12px 0 0;
  padding: 0 18px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--nbf-muted);
}

.nbf-modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 16px 18px 18px;
}

.nbf-modal-btn {
  min-height: 38px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 10px;
  border: 1px solid var(--nbf-border);
  background: var(--nbf-field-bg);
  color: var(--nbf-fg);
  cursor: pointer;
  text-align: center;
  transition: background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}

.nbf-modal-btn:hover {
  background: var(--nbf-hover-bg);
  border-color: var(--nbf-hover-border);
}

.nbf-modal-btn--primary {
  background: var(--nbf-accent);
  color: var(--nbf-accent-fg);
  border-color: var(--nbf-accent);
}

.nbf-modal-btn--primary:hover {
  background: var(--nbf-accent);
  border-color: var(--nbf-accent);
  opacity: 0.88;
}

/* Clip Eva's inner bottom toolbar to the chat card's border-radius. */
.rounded-2xl.bg-card { overflow: hidden; }

/* Non-fatal sync warnings (e.g. a file too large to back up in the browser). */
.nbf-toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 32px));
  padding: 11px 15px;
  font-size: 13px;
  line-height: 1.4;
  border-radius: 10px;
  background: var(--nbf-field-bg);
  color: var(--nbf-fg);
  border: 1px solid var(--nbf-border);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  z-index: 9999;
}

.nbf-toast--warn {
  border-color: #E0A23A;
  border-left: 3px solid #E0A23A;
}

/* Data & privacy dashboard */
.nbf-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.nbf-stat {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  background: var(--nbf-field-bg); border: 1px solid var(--nbf-border);
}
.nbf-stat--wide { grid-column: 1 / -1; }
.nbf-stat span {
  color: var(--nbf-muted);
}
.nbf-stat b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--nbf-fg);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.nbf-privacy-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nbf-privacy-list li {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
}
.nbf-privacy-list b {
  color: var(--nbf-fg);
  font-weight: 600;
}
.nbf-privacy-list span {
  color: var(--nbf-muted);
}
.nbf-privacy-link {
  display: inline-flex;
  margin-top: 12px;
  color: var(--nbf-link);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.nbf-privacy-link:hover { color: var(--nbf-link-hover); }
.nbf-modal-btn--danger { border-color: #C0392B; color: #E74C3C; }
.nbf-modal-btn--danger:hover { background: rgba(192, 57, 43, 0.12); }

@media (max-width: 420px) {
  .nbf-modal-overlay {
    justify-content: center;
    padding: 16px;
  }

  .nbf-modal-actions,
  .nbf-stats {
    grid-template-columns: 1fr;
  }

  .nbf-stat--wide { grid-column: auto; }

  .nbf-privacy-list li {
    grid-template-columns: 1fr;
    gap: 1px;
  }
}
