/* Wizara — public homepage (root /). No dependency on /app. */

:root {
  --bg-deep: #07070c;
  --bg-elevated: #0e0e16;
  --surface: rgba(18, 18, 28, 0.72);
  --border: rgba(139, 92, 246, 0.12);
  --border-strong: rgba(139, 92, 246, 0.28);
  --text: #ececf4;
  --text-muted: #8c8c9e;
  --accent: #a78bfa;
  --accent-dim: #7c3aed;
  --glow: rgba(139, 92, 246, 0.35);
  --radius: 1rem;
  --radius-lg: 1.35rem;
  --nav-h: 4rem;
  /* Match admin app: src/index.css @theme --font-sans */
  --font: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Inter", ui-sans-serif, system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-deep);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Ambient background */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(124, 58, 237, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(99, 102, 241, 0.08), transparent 50%),
    radial-gradient(ellipse 50% 35% at 0% 80%, rgba(139, 92, 246, 0.1), transparent 45%),
    var(--bg-deep);
}

/* Nav */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 2rem);
  background: rgba(7, 7, 12, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.nav__logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--text);
  text-decoration: none;
}

.nav__links {
  display: none;
  gap: 1.75rem;
}

@media (min-width: 768px) {
  .nav__links {
    display: flex;
  }
}

.nav__links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: color 0.2s;
}

.nav__links a:hover {
  color: var(--accent);
}

.nav__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.15rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.nav__cta:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.nav__toggle {
  display: flex;
  padding: 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
}

@media (min-width: 768px) {
  .nav__toggle {
    display: none;
  }
}

.nav__mobile {
  display: none;
  position: fixed;
  top: var(--nav-h);
  left: 0;
  right: 0;
  padding: 1rem;
  background: rgba(14, 14, 22, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  flex-direction: column;
  gap: 0.75rem;
  z-index: 99;
}

.nav__mobile.is-open {
  display: flex;
}

.nav__mobile a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 0;
}

/* Main */
main {
  padding-top: var(--nav-h);
}

section {
  scroll-margin-top: calc(var(--nav-h) + 0.5rem);
}

.wrap {
  width: 100%;
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

/* Hero */
.hero {
  padding: clamp(2.5rem, 8vw, 5rem) 0 clamp(3rem, 10vw, 6rem);
  text-align: center;
}

.hero__eyebrow {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
  opacity: 0.9;
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
  margin: 0 auto 1.25rem;
  max-width: 18ch;
  background: linear-gradient(180deg, #fff 0%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero__sub {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 42rem;
  margin: 0 auto 2.5rem;
  line-height: 1.65;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Chat panel — dominant */
.chat-panel {
  max-width: 52rem;
  margin: 0 auto 2.5rem;
  padding: clamp(1.25rem, 4vw, 2rem);
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 24px 80px -24px var(--glow),
    0 0 120px -40px rgba(124, 58, 237, 0.25);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  text-align: left;
}

.chat-panel__label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.chat__row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.chat__row--scroll {
  max-height: min(40vh, 22rem);
  overflow-y: auto;
  scroll-behavior: smooth;
  padding-right: 0.25rem;
}

.chat__row--scroll::-webkit-scrollbar {
  width: 6px;
}

.chat__row--scroll::-webkit-scrollbar-thumb {
  background: rgba(167, 139, 250, 0.25);
  border-radius: 999px;
}

.chat__bubble {
  max-width: 95%;
  padding: 0.9rem 1.1rem;
  border-radius: 1rem;
  font-size: 0.9375rem;
  line-height: 1.55;
}

.chat__bubble--ai,
.chat__bubble--bot {
  align-self: flex-start;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.2);
  color: var(--text);
}

.chat__bubble--user {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.chat__input-wrap {
  margin-top: 1.25rem;
  padding: 0.35rem;
  border-radius: 0.9rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
}

.chat__input-row {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
}

.js-onboarding-panel.chat-panel--bot-typing .chat__input,
.js-onboarding-panel.chat-panel--bot-typing .chat__submit {
  opacity: 0.55;
  pointer-events: none;
}

.js-onboarding-panel.chat-panel--done .chat__input-wrap {
  opacity: 0.65;
  pointer-events: none;
}

.chat__error {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  color: #fca5a5;
}

.chat__input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 0.85rem 0.5rem 0.85rem 1rem;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: transparent;
  border: none;
  outline: none;
}

.chat__submit {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  transition: opacity 0.2s, transform 0.15s, filter 0.2s;
}

.chat__submit:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.chat__submit:focus-visible {
  outline: 2px solid rgba(167, 139, 250, 0.65);
  outline-offset: 2px;
}

.chat__submit:active {
  transform: translateY(0);
}

.chat__submit:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
  filter: none;
}

.chat__input::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
}

