/* =========================================================
   Mind-agency SaaS — styles.css (MVP Foundation)
   Font: Nunito Sans (300/400/600)
   Accent: #22c1b6
========================================================= */

/* =========================
   1) Design Tokens
========================= */
:root {
  /* Brand */
  --accent: #22c1b6;
  --accent-600: #18a99f;
  --accent-50: #e9fbf9;

  /* Neutrals */
  --bg: #ffffff;
  --bg-soft: #f8fafb;
  --bg-muted: #f3f4f6;

  --text: #111827;       /* primary */
  --text-2: #1f2937;     /* strong */
  --muted: #6b7280;      /* secondary */
  --muted-2: #9ca3af;    /* tertiary */

  --border: #e5e7eb;
  --border-strong: #d1d5db;

  /* Status */
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* Typography */
  --font: "Nunito Sans", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  --fw-light: 300;
  --fw-regular: 400;
  --fw-semibold: 600;

  --fs-12: 12px;
  --fs-14: 14px;
  --fs-16: 16px;
  --fs-18: 18px;
  --fs-20: 20px;
  --fs-24: 24px;
  --fs-32: 32px;
  --fs-40: 40px;
  --fs-48: 48px;

  --lh-tight: 1.15;
  --lh-normal: 1.5;

  /* Layout */
  --container: 1180px;

  /* Spacing (8pt-ish, but flexible) */
  --sp-4: 4px;
  --sp-6: 6px;
  --sp-8: 8px;
  --sp-10: 10px;
  --sp-12: 12px;
  --sp-14: 14px;
  --sp-16: 16px;
  --sp-20: 20px;
  --sp-24: 24px;
  --sp-28: 28px;
  --sp-32: 32px;
  --sp-40: 40px;
  --sp-48: 48px;
  --sp-56: 56px;
  --sp-64: 64px;
  --sp-80: 80px;
  --sp-96: 96px;

  /* Radius */
  --r-8: 8px;
  --r-12: 12px;
  --r-16: 16px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 6px 20px rgba(17, 24, 39, 0.08);
  --shadow-lg: 0 16px 40px rgba(17, 24, 39, 0.10);

  /* Focus ring */
  --focus: 0 0 0 3px rgba(34, 193, 182, 0.25);

  /* Transitions */
  --t-fast: 120ms ease;
  --t-base: 180ms ease;

  /* Header height */
  --header-h: 72px;
}

/* =========================
   2) Base / Reset
========================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

.btn--header {
  background: var(--accent);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 999px;       /* pill */
  font-weight: var(--fw-semibold);
  font-size: var(--fs-14);
  line-height: 1;
  box-shadow: none;
}

.btn--header:hover {
  background: var(--accent-600);
}

.btn--header:active {
  transform: translateY(0);
}

.nav__actions {
  margin-left: var(--sp-8);
}


body {
  margin: 0;
  font-family: var(--font);
  font-weight: var(--fw-light);
  color: var(--text);
  background: var(--bg);
  line-height: var(--lh-normal);
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background: rgba(34, 193, 182, 0.22);
}

/* Accessibility: visible focus */
:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--r-8);
}

/* =========================
   3) Typography
========================= */
h1, h2, h3, h4 {
  margin: 0;
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: -0.01em;
  color: var(--text-2);
}

h1 { font-size: clamp(32px, 4.2vw, var(--fs-48)); }
h2 { font-size: clamp(24px, 3.2vw, var(--fs-40)); }
h3 { font-size: var(--fs-20); }
h4 { font-size: var(--fs-18); }

p {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-16);
  line-height: var(--lh-normal);
}

.small { font-size: var(--fs-14); color: var(--muted); }
.mono  { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }

/* =========================
   4) Layout Helpers
========================= */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--sp-24);
}

.section {
  padding: var(--sp-80) 0;
}

.section--soft {
  background: var(--bg-soft);
}

.section__head {
  text-align: center;
  margin-bottom: var(--sp-48);
}

.grid {
  display: grid;
  gap: var(--sp-24);
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stack { display: flex; flex-direction: column; gap: var(--sp-16); }
.row   { display: flex; align-items: center; gap: var(--sp-16); }

.center { display: grid; place-items: center; }

.hr {
  height: 1px;
  background: var(--border);
  border: none;
  margin: var(--sp-24) 0;
}

/* =========================
   5) Header / Navigation
========================= */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  background: #ffffff;            /* без прозрачности */
  border-bottom: 1px solid var(--border);
}


.header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-24);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-10);
  font-weight: var(--fw-semibold);
  color: var(--text-2);
}

.brand__logo {
  width: 34px;
  height: 34px;
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--sp-24);
}

.nav a {
  font-size: var(--fs-14);
  font-weight: var(--fw-regular);
  color: var(--muted);
  transition: color var(--t-base);
}

.nav .btn--header {
  color: #ffffff;
}

.nav a:hover {
  color: var(--text-2);
}

