/* "Trimite o întrebare" (nova-questions.js), from otv.today's MessagesDrawer:
   a "Mesaj" button in the sidebar opening a panel, and the same
   form as a section on the Televot page. */

/* Blur the page and center the dialog in the viewport. */
.nq-dock {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: none;
  place-items: center;
  padding: 12px;
  background: var(--window-scrim);
  -webkit-backdrop-filter: var(--window-scrim-filter);
  backdrop-filter: var(--window-scrim-filter);
  pointer-events: auto;
}
.nq-dock:has(.nq-drawer:not([hidden])) { display: grid; }
html:has(.nq-drawer:not([hidden])),
body:has(.nq-drawer:not([hidden])) { overflow: hidden; }
.sidebar .nq-sidebar-toggle { width: 100%; border: 0; background: none; font-family: inherit; text-align: left; }
.sidebar .nq-sidebar-toggle[hidden] { display: none; }
.sidebar .nq-sidebar-toggle:hover,
.sidebar .nq-sidebar-toggle[aria-expanded="true"] { background: var(--bg-hover); color: var(--text-primary); }
@media (max-width: 768px) {
  .nq-dock .nq-drawer { width: min(360px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); }
}
html.np-open .nq-dock { display: none; }

.nq-drawer {
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  width: 360px;
  max-height: calc(100vh - 24px);
  border: 1px solid var(--champagne-border);
  border-radius: 18px;
  background: var(--champagne-glass);
  -webkit-backdrop-filter: blur(24px) saturate(1.25);
  backdrop-filter: blur(24px) saturate(1.25);
  box-shadow: var(--champagne-shadow);
  overflow: hidden;
  animation: nq-rise .2s ease-out;
}
.nq-drawer[hidden] { display: none; }
html.dark .nq-drawer .nq-field textarea:focus { background: rgba(255, 246, 222, .12); border-color: #e9c779; box-shadow: 0 0 0 3px rgba(233, 199, 121, .14); }
.nq-drawer-head { display: flex; flex-shrink: 0; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border-light); }
.nq-drawer-head h2 { flex: 1; margin: 0; color: var(--text-primary); font-size: var(--fs-md); font-weight: 700; }
.nq-drawer-body { display: grid; gap: 12px; max-height: 400px; padding: 14px; overflow-y: auto; }
.nq-close { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--text-secondary); cursor: pointer; }
.nq-close:hover { background: var(--bg-hover); }

.nq-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 12px; background: rgba(250, 204, 21, .15); color: var(--otv-gold-text, #a15c07); }
.nq-icon.is-large { width: 48px; height: 48px; border-radius: 16px; font-size: var(--fs-lg); }

/* The section on the Televot page */
.nq-section { border: 1px solid var(--border-light); border-radius: 24px; background: var(--bg-card); box-shadow: var(--shadow-sm); }
.nq-section-head { display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-bottom: 1px solid var(--border-light); }
.nq-section-head h2 { margin: 0; color: var(--text-primary); font-size: var(--fs-lg); font-weight: 700; line-height: 1.3; }
.nq-section-body { display: grid; gap: 14px; padding: 16px; }
.nq-sheet-form { display: grid; gap: 14px; }

/* The form, shared */
.nq-auth-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid rgba(239, 68, 68, .25); border-radius: 12px; background: rgba(239, 68, 68, .08); color: var(--text-primary); font-size: var(--fs-xs); }
.nq-auth-note > i { color: rgba(239, 68, 68, .8); }
.nq-auth-note[hidden] { display: none; }
.nq-link { margin-left: auto; padding: 0; border: 0; background: none; color: var(--otv-gold-text, #a15c07); font: inherit; font-weight: 700; cursor: pointer; }

.nq-field textarea {
  box-sizing: border-box;
  width: 100%;
  min-height: 100px;
  padding: 10px 12px;
  border: 1px solid var(--otv-input-border, var(--border-light));
  border-radius: 12px;
  background: var(--otv-input-bg, var(--bg-hover));
  color: var(--text-primary);
  font: inherit;
  font-size: var(--fs-sm);
  line-height: 1.5;
  resize: none;
}
.nq-field textarea::placeholder { color: var(--text-muted); }
.nq-field textarea:focus { outline: none; border-color: #facc15; box-shadow: 0 0 0 2px rgba(250, 204, 21, .35); }
.nq-field-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding-right: 4px; color: var(--text-secondary); font-size: var(--fs-xs); }
.nq-attach { display: flex; align-items: center; gap: 8px; }
.nq-attach-btn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border: 1px solid var(--border-light); border-radius: 9px; background: var(--bg-hover); cursor: pointer; transition: border-color .15s ease; }
.nq-attach-btn:hover { border-color: #facc15; }

.nq-preview { display: flex; align-items: flex-start; gap: 10px; padding: 8px; border: 1px solid var(--otv-input-border, var(--border-light)); border-radius: 12px; background: var(--otv-input-bg, var(--bg-hover)); }
.nq-preview[hidden] { display: none; }
.nq-preview img, .nq-preview video, .nq-preview-doc { width: 48px; height: 48px; flex: none; border-radius: 9px; object-fit: cover; }
.nq-preview-doc { display: grid; place-items: center; background: rgba(250, 204, 21, .15); color: var(--otv-gold-text, #a15c07); font-size: var(--fs-lg); }
.nq-preview > div { display: grid; gap: 2px; flex: 1; min-width: 0; }
.nq-preview strong { overflow: hidden; color: var(--text-primary); font-size: var(--fs-xs); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.nq-preview span { color: var(--text-secondary); font-size: var(--fs-xs); }
.nq-preview-remove { display: grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #f87171; cursor: pointer; }
.nq-preview-remove:hover { background: rgba(239, 68, 68, .2); }

.nq-alert { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border: 1px solid; border-radius: 12px; font-size: var(--fs-xs); }
.nq-alert[hidden] { display: none; }
.nq-alert.is-error { border-color: rgba(239, 68, 68, .2); background: rgba(239, 68, 68, .08); color: #dc2626; }
.nq-alert.is-success { border-color: rgba(34, 197, 94, .25); background: rgba(34, 197, 94, .12); color: #16a34a; }
html.dark .nq-alert.is-error { color: #f87171; }
html.dark .nq-alert.is-success { color: #4ade80; }

.nq-submit,
.nq-sheet-form .nq-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%);
  box-shadow: 0 8px 20px rgba(250, 204, 21, .3);
  color: #111827;
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
}
.nq-submit:disabled { opacity: .6; cursor: default; }

@media (max-width: 768px) {
  .nq-section { border-radius: 18px; }
  .nq-section-head { padding: 12px 16px; }
  .nq-section-head h2 { font-size: var(--fs-md); }
  .nq-section-body { padding: 14px; }
}

/* Desktop reaches the form through "Mesaj"; phones through the "+" sheet. */
@media (min-width: 1024px) {
  .np-option-question { display: none; }
}

@keyframes nq-rise { from { opacity: 0; transform: translateY(12px); } }
