:root {
  --bg: #070b14;
  --bg-soft: #0c1220;
  --bg-elev: #121a2b;
  --line: rgba(94, 210, 214, 0.22);
  --text: #e8eef8;
  --muted: #8b9bb4;
  --accent: #5ed2d6;
  --accent-2: #f0a35e;
  --accent-deep: #2a8f93;
  --ok: #6fbf8d;
  --warn: #e0b35a;
  --err: #d66a66;
  --radius: 16px;
  --font-display: "Syne", "Outfit", system-ui, sans-serif;
  --font-body: "Outfit", system-ui, sans-serif;
  --container: min(1120px, calc(100% - 2.5rem));
  --nav-h: 72px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  overflow-x: hidden;
}
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

/* ========== Landing: Astronaut space ========== */
.landing {
  min-height: 100vh;
  position: relative;
  background:
    radial-gradient(ellipse 900px 500px at 70% 10%, rgba(94, 210, 214, 0.12), transparent 55%),
    radial-gradient(ellipse 700px 480px at 10% 80%, rgba(240, 163, 94, 0.08), transparent 50%),
    linear-gradient(180deg, #050810 0%, #0a1020 40%, #070b14 100%);
}

.stars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 8% 12%, rgba(255,255,255,.85), transparent),
    radial-gradient(1px 1px at 22% 40%, rgba(255,255,255,.55), transparent),
    radial-gradient(1.5px 1.5px at 40% 18%, rgba(255,255,255,.7), transparent),
    radial-gradient(1px 1px at 55% 70%, rgba(255,255,255,.45), transparent),
    radial-gradient(1.5px 1.5px at 72% 30%, rgba(255,255,255,.8), transparent),
    radial-gradient(1px 1px at 88% 55%, rgba(255,255,255,.5), transparent),
    radial-gradient(1px 1px at 15% 78%, rgba(255,255,255,.4), transparent),
    radial-gradient(1.5px 1.5px at 63% 88%, rgba(255,255,255,.65), transparent),
    radial-gradient(1px 1px at 93% 15%, rgba(255,255,255,.55), transparent);
  animation: twinkle 8s ease-in-out infinite alternate;
}
@keyframes twinkle {
  from { opacity: .55; }
  to { opacity: 1; }
}

.landing > *:not(.stars) { position: relative; z-index: 1; }

.nav {
  width: var(--container);
  margin: 0 auto;
  min-height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}
.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
  letter-spacing: -.02em;
  display: inline-flex;
  align-items: baseline;
  gap: .35rem;
  z-index: 20;
}
.brand span { color: var(--accent); }
.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  color: var(--muted);
}
.nav-links a:hover { color: var(--text); }

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.03);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  z-index: 20;
}
.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  position: relative;
  transition: transform .2s ease;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }
.nav.is-open .nav-toggle span { background: transparent; }
.nav.is-open .nav-toggle span::before { top: 0; transform: rotate(45deg); }
.nav.is-open .nav-toggle span::after { top: 0; transform: rotate(-45deg); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: .85rem 1.35rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #041016;
}
.btn-ghost {
  border-color: var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
}
.btn-sm { padding: .55rem 1rem; font-size: .92rem; }

/* Hero: one composition, brand first, full-bleed space */
.hero {
  width: 100%;
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 75% 45%, rgba(42, 143, 147, 0.18), transparent 60%),
    radial-gradient(ellipse 50% 40% at 20% 70%, rgba(240, 163, 94, 0.1), transparent 55%);
  pointer-events: none;
}
.hero-orbit {
  position: absolute;
  width: min(520px, 48vw);
  height: min(520px, 48vw);
  right: 4%;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid rgba(94, 210, 214, 0.15);
  border-radius: 50%;
  pointer-events: none;
  animation: orbit-spin 48s linear infinite;
}
.hero-orbit::before {
  content: "";
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-2);
  top: 8%;
  left: 50%;
  box-shadow: 0 0 16px rgba(240, 163, 94, 0.45);
}
@keyframes orbit-spin {
  to { transform: translateY(-50%) rotate(360deg); }
}