.nav__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-12);
}

/* =========================
   Archive action
========================= */

.btn--ghost.text-muted {
  padding: 6px 10px;
}

.btn--ghost.text-muted:hover {
  background: var(--bg-soft);
  color: var(--text);
}


/* =========================
   Flow Cards
========================= */

.flow-cards {
  align-items: stretch;
}

.flow-card {
  position: relative;
  display: flex;
  flex-direction: column;
}

.flow-card--accent {
  border-color: rgba(34, 193, 182, 0.35);
  box-shadow: var(--shadow-md);
}

.flow-card__icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: var(--sp-8);
}

.flow-card__result {
  margin-top: auto;
  padding-top: var(--sp-16);
  font-size: var(--fs-14);
  color: var(--muted);
}

.flow-card__result strong {
  color: var(--text-2);
  font-weight: var(--fw-semibold);
}

/* =========================
   Auth Header tweaks
========================= */

.nav--auth a {
  font-weight: var(--fw-regular);
}

.nav--auth a:hover {
  color: var(--text-2);
}

/* Process builder tweaks */
.card[type="button"] {
  cursor: pointer;
  text-align: left;
}

.card[type="button"]:hover {
  border-color: rgba(34, 193, 182, 0.35);
}

/* =========================
   Status badges
========================= */

.badge--success {
  background: #eaf7f1;
  color: #1f9d6a;
  border: 1px solid #bfe9d6;
}

.badge--info {
  background: #eef6ff;
  color: #2563eb;
  border: 1px solid #c7ddff;
}

.badge--danger {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}


/* =========================
   Disabled buttons (export)
========================= */

.btn--disabled,
.btn--disabled:hover {
  opacity: 0.5;
  cursor: not-allowed;
  background: var(--bg-soft);
  color: var(--muted);
  border-color: var(--border);
  box-shadow: none;
}



/* =========================
   Checkbox (Auth)
========================= */
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-10);
  font-size: var(--fs-14);
  color: var(--muted);
  line-height: 1.4;
  cursor: pointer;
}

.checkbox input {
  margin-top: 2px;
  accent-color: var(--accent);
}

.checkbox a {
  text-decoration: underline;
}


/* =========================
   6) Buttons
========================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  padding: 12px 18px;
  border-radius: var(--r-12);
  font-size: var(--fs-14);
  font-weight: var(--fw-semibold);
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  transition:
    transform var(--t-fast),
    background var(--t-base),
    border-color var(--t-base),
    opacity var(--t-base);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: var(--accent-600);
}

.btn--secondary {
  background: #fff;
  border-color: var(--border);
  color: var(--text-2);
}

.btn--secondary:hover {
  border-color: var(--border-strong);
  background: var(--bg-soft);
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-2);
}

.btn--ghost:hover {
  background: var(--bg-soft);
}

.btn--danger {
  background: var(--danger);
  color: #fff;
}

.btn--full { width: 100%; }
.btn--sm   { padding: 10px 14px; border-radius: var(--r-10); }
.btn--lg   { padding: 14px 22px; border-radius: var(--r-12); font-size: var(--fs-16); }

.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* =========================
   7) Hero
========================= */
.hero {
  padding: var(--sp-96) 0;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: var(--sp-64);
}

.hero__lead {
  margin-top: var(--sp-16);
  max-width: 56ch;
}

.hero__actions {
  margin-top: var(--sp-32);
  display: flex;
  gap: var(--sp-12);
  flex-wrap: wrap;
}

.hero__visual {
  height: 360px;
  border-radius: var(--r-16);
  border: 1px solid rgba(34, 193, 182, 0.18);
  background:
    radial-gradient(60% 60% at 20% 20%, rgba(34, 193, 182, 0.16), transparent 60%),
    radial-gradient(60% 60% at 80% 70%, rgba(34, 193, 182, 0.12), transparent 60%),
    linear-gradient(135deg, rgba(34, 193, 182, 0.10), rgba(34, 193, 182, 0.04));
  box-shadow: var(--shadow-md);
}

/* Optional: subtle watermark inside visual */
.hero__visual::after {
  content: "";
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0.08;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 140px;
  /* background-image: url('logo-mark.svg'); */ /* подключишь позже */
}

/* =========================
   8) Cards
========================= */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-16);
  padding: var(--sp-28);
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-fast), box-shadow var(--t-base), border-color var(--t-base);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(34, 193, 182, 0.25);
}

.card__title {
  font-size: var(--fs-18);
  font-weight: var(--fw-semibold);
  color: var(--text-2);
  margin-bottom: var(--sp-8);
}

.card__text {
  font-size: var(--fs-14);
  color: var(--muted);
}

.card__icon {
  width: 28px;
  height: 28px;
  margin-bottom: var(--sp-12);
  color: var(--accent);
}

