/* ============================================================================
   FlorAI · design system 2026 — «quiet luxury florist»
   Светлая тема + тёмная (prefers-color-scheme). Мягкое стекло, тёплые градиенты,
   микроанимации, крупные радиусы, аккуратная типографика.
   ========================================================================== */

:root {
  --bg: #f7f2f4;
  --bg-2: #efe7ec;
  --surface: #ffffff;
  --surface-2: #fbf7f9;
  --text: #221a24;
  --muted: #857d88;
  --line: #ece1e8;
  --rose: #e23a72;
  --violet: #8a3ffc;
  --emerald: #12a679;
  --amber: #e0a100;
  --accent: var(--rose);
  --accent-2: var(--violet);
  --accent-soft: #fde7f0;
  --grad: linear-gradient(135deg, #ff4d8d 0%, #a24bff 100%);
  --grad-2: linear-gradient(135deg, #12a679 0%, #3ad29f 100%);
  --shadow-sm: 0 2px 8px rgba(80, 30, 70, 0.06);
  --shadow: 0 18px 40px -20px rgba(80, 30, 70, 0.28);
  --shadow-lg: 0 30px 70px -30px rgba(80, 30, 70, 0.4);
  --radius: 22px;
  --radius-sm: 14px;
  --ring: 0 0 0 4px rgba(226, 58, 114, 0.16);
  --sidebar: 256px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14101a;
    --bg-2: #1b1421;
    --surface: #1e1725;
    --surface-2: #241b2d;
    --text: #f3eef5;
    --muted: #a99fb0;
    --line: #322839;
    --accent-soft: #3a1f30;
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
    --shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 40px 80px -34px rgba(0, 0, 0, 0.8);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; color: var(--text); background: var(--bg);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.55; -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(1200px 600px at 100% -10%, rgba(162, 75, 255, 0.12), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(255, 77, 141, 0.12), transparent 55%);
  background-attachment: fixed;
}
a { color: var(--accent); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--violet); }
h1, h2, h3 { line-height: 1.18; letter-spacing: -0.02em; }
img { max-width: 100%; }

/* ------------------------------- App shell ------------------------------- */
.layout { display: flex; min-height: 100vh; }
body.app .container > h1:first-child { display: none; }
.sidebar {
  width: var(--sidebar); flex: 0 0 var(--sidebar); position: sticky; top: 0; height: 100vh;
  padding: 22px 16px; display: flex; flex-direction: column; gap: 6px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  backdrop-filter: blur(18px); border-right: 1px solid var(--line);
}
.sidebar .brand {
  font-weight: 800; font-size: 19px; padding: 6px 12px 18px;
  display: flex; align-items: center; gap: 9px; letter-spacing: -0.02em;
}
.sidebar .brand .dot {
  width: 30px; height: 30px; border-radius: 10px; background: var(--grad);
  display: grid; place-items: center; color: #fff; font-size: 15px; box-shadow: var(--shadow-sm);
}
.sidebar nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.sidebar nav a {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 13px;
  color: var(--text); font-size: 14.5px; font-weight: 500; position: relative;
  transition: background .2s var(--ease), transform .2s var(--ease), color .2s var(--ease);
}
.sidebar nav a .ico { font-size: 16px; width: 20px; text-align: center; filter: saturate(0.9); }
.sidebar nav a:hover { background: var(--accent-soft); transform: translateX(3px); }
.sidebar nav a.active { background: var(--grad); color: #fff; box-shadow: var(--shadow-sm); }
.sidebar .side-foot { margin-top: auto; padding: 10px 6px 0; border-top: 1px solid var(--line); }
.sidebar .side-foot .link { color: var(--muted); font-size: 13.5px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.appbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; padding: 16px 30px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
}
.appbar .page-title { font-size: 20px; font-weight: 700; }
.appbar .crumbs { color: var(--muted); font-size: 13px; }
.appbar .appbar-actions { display: flex; align-items: center; gap: 12px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); display: grid; place-items: center; position: relative; color: var(--text);
}
.icon-btn:hover { box-shadow: var(--shadow-sm); }
.icon-btn .badge-dot {
  position: absolute; top: -5px; right: -5px; background: var(--rose); color: #fff;
  border-radius: 999px; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px;
  display: none; align-items: center; justify-content: center; padding: 0 5px;
}
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 26px 30px 90px; }

