/**
 * NORA — branding BIMFLOW: wordmark (N + logo O + RA), hub hero, floating widget (variant F).
 */

/* ─── Wordmark: O = inel segmentat NORA (nora-o.svg) ─────────── */
.nora-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  color: #f8fafc;
}

.nora-wordmark__o {
  width: 0.92em;
  height: 0.92em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0 -0.04em;
  filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.35));
  animation: nora-o-wrap-pulse 2.4s ease-in-out infinite;
}

@keyframes nora-o-wrap-pulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.35)); }
  50% { filter: drop-shadow(0 0 16px rgba(34, 211, 238, 0.75)); }
}

.nora-wordmark__o img,
.nora-wordmark__o object,
.nora-wordmark__o svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.nw-fab .nora-wordmark--sm {
  font-size: 1.05rem;
  letter-spacing: 0.05em;
}

.nw-fab .nora-wordmark__o {
  width: 1.1em;
  height: 1.1em;
  filter: drop-shadow(0 0 10px rgba(34, 211, 238, 0.55));
}

.nora-wordmark--xl {
  font-size: clamp(3rem, 8vw, 4.75rem);
}

.nora-wordmark--lg {
  font-size: 1.75rem;
}

.nora-wordmark--sm {
  font-size: 1rem;
}

/* ─── Hub hero (banner NORA) ─────────────────────────────────── */
.nora-hub-hero {
  max-width: 1200px;
  margin: 0 auto 56px;
  padding: clamp(28px, 4vw, 40px) clamp(24px, 4vw, 48px);
  border-radius: 24px;
  border: 1px solid rgba(34, 211, 238, 0.35);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 27, 75, 0.75) 50%, rgba(15, 23, 42, 0.9) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: grid;
  grid-template-columns: 1fr 1fr minmax(140px, 200px);
  gap: 32px;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.nora-hub-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 120%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, transparent 65%);
  pointer-events: none;
}

.nora-hub-hero > * {
  position: relative;
  z-index: 1;
}

.nora-hub-hero__tagline {
  margin: 12px 0 10px;
  font-size: clamp(1.1rem, 2.5vw, 1.45rem);
  font-weight: 600;
  background: linear-gradient(90deg, #a78bfa, #22d3ee, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nora-hub-hero__desc {
  margin: 0 0 20px;
  font-size: 0.95rem;
  line-height: 1.55;
  color: rgba(248, 250, 252, 0.78);
  max-width: 420px;
}

.nora-hub-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  font-family: var(--font, 'Outfit', sans-serif);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(90deg, #06b6d4 0%, #6366f1 55%, #8b5cf6 100%);
  box-shadow: 0 8px 28px rgba(6, 182, 212, 0.35);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s;
}

.nora-hub-hero__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(99, 102, 241, 0.45);
}

.nora-hub-hero__cta:focus-visible {
  outline: 2px solid #22d3ee;
  outline-offset: 3px;
}

.nora-hub-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.nora-hub-features li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.88rem;
  color: rgba(248, 250, 252, 0.88);
  line-height: 1.4;
}

.nora-hub-features__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(34, 211, 238, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.nora-hub-hero__art {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  min-height: 160px;
}

.nora-hub-illus {
  position: relative;
  width: 120px;
  height: 140px;
}

.nora-hub-illus__doc {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 72px;
  height: 88px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.35);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 32px rgba(6, 182, 212, 0.2);
}

.nora-hub-illus__doc::after {
  content: '';
  position: absolute;
  top: 14px;
  left: 12px;
  right: 12px;
  height: 4px;
  background: rgba(34, 211, 238, 0.5);
  border-radius: 2px;
  box-shadow: 0 10px 0 rgba(255, 255, 255, 0.15), 0 20px 0 rgba(255, 255, 255, 0.1);
}

.nora-hub-illus__ring {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(34, 211, 238, 0.5);
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.4);
}