/* =========================
   9) Badges / Pills
========================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-6);
  padding: 6px 10px;
  border-radius: 999px;
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  background: var(--bg-soft);
  color: var(--text-2);
  border: 1px solid var(--border);
}

.badge--accent {
  background: var(--accent-50);
  border-color: rgba(34, 193, 182, 0.25);
  color: var(--accent-600);
}

/* =========================
   10) Process Flow
========================= */
.flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-24);
  text-align: center;
}

.flow__step {
  padding: var(--sp-24);
}

.flow__step strong {
  display: block;
  font-weight: var(--fw-semibold);
  color: var(--text-2);
  margin-bottom: var(--sp-8);
}

.flow__step p {
  font-size: var(--fs-14);
}

/* =========================
   11) Forms (Auth, Profile, Create Process)
========================= */
.form {
  display: grid;
  gap: var(--sp-16);
}

.field {
  display: grid;
  gap: var(--sp-8);
}

.label {
  font-size: var(--fs-14);
  font-weight: var(--fw-semibold);
  color: var(--text-2);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-12);
  border: 1px solid var(--border);
  background: #fff;
  font-size: var(--fs-14);
  transition: border-color var(--t-base), box-shadow var(--t-base), background var(--t-base);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: rgba(34, 193, 182, 0.55);
  box-shadow: var(--focus);
}

.field__hint {
  font-size: var(--fs-12);
  color: var(--muted);
}

.field--error .input,
.field--error .select,
.field--error .textarea {
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

.field__error {
  display: grid;
  gap: var(--sp-8);
  color: var(--danger);
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-10);
  font-size: var(--fs-14);
  color: var(--muted);
}

/* =========================
   12) Tables (Processes results)
========================= */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-16);
  overflow: hidden;
  background: #fff;
}

.table th,
.table td {
  padding: 12px 14px;
  font-size: var(--fs-14);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table th {
  text-align: left;
  font-weight: var(--fw-semibold);
  color: var(--text-2);
  background: var(--bg-soft);
}

.table tr:last-child td {
  border-bottom: none;
}

/* =========================
   13) Panels (Dashboard blocks)
========================= */
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--r-16);
  padding: var(--sp-24);
  box-shadow: var(--shadow-sm);
}

.panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-16);
  margin-bottom: var(--sp-16);
}

.panel__title {
  font-weight: var(--fw-semibold);
  color: var(--text-2);
}

.panel__sub {
  font-size: var(--fs-14);
  color: var(--muted);
}

/* =========================
   14) Empty States
========================= */
.empty {
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-16);
  padding: var(--sp-40);
  background: var(--bg-soft);
  text-align: center;
}

.empty h3 {
  margin-bottom: var(--sp-10);
}

.empty p {
  margin-bottom: var(--sp-20);
}

/* =========================
   15) Footer
========================= */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--sp-32) 0;
  color: var(--muted);
  font-size: var(--fs-14);
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-24);
}

/* =========================
   16) Utilities
========================= */
.mt-8  { margin-top: var(--sp-8); }
.mt-12 { margin-top: var(--sp-12); }
.mt-16 { margin-top: var(--sp-16); }
.mt-24 { margin-top: var(--sp-24); }
.mt-32 { margin-top: var(--sp-32); }

.mb-8  { margin-bottom: var(--sp-8); }
.mb-12 { margin-bottom: var(--sp-12); }
.mb-16 { margin-bottom: var(--sp-16); }
.mb-24 { margin-bottom: var(--sp-24); }
.mb-32 { margin-bottom: var(--sp-32); }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--muted); }
.text-strong { color: var(--text-2); }

.bg-soft { background: var(--bg-soft); }
.border { border: 1px solid var(--border); }
.rounded { border-radius: var(--r-16); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }

/* =========================
   17) Responsive
========================= */
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero__grid { gap: var(--sp-40); }
}

@media (max-width: 900px) {
  .hero { padding: var(--sp-64) 0; }
  .hero__grid { grid-template-columns: 1fr; }
  .hero__visual { height: 300px; }

  .flow { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .container { padding: 0 var(--sp-16); }

  .nav { gap: var(--sp-12); }
  .nav a { display: none; } /* для MVP; позже — бургер */
  .nav a.btn { display: inline-flex; }

  .section { padding: var(--sp-56) 0; }
  .grid--3, .grid--2 { grid-template-columns: 1fr; }

  .footer__inner { flex-direction: column; align-items: flex-start; }
}



.tree-dropdown {
  position: relative;
  width: 320px;
}

.tree-input {
  border: 1px solid #ccc;
  padding: 8px;
  cursor: pointer;
  background: #fff;
  user-select: none;
}

.tree-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  border: 1px solid #ccc;
  background: #fff;
  max-height: 300px;
  overflow: auto;
  display: none;
  z-index: 100;
}

.tree-node {
  margin-left: 16px;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}

.tree-toggle {
  cursor: pointer;
  width: 14px;
  user-select: none;
}

.tree-toggle-empty {
  width: 14px;
}

.tree-children {
  margin-left: 16px;
}