.hero-grid {
  width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: center;
  padding: 2rem 0 3.5rem;
  position: relative;
  z-index: 2;
}
.hero-copy { animation: rise .85s ease both; max-width: 34rem; }
.hero-copy h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.8rem, 6.5vw, 5.2rem);
  line-height: .95;
  margin: 0 0 1rem;
  letter-spacing: -.03em;
}
.hero-copy h1 em {
  font-style: normal;
  color: var(--accent);
}
.hero-copy p {
  color: var(--muted);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  margin: 0 0 1.75rem;
  font-weight: 300;
  max-width: 28rem;
}
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; }

.hero-visual {
  display: grid;
  place-items: center;
  animation: float 6s ease-in-out infinite;
  min-height: 280px;
}
.hero-visual svg {
  width: min(380px, 100%);
  height: auto;
  filter: drop-shadow(0 24px 40px rgba(0,0,0,.35));
}
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

.section {
  width: var(--container);
  margin: 0 auto;
  padding: clamp(3.5rem, 7vw, 5.5rem) 0;
  border-top: 1px solid rgba(255,255,255,.05);
}
.section-head {
  max-width: 36rem;
  margin-bottom: 2rem;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin: 0 0 .55rem;
  letter-spacing: -.02em;
}
.section-head p { color: var(--muted); margin: 0; }

.feature-grid,
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
}

.contact-form {
  width: 100%;
  padding: 1.4rem 1.35rem;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(18, 26, 43, .9), rgba(12, 18, 32, .5));
}
.contact-form .form-row {
  grid-template-columns: 1fr 1fr;
}
.feature {
  padding: 1.4rem 1.35rem;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(18, 26, 43, .9), rgba(12, 18, 32, .5));
  animation: rise .7s ease both;
}
.feature:nth-child(2) { animation-delay: .08s; }
.feature:nth-child(3) { animation-delay: .16s; }
.feature .feature-icon {
  width: 40px;
  height: 40px;
  margin-bottom: .85rem;
  color: var(--accent);
}
.feature h3 { margin: 0 0 .45rem; font-size: 1.1rem; font-family: var(--font-display); }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }

.price-card {
  padding: 1.6rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.07);
  background: var(--bg-elev);
  display: flex;
  flex-direction: column;
  gap: .9rem;
  min-width: 0;
}
.price-card.featured {
  border-color: rgba(94, 210, 214, .45);
  background: linear-gradient(180deg, rgba(94, 210, 214, .08), var(--bg-elev));
}
.price-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.55rem;
}
.price-card .amount {
  font-size: clamp(1.5rem, 2.5vw, 1.9rem);
  font-weight: 600;
  color: var(--accent);
}
.price-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  flex: 1;
}
.price-card li { padding: .3rem 0; }

.footer {
  width: var(--container);
  margin: 0 auto;
  padding: 2rem 0 3rem;
  border-top: 1px solid rgba(255,255,255,.05);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.footer a {
  color: var(--accent, #5ed2d6);
  text-decoration: none;
}
.footer a:hover { text-decoration: underline; }

/* Auth */
.auth-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  box-sizing: border-box;
  background:
    radial-gradient(700px 420px at 90% 0%, rgba(94, 210, 214, .12), transparent 50%),
    var(--bg);
}
.auth-card {
  width: min(440px, 100%);
  margin: 0 auto;
  padding: clamp(1.4rem, 4vw, 2rem);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--bg-elev);
}
.auth-card h1 {
  font-family: var(--font-display);
  margin: 0 0 .25rem;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
}
.auth-card .muted { color: var(--muted); margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: .35rem; color: var(--muted); font-size: .9rem; }
.form-control {
  width: 100%;
  padding: .8rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.08);
  background: #0c1220;
  color: var(--text);
}
.form-control:focus {
  outline: none;
  border-color: rgba(94, 210, 214, .55);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }

/* Panel */
.panel-body { background: var(--bg); }
.panel-shell {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  min-height: 100vh;
}
.panel-sidebar {
  background: var(--bg-soft);
  border-right: 1px solid rgba(255,255,255,.05);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.panel-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.4rem;
  padding: 0 .6rem;
}
.panel-brand span { color: var(--accent); }
.panel-sidebar nav { display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.panel-sidebar nav a {
  padding: .7rem .8rem;
  border-radius: 10px;
  color: var(--muted);
}
.panel-sidebar nav a:hover,
.panel-sidebar nav a.active {
  background: rgba(94, 210, 214, .1);
  color: var(--text);
}
.panel-logout button {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255,255,255,.08);
  color: var(--muted);
  border-radius: 10px;
  padding: .7rem;
  cursor: pointer;
}
.panel-main {
  padding: clamp(1rem, 2.5vw, 1.5rem) clamp(1rem, 3vw, 2rem) 3rem;
  min-width: 0;
}
.panel-top { margin-bottom: 1.5rem; }
.panel-top h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}
.panel-top p { margin: .2rem 0 0; color: var(--muted); }

.flash {
  padding: .9rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}
.flash-ok { background: rgba(111,191,141,.12); border-color: rgba(111,191,141,.3); }
.flash-warn { background: rgba(224,179,90,.12); border-color: rgba(224,179,90,.3); }
.flash-err { background: rgba(214,106,102,.12); border-color: rgba(214,106,102,.3); }