.chat__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.chip {
  display: inline-flex;
  padding: 0.4rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.chip:hover {
  border-color: rgba(167, 139, 250, 0.35);
  color: var(--accent);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.75rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}

.btn--primary {
  color: var(--bg-deep);
  background: linear-gradient(135deg, #c4b5fd 0%, var(--accent-dim) 100%);
  box-shadow: 0 8px 32px rgba(124, 58, 237, 0.35);
}

.btn--secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-strong);
}

.btn:hover {
  opacity: 0.94;
  transform: translateY(-1px);
}

/* Section titles */
.section-head {
  text-align: center;
  margin-bottom: clamp(2rem, 5vw, 3rem);
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
}

.section-head p {
  color: var(--text-muted);
  max-width: 36rem;
  margin: 0 auto;
  font-size: 0.95rem;
}

/* System + generic grids */
.section {
  padding: clamp(3rem, 8vw, 5rem) 0;
  border-top: 1px solid var(--border);
}

.grid-2 {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

.grid-3 {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.grid-4 {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

.card {
  padding: 1.35rem 1.25rem;
  border-radius: var(--radius);
  background: rgba(14, 14, 22, 0.65);
  border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover {
  border-color: rgba(167, 139, 250, 0.25);
  box-shadow: 0 0 40px -20px var(--glow);
}

.card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.feature-icon {
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent);
  font-size: 1.1rem;
}

/* Footer */
.footer {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer__brand {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.footer__links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
}

.footer__links a:hover {
  color: var(--accent);
}

.footer__copy {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.8;
}

/* Contact modal — chat window */
.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.contact-modal:not([hidden]) {
  opacity: 1;
  visibility: visible;
}

.contact-modal__backdrop {
  position: absolute;
  inset: 0;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  background: rgba(5, 5, 12, 0.72);
  backdrop-filter: blur(8px);
}

.contact-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 26rem);
  max-height: min(90vh, 36rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 1.35rem;
  background: linear-gradient(165deg, rgba(22, 22, 34, 0.95) 0%, rgba(12, 12, 22, 0.98) 100%);
  border: 1px solid rgba(167, 139, 250, 0.22);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 24px 64px -24px rgba(0, 0, 0, 0.65),
    0 0 80px -30px rgba(124, 58, 237, 0.35);
}

.contact-modal__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.contact-modal__eyebrow {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.35rem;
}

.contact-modal__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
  line-height: 1.2;
}

.contact-modal__subtitle {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.contact-modal__x {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.65rem;
  border: 1px solid var(--border);
  background: rgba(14, 14, 22, 0.8);
  color: var(--text-muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.contact-modal__x:hover {
  color: var(--text);
  border-color: rgba(167, 139, 250, 0.35);
}

.contact-modal__chat {
  padding: 1rem 1.25rem 1.25rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.contact-modal__bubble {
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 0.85rem 1rem;
  border-radius: 1rem 1rem 1rem 0.35rem;
  margin-bottom: 1rem;
  max-width: 100%;
}

.contact-modal__bubble--ai {
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.2);
  color: var(--text-muted);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.contact-form__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.contact-form__input,
.contact-form__textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: rgba(8, 8, 14, 0.75);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-form__input::placeholder,
.contact-form__textarea::placeholder {
  color: rgba(148, 163, 184, 0.55);
}

.contact-form__input:focus,
.contact-form__textarea:focus {
  outline: none;
  border-color: rgba(167, 139, 250, 0.45);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.contact-form__textarea {
  resize: vertical;
  min-height: 6rem;
}

.contact-form__submit {
  margin-top: 0.35rem;
  width: 100%;
  justify-content: center;
}

.contact-form__submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.contact-modal__status {
  font-size: 0.85rem;
  line-height: 1.45;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
}

/* Pinned below the scroll area so success/error is never hidden under the form scroller */
.contact-modal__status--dock {
  flex-shrink: 0;
  margin: 0;
  border-top: 1px solid var(--border);
  border-radius: 0 0 1.35rem 1.35rem;
  padding: 0.85rem 1.25rem 1rem;
}

.contact-modal__status[data-tone="success"] {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.28);
  color: #86efac;
}

.contact-modal__status[data-tone="error"] {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