.hub-calc-heading {
  max-width: 1200px;
  margin: 0 auto 28px;
  padding: 0 8px;
}

.hub-calc-heading h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink);
}

.hub-calc-heading p {
  margin: 6px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

@media (max-width: 960px) {
  .nora-hub-hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .nora-hub-hero__desc {
    margin-inline: auto;
  }

  .nora-hub-features {
    align-items: center;
  }

  .nora-hub-hero__art {
    min-height: 120px;
  }
}

/* ─── Floating widget (variant F + wordmark) ─────────────────── */
.nw-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  font-family: var(--font, 'Outfit', sans-serif);
}

.nw-fab {
  min-width: 88px;
  height: 52px;
  padding: 0 16px 0 12px;
  border: 1px solid rgba(34, 211, 238, 0.4);
  border-radius: 26px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 2px;
  box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.35), 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: nw-fab-glow 2.8s ease-in-out infinite;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media (max-width: 720px) {
  /* Mobile perf: reduce GPU-heavy glow */
  .nw-fab {
    animation: none;
  }
  .nw-panel {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

@keyframes nw-fab-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.35), 0 8px 24px rgba(0, 0, 0, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(34, 211, 238, 0.08), 0 8px 32px rgba(6, 182, 212, 0.25); }
}

.nw-fab:hover { transform: scale(1.04); }
.nw-fab:focus-visible { outline: 2px solid #22d3ee; outline-offset: 2px; }

.nw-panel {
  position: absolute;
  bottom: 64px;
  right: 0;
  width: min(360px, calc(100vw - 32px));
  height: min(480px, calc(100vh - 120px));
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 18px;
  box-shadow: 0 0 60px rgba(6, 182, 212, 0.12), 0 24px 48px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px);
  transform-origin: bottom right;
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.45s cubic-bezier(0.34, 1.2, 0.64, 1),
    visibility 0.45s;
  overflow: hidden;
}

.nw-panel::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -30%;
  width: 80%;
  height: 60%;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.nw-panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nw-header {
  position: relative;
  z-index: 1;
  padding: 16px 14px 12px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 182, 212, 0.06);
}

.nw-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
}

.nw-menu {
  position: absolute;
  top: -4px;
  left: 0;
  width: 34px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  transition: background 0.2s, border-color 0.2s;
}

.nw-menu:hover {
  background: rgba(34, 211, 238, 0.15);
  border-color: rgba(34, 211, 238, 0.4);
}

.nw-new-top {
  position: absolute;
  top: -4px;
  right: 38px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  transition: background 0.2s, border-color 0.2s;
}

.nw-new-top:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.45);
}

.nw-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 3;
}

.nw-drawer-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.nw-drawer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 78%;
  max-width: 300px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-right: 1px solid rgba(34, 211, 238, 0.18);
  transform: translateX(-102%);
  transition: transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
  z-index: 4;
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 10px;
}

.nw-drawer.is-open {
  transform: translateX(0);
}

.nw-drawer-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.nw-drawer-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.9);
}

.nw-drawer-link {
  font-size: 0.72rem;
  color: #67e8f9;
  text-decoration: none;
}

.nw-drawer-link:hover {
  text-decoration: underline;
}

.nw-drawer-search input {
  width: 100%;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
  color: #f1f5f9;
  font-family: inherit;
  font-size: 0.82rem;
}

.nw-drawer-search input:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.16);
}

.nw-drawer-new {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.12);
  color: #e0e7ff;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.8rem;
}

.nw-drawer-new:hover {
  background: rgba(99, 102, 241, 0.18);
}

.nw-drawer-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

.nw-conv-row {
  text-align: left;
  width: 100%;
  padding: 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(248, 250, 252, 0.92);
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1.2;
}

.nw-conv-row:hover {
  border-color: rgba(34, 211, 238, 0.22);
  background: rgba(34, 211, 238, 0.08);
}

.nw-conv-row.is-active {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.14);
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.12);
}