.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.stat, .card {
  background: var(--bg-elev);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
  padding: 1.2rem;
  min-width: 0;
}
.stat .label { color: var(--muted); font-size: .85rem; }
.stat .value { font-size: 1.8rem; font-weight: 600; margin-top: .2rem; }
.card h3 { margin: 0 0 1rem; font-size: 1.1rem; }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; min-width: 520px; }
.table th, .table td {
  text-align: left;
  padding: .75rem .4rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-size: .95rem;
}
.table th { color: var(--muted); font-weight: 500; }
.badge {
  display: inline-block;
  padding: .2rem .55rem;
  border-radius: 8px;
  font-size: .78rem;
  background: rgba(255,255,255,.06);
}
.badge-ok { background: rgba(111,191,141,.18); color: #9fd9b4; }
.badge-warn { background: rgba(224,179,90,.18); color: #efd08a; }
.actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin: 1rem 0;
}
.actions form {
  display: inline-flex;
  margin: 0;
  padding: 0;
  border: 0;
  vertical-align: middle;
}
.actions .btn,
.actions .badge {
  margin: 0;
}
.muted { color: var(--muted); }
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #070b14;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 1rem;
  overflow: auto;
  font-size: .85rem;
  color: var(--accent);
}
.widget-preview-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: 1.25rem;
}
.preview-stage {
  position: relative;
  min-height: 420px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #152033, #0c1220);
  border: 1px solid rgba(255,255,255,.06);
  overflow: hidden;
}
.preview-chat {
  position: absolute;
  bottom: 20px;
  width: min(280px, calc(100% - 40px));
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0,0,0,.35);
}
.preview-chat.right { right: 20px; }
.preview-chat.left { left: 20px; }
.preview-head { padding: .85rem 1rem; color: #fff; font-weight: 600; }
.preview-body { background: #fff; color: #1a2332; padding: 1rem; min-height: 160px; }
.preview-bubble {
  background: #f2f4f7;
  border-radius: 12px;
  padding: .7rem .85rem;
  font-size: .9rem;
}

/* Panel sohbet */
.chat-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 1rem;
  align-items: start;
}
.chat-main { min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.chat-side { min-width: 0; display: flex; flex-direction: column; gap: 1rem; }
.chat-card {
  background: var(--bg-elev);
  border: 1px solid rgba(255,255,255,.06);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  min-width: 0;
}
.chat-card-head {
  padding: .85rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
}
.chat-card-head h3 { margin: 0; font-size: 1rem; }
.chat-thread {
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* stretch balonu şişirmesin */
  justify-content: flex-start;
  gap: .7rem;
  max-height: min(62vh, 580px);
  min-height: 240px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1.1rem 1rem;
  background:
    radial-gradient(ellipse at top, rgba(94,210,214,.04), transparent 55%),
    #0a101c;
}
.chat-thread .bubble-v,
.chat-thread .bubble-a,
.chat-thread .bubble-h {
  display: flex;
  flex-direction: column;
  gap: .28rem;
  width: max-content;
  max-width: min(78%, 420px);
  padding: .55rem .85rem .65rem;
  margin: 0;
  flex: 0 0 auto;
  align-self: flex-start;
  box-sizing: border-box;
  line-height: 1.4;
  font-size: .95rem;
  color: var(--text);
  box-shadow: 0 4px 14px rgba(0,0,0,.18);
}
.chat-thread .bubble-meta {
  display: block;
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .01em;
  opacity: .72;
  line-height: 1.2;
  color: inherit;
}
.chat-thread .bubble-text {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* Ziyaretçi — sağ */
.chat-thread .bubble-v {
  align-self: flex-end;
  margin-left: auto;
  background: linear-gradient(145deg, #2a8f96, #1f6f78);
  color: #f4fffe;
  border-radius: 16px 16px 4px 16px;
}
.chat-thread .bubble-v .bubble-meta { color: rgba(244,255,254,.75); }
/* Asistan — sol */
.chat-thread .bubble-a {
  background: #1a2438;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px 16px 16px 4px;
}
.chat-thread .bubble-a .bubble-meta { color: rgba(168,180,200,.9); }
/* Temsilci — sol, sıcak vurgu */
.chat-thread .bubble-h {
  background: linear-gradient(145deg, #3a2a1c, #2c2118);
  border: 1px solid rgba(240,163,94,.45);
  border-radius: 16px 16px 16px 4px;
  color: #ffe8d2;
}
.chat-thread .bubble-h .bubble-meta { color: rgba(240,163,94,.95); font-weight: 600; }
.chat-reply {
  padding: 1rem;
  border-top: 1px solid rgba(255,255,255,.06);
}
.chat-meta p { margin: 0 0 .45rem; }
@media (max-width: 900px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-thread .bubble-v,
  .chat-thread .bubble-a,
  .chat-thread .bubble-h { max-width: min(88%, 100%); }
}

.pagination { display: flex; gap: .35rem; list-style: none; padding: 1rem 0; margin: 0; flex-wrap: wrap; }
.pagination > li > a, .pagination > li > span {
  display: inline-block; padding: .4rem .7rem; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.08); color: var(--muted);
}
.pagination > .active > span, .pagination > .active > a {
  background: rgba(94, 210, 214, .2); color: var(--text); border-color: rgba(94, 210, 214, .4);
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-copy { max-width: none; margin: 0 auto; }
  .hero-copy p { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .hero-orbit { opacity: .35; right: 50%; transform: translate(50%, -50%); width: min(420px, 80vw); height: min(420px, 80vw); }
  .hero-visual { order: -1; }
  .feature-grid, .pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .widget-preview-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: fixed;
    inset: 0 0 auto 0;
    top: 0;
    padding: calc(var(--nav-h) + .5rem) 1.25rem 1.5rem;
    flex-direction: column;
    align-items: stretch;
    gap: .35rem;
    background: rgba(7, 11, 20, .96);
    border-bottom: 1px solid rgba(255,255,255,.06);
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform .25s ease, opacity .25s ease;
  }
  .nav.is-open .nav-links {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links a, .nav-links .btn { width: 100%; justify-content: center; }
  .panel-shell { grid-template-columns: 1fr; }
  .panel-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.05);
  }
  .panel-sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: .35rem;
  }
  .panel-sidebar nav a { padding: .55rem .7rem; font-size: .9rem; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --container: min(100% - 1.5rem, 1120px); }
  .feature-grid, .pricing-grid { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .hero-grid { padding-top: 1rem; padding-bottom: 2.5rem; }
  .hero-copy h1 { font-size: clamp(2.4rem, 12vw, 3.2rem); }
  .footer { flex-direction: column; align-items: flex-start; }
  .preview-stage { min-height: 340px; }
}