/* ------------------------------ Components ------------------------------- */
.card {
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  margin: 16px 0; box-shadow: var(--shadow); backdrop-filter: blur(6px);
  animation: fadeUp .5s var(--ease) both;
}
.card:hover { box-shadow: var(--shadow-lg); }
.card.narrow { max-width: 460px; margin: 60px auto; }
.card.tint-rose { background: color-mix(in srgb, var(--rose) 10%, var(--surface)); border-color: color-mix(in srgb, var(--rose) 26%, var(--line)); }
.card.tint-green { background: color-mix(in srgb, var(--emerald) 10%, var(--surface)); border-color: color-mix(in srgb, var(--emerald) 26%, var(--line)); }
.card.tint-blue { background: color-mix(in srgb, #3b82f6 12%, var(--surface)); border-color: color-mix(in srgb, #3b82f6 26%, var(--line)); }
.card.tint-violet { background: color-mix(in srgb, var(--violet) 12%, var(--surface)); border-color: color-mix(in srgb, var(--violet) 26%, var(--line)); }
.card.tint-amber { background: color-mix(in srgb, var(--amber) 12%, var(--surface)); border-color: color-mix(in srgb, var(--amber) 30%, var(--line)); }
tr.unread-row { background: color-mix(in srgb, var(--rose) 10%, transparent); }
.card h2 { font-size: 17px; margin: 0 0 14px; display: flex; align-items: center; gap: 8px; }
.muted { color: var(--muted); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 16px 0; }
.stat {
  position: relative; overflow: hidden; border-radius: var(--radius); padding: 22px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  animation: fadeUp .5s var(--ease) both;
}
.stat::after {
  content: ""; position: absolute; inset: 0; background: var(--grad); opacity: 0;
  transition: opacity .35s var(--ease);
}
.stat:hover { transform: translateY(-3px); }
.stat .num {
  font-size: 34px; font-weight: 800; letter-spacing: -0.03em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat .lbl { color: var(--muted); font-size: 13px; margin-top: 2px; }

.msg { background: color-mix(in srgb, var(--emerald) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--emerald) 34%, var(--line)); color: var(--emerald); padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 14px; animation: fadeUp .4s var(--ease) both; }
.error { background: color-mix(in srgb, var(--rose) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--rose) 34%, var(--line)); color: var(--rose); padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 14px; }
.notice { background: color-mix(in srgb, var(--amber) 14%, var(--surface)); border: 1px solid color-mix(in srgb, var(--amber) 32%, var(--line)); color: color-mix(in srgb, var(--amber) 70%, var(--text)); padding: 13px 16px; border-radius: var(--radius-sm); margin: 12px 0; font-size: 14px; }
.notice a { color: inherit; text-decoration: underline; }

label { display: block; margin: 13px 0; font-size: 13.5px; color: var(--muted); font-weight: 500; }
input, textarea, select {
  width: 100%; margin-top: 6px; padding: 12px 14px; font-size: 15px; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2);
  font-family: inherit; transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--rose); box-shadow: var(--ring); }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 13px;
  cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font-size: 14px; font-weight: 600; font-family: inherit; position: relative; overflow: hidden;
  transition: transform .15s var(--ease), box-shadow .25s var(--ease), background .2s;
}
.btn:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.99); }
.btn.primary { background: var(--grad); color: #fff; border: none; box-shadow: 0 10px 24px -12px rgba(162, 75, 255, 0.9); }
.btn.primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%); transform: translateX(-120%); transition: transform .7s var(--ease); }
.btn.primary:hover::after { transform: translateX(120%); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 8px 14px; font-size: 13px; border-radius: 11px; }
.inline { display: inline; }
.link { background: none; border: none; color: var(--muted); font-size: 14px; cursor: pointer; padding: 0; }
.link:hover { color: var(--text); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

code.copy { display: block; background: #221a24; color: #7fe08a; padding: 13px 15px; border-radius: var(--radius-sm); font-size: 13px; word-break: break-all; font-family: ui-monospace, "SF Mono", Menlo, monospace; }

table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
th, td { text-align: left; padding: 13px 15px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.03em; }
tbody tr { transition: background .18s; }
tbody tr:hover { background: var(--accent-soft); }
tbody tr:last-child td { border-bottom: none; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.active { background: color-mix(in srgb, var(--emerald) 16%, transparent); color: var(--emerald); }
.badge.trial { background: color-mix(in srgb, var(--amber) 20%, transparent); color: color-mix(in srgb, var(--amber) 80%, var(--text)); }
.badge.suspended { background: color-mix(in srgb, var(--rose) 16%, transparent); color: var(--rose); }

details.card > summary { cursor: pointer; font-weight: 700; font-size: 16px; list-style: none; display: flex; align-items: center; gap: 8px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "▾"; margin-left: auto; transition: transform .25s var(--ease); color: var(--muted); }
details.card[open] > summary::after { transform: rotate(180deg); }
details.card[open] > summary { margin-bottom: 12px; }

/* ------------------------------ Animations ------------------------------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.card:nth-of-type(2) { animation-delay: .05s; }
.card:nth-of-type(3) { animation-delay: .1s; }
.card:nth-of-type(4) { animation-delay: .15s; }
.card:nth-of-type(5) { animation-delay: .2s; }
.stat:nth-child(2) { animation-delay: .05s; }
.stat:nth-child(3) { animation-delay: .1s; }
.stat:nth-child(4) { animation-delay: .15s; }

/* ------------------------------- Playground ------------------------------ */
.chat-log { display: grid; gap: 12px; margin: 14px 0; max-height: 460px; overflow-y: auto; padding: 6px; }
.bubble { padding: 12px 16px; border-radius: 18px; font-size: 14.5px; max-width: 78%; animation: fadeUp .35s var(--ease) both; white-space: pre-wrap; }
.bubble.user { background: var(--accent-soft); justify-self: end; border-bottom-right-radius: 6px; }
.bubble.bot { background: linear-gradient(135deg, rgba(255,77,141,0.14), rgba(162,75,255,0.14)); justify-self: start; border-bottom-left-radius: 6px; }
.bubble.tool { background: var(--surface-2); color: var(--muted); font-size: 12.5px; justify-self: start; border: 1px dashed var(--line); font-family: ui-monospace, monospace; }

/* ------------------------------ Public site ------------------------------ */
.site-nav { display: flex; align-items: center; justify-content: space-between; padding: 16px 32px; position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.site-nav .brand { font-size: 20px; }
.site-nav nav { display: flex; gap: 22px; align-items: center; }
.site-nav nav a { color: var(--text); font-size: 14px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
section { padding: 72px 0; }
.hero { background: radial-gradient(900px 400px at 80% -10%, rgba(226,58,114,0.16), transparent 60%), radial-gradient(700px 400px at 10% 10%, rgba(138,63,252,0.14), transparent 55%); padding: 84px 0 64px; }
.hero h1 { font-size: 48px; margin: 0 0 16px; letter-spacing: -0.03em; }
.hero .lead { font-size: 19px; color: var(--muted); max-width: 640px; margin: 0 0 28px; }
.hero .actions { gap: 14px; }
.btn.lg { padding: 15px 28px; font-size: 16px; border-radius: 15px; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 7px 15px; font-size: 13px; color: var(--muted); margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 44px; }
.section-head h2 { font-size: 33px; margin: 0 0 12px; }
.section-head p { color: var(--muted); font-size: 17px; margin: 0; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); transition: transform .3s var(--ease); }
.feature:hover { transform: translateY(-4px); }
.feature .ico { font-size: 28px; margin-bottom: 12px; animation: floaty 4s ease-in-out infinite; }
.feature h3 { font-size: 17px; margin: 0 0 8px; }
.feature p { color: var(--muted); font-size: 14px; margin: 0; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.step .n { width: 36px; height: 36px; border-radius: 12px; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 12px; }
.step h3 { font-size: 16px; margin: 0 0 6px; }
.step p { color: var(--muted); font-size: 14px; margin: 0; }
.split { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 10px 0 10px 36px; position: relative; border-bottom: 1px solid var(--line); font-size: 15px; }
.checklist li::before { content: "✓"; position: absolute; left: 0; top: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; }
.panel { background: linear-gradient(160deg, #2a1a2e, #3d1f3a); color: #fff; border-radius: 26px; padding: 32px; box-shadow: var(--shadow-lg); }
.panel h3 { margin: 0 0 18px; color: #fff; }
.chat { display: grid; gap: 12px; }
.bubble.bot, .bubble.user { }
.panel .bubble.user { background: rgba(255,255,255,0.12); justify-self: start; }
.panel .bubble.bot { background: var(--grad); justify-self: end; }
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.price-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); display: flex; flex-direction: column; transition: transform .3s var(--ease); }
.price-card:hover { transform: translateY(-4px); }
.price-card.featured { border: 2px solid var(--rose); position: relative; }
.price-card .tag { position: absolute; top: -13px; left: 24px; background: var(--grad); color: #fff; font-size: 12px; padding: 4px 12px; border-radius: 999px; }
.price-card h3 { margin: 0 0 6px; font-size: 18px; }
.price-card .price { font-size: 32px; font-weight: 800; margin: 6px 0 14px; }
.price-card ul { list-style: none; padding: 0; margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.price-card li { padding: 6px 0; }
.price-card .btn { margin-top: auto; justify-content: center; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 12px; box-shadow: var(--shadow-sm); }
.faq summary { cursor: pointer; font-weight: 600; }
.faq p { color: var(--muted); margin: 10px 0 0; font-size: 14px; }
.cta { text-align: center; background: var(--grad); color: #fff; border-radius: 28px; padding: 60px 32px; box-shadow: var(--shadow-lg); }
.cta h2 { font-size: 33px; margin: 0 0 12px; color: #fff; }
.cta p { opacity: 0.92; margin: 0 0 26px; }
.cta .btn { background: #fff; color: var(--rose); border: none; }
footer { padding: 40px 0; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); margin-top: 30px; }
footer .cols { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* -------------------------------- Admin ---------------------------------- */
.admin-topbar { background: #221a24; color: #fff; }
.admin-topbar .brand { color: #fff; }
.admin-topbar nav a { color: #d8cfd6; }
.admin-topbar .link { color: #d8cfd6; }

/* ------------------------------ Responsive ------------------------------- */
@media (max-width: 980px) {
  .layout { flex-direction: column; }
  .sidebar { position: static; width: auto; flex: none; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .sidebar .brand { padding-bottom: 0; }
  .sidebar .side-foot { margin: 0; border: none; }
  .cards, .steps, .pricing { grid-template-columns: 1fr 1fr; }
  .split { grid-template-columns: 1fr; }
  .hero h1 { font-size: 36px; }
}
@media (max-width: 640px) {
  .cards, .steps, .pricing, .grid { grid-template-columns: 1fr; }
  .container { padding: 18px 16px 70px; }
  .appbar { padding: 12px 16px; }
  .hero h1 { font-size: 29px; }
  .site-nav nav { gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