.nw-conv-muted {
  font-size: 0.78rem;
  color: rgba(148, 163, 184, 0.95);
  padding: 6px 2px;
}

.nw-header .nora-wordmark--lg {
  justify-content: center;
}

.nw-header p {
  margin: 8px 0 0;
  font-size: 0.72rem;
  color: rgba(148, 163, 184, 0.95);
}

.nw-close {
  position: absolute;
  top: -4px;
  right: 0;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  transition: background 0.2s, border-color 0.2s;
}

.nw-close:hover {
  background: rgba(34, 211, 238, 0.15);
  border-color: rgba(34, 211, 238, 0.4);
}

.nw-messages {
  position: relative;
  z-index: 1;
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nw-msg {
  max-width: 92%;
  padding: 10px 12px;
  font-size: 0.82rem;
  line-height: 1.45;
  border-radius: 12px;
}

.nw-msg--user {
  align-self: flex-end;
  background: rgba(37, 99, 235, 0.45);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #eff6ff;
}

.nw-msg--nora {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.nw-msg-label {
  font-size: 0.65rem;
  font-weight: 600;
  background: linear-gradient(90deg, #22d3ee, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}

.nw-msg--nora p,
.nw-answer-body p {
  margin: 0 0 8px;
  line-height: 1.5;
  font-size: 0.88rem;
}

.nw-answer-body .nora-section-title {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #818cf8;
  margin: 12px 0 6px;
}

.nw-answer-body .nora-section-title:first-child {
  margin-top: 0;
}

.nw-answer-body .nora-sources-fold {
  margin-top: 10px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  padding-top: 2px;
}

.nw-answer-body .nora-sources-fold > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nw-answer-body .nora-sources-fold > summary::-webkit-details-marker {
  display: none;
}

.nw-answer-body .nora-sources-fold > summary::before {
  content: "▸";
  font-size: 9px;
  color: #818cf8;
  transition: transform 0.15s ease;
}

.nw-answer-body .nora-sources-fold[open] > summary::before {
  transform: rotate(90deg);
}

.nw-answer-body .nora-section-title--fold {
  margin: 8px 0 0;
}

.nw-answer-body .nora-sources-fold[open] > .nora-section-body {
  margin-top: 6px;
}

.nw-answer-body .nora-answer-list {
  margin: 0 0 8px;
  padding-left: 1.1rem;
  font-size: 0.86rem;
}

.nw-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.nw-ref-chip {
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(129, 140, 248, 0.35);
  color: #c7d2fe;
}

.nw-typing {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  color: #94a3b8;
  padding: 6px 8px;
}

.nw-typing.is-visible { display: flex; }

.nw-typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: linear-gradient(90deg, #06b6d4, #3b82f6);
  display: inline-block;
  animation: nw-dot 1.2s ease-in-out infinite;
}

.nw-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.nw-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes nw-dot {
  0%, 80%, 100% { opacity: 0.3; }
  40% { opacity: 1; }
}

.nw-input-row {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nw-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(34, 211, 238, 0.22);
  background: rgba(0, 0, 0, 0.28);
  color: #f1f5f9;
  font-family: inherit;
  font-size: 0.85rem;
  resize: none;
  min-height: 44px;
}

.nw-input:focus {
  outline: none;
  border-color: #22d3ee;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.2);
}

.nw-actions {
  display: flex;
  gap: 8px;
}

.nw-send {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, #06b6d4, #2563eb);
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: transform 0.2s, filter 0.2s;
}

.nw-send:hover {
  transform: scale(1.02);
  filter: brightness(1.08);
}

.nw-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.nw-link-full {
  font-size: 0.72rem;
  color: #67e8f9;
  text-align: center;
  text-decoration: none;
}

.nw-link-full:hover { text-decoration: underline; }

.nw-banner {
  margin: 0 12px 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fecaca;
  font-size: 0.75rem;
  display: none;
}

.nw-banner.is-visible { display: block; }
