/* ==========================================================================
   FlowGen Studio (web app) — layout + components
   Builds on ../../css/style.css (same tokens, buttons, pills as the site),
   and mirrors the desktop tool: white rounded sidebar, green active pill,
   inset fields, white cards on the lavender canvas.
   ========================================================================== */

body.studio { min-height: 100vh; }
[hidden] { display: none !important; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 262px minmax(0, 1fr); gap: 14px; padding: 14px; min-height: 100vh; }
.side {
  position: sticky; top: 14px; height: calc(100vh - 28px);
  background: var(--card); border-radius: 24px; padding: 18px 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 14px; }
.side-brand svg { width: 42px; height: 42px; flex: none; }
.side-brand b { display: block; font-size: 19px; color: var(--heading); letter-spacing: -0.01em; line-height: 1.1; }
.side-brand small { display: block; font-size: 10.5px; letter-spacing: .32em; color: var(--muted); font-weight: 600; }
.side-nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 2px; scrollbar-width: thin; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 13px; border-radius: 14px;
  color: var(--nav-text); font-size: 14px; font-weight: 600; text-align: left;
  background: none; border: none; width: 100%; transition: background .15s, color .15s;
}
.nav-item svg { width: 19px; height: 19px; flex: none; fill: none; stroke: var(--c); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item > span:not(.soon-tag) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.nav-item:hover { background: var(--hover-tint); color: var(--ink); }
.nav-item.on { background: linear-gradient(180deg, var(--green-top), var(--green)); color: #fff; box-shadow: 0 8px 18px -8px rgba(29,181,130,.85); }
.nav-item.on svg { stroke: #fff; }
.nav-item.soon { color: #BEB9CE; }
.nav-item.soon svg { stroke: color-mix(in srgb, var(--c) 45%, #ECEBF4); }
.nav-item .soon-tag { margin-left: auto; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--soft); color: #A9A3C2; }
.side-foot { display: grid; gap: 10px; padding: 10px 4px 0; border-top: 1px solid var(--soft); }
.side-credits { background: var(--soft); border-radius: 16px; padding: 12px 14px; }
.side-credits span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.side-credits b { display: flex; align-items: center; gap: 6px; font-size: 20px; color: var(--ink-strong); letter-spacing: -0.02em; }
.side-credits b svg { width: 18px; height: 18px; color: var(--green); }
.btn-logout {
  width: 100%; min-height: 42px; border: none; border-radius: 14px; color: #fff; font-weight: 600; font-size: 14px;
  background: linear-gradient(180deg, #EF5A50, #D9534F); display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-logout:hover { filter: brightness(1.05); }
.side-ver { text-align: center; font-size: 11px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; gap: 16px; padding: 4px 6px 24px; }
.topbar { display: flex; align-items: center; gap: 14px; min-height: 56px; }
.topbar h1 { font-size: 24px; font-weight: 700; color: var(--heading); letter-spacing: -0.02em; }
.topbar p { color: var(--muted); font-size: 13.5px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.stat-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.stat-chip.amber { background: #FCEBD3; color: #9A6B1A; }
.stat-chip.green { background: #CFF0E0; color: #147A55; }
.stat-chip.demo { background: #E6DEF8; color: #6A4FB0; }
.stat-chip svg { width: 15px; height: 15px; }
.credit-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--border); font-weight: 700; color: var(--ink-strong); font-size: 14px; white-space: nowrap;
}
.credit-pill .lbl { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.credit-pill .btn { min-height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.avatar {
  width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none;
  background: linear-gradient(180deg, #5B6AD0, #4A59BF); color: #fff; font-weight: 700; font-size: 15px; border: none;
}
.menu-btn { display: none; }

@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding: 10px; }
  .side {
    position: fixed; z-index: 60; top: 10px; left: 10px; bottom: 10px; height: auto; width: 264px;
    box-shadow: 0 30px 80px -20px rgba(var(--shadow-rgb), .5);
    transform: translateX(calc(-100% - 20px)); transition: transform .25s ease;
  }
  .side-open .side { transform: none; }
  .side-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(46,43,69,.32); }
  .menu-btn { display: grid; }
  .topbar h1 { font-size: 20px; }
  .topbar p { display: none; }
}
@media (max-width: 560px) {
  .topbar { gap: 10px; }
  .top-right { flex-wrap: nowrap; gap: 6px; }
  .credit-pill .lbl, .top-right .avatar, .top-right .stat-chip { display: none; }
}

.inf-ic { width: 34px; height: 17px; fill: none; stroke: currentColor; stroke-width: 3.2; stroke-linecap: round; flex: none; }

/* ---------- Generic cards ---------- */
.card { background: var(--card); border-radius: 22px; padding: 22px; min-width: 0; }
.card h3 { font-size: 16px; font-weight: 700; color: var(--heading); display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card h3 small { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.muted { color: var(--muted); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Form controls (tool's inset look) ---------- */
label.lbl { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 7px 2px; }
.input, .select, .textarea {
  width: 100%; font: inherit; font-size: 14.5px; color: var(--ink);
  background: linear-gradient(180deg, var(--field-top) 0%, #E7E4F2 9%, var(--field) 22%, var(--field) 100%);
  border: 1px solid var(--border-2); border-top-color: #B6AED6; border-left-color: #C0B8DC;
  border-bottom-color: #FCFBFF; border-right-color: var(--soft);
  border-radius: 14px; padding: 12px 14px; outline: none; transition: border-color .15s, background .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--green); background: linear-gradient(180deg, #E4E0F0, var(--field) 12%, #F0EEF8); }
.select { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A85A3' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"), linear-gradient(180deg, var(--field-top) 0%, #E7E4F2 16%, var(--field) 40%, var(--field) 100%);
  background-repeat: no-repeat; background-position: right 12px center, 0 0; background-size: 16px, 100% 100%;
}
.textarea { resize: vertical; min-height: 180px; line-height: 1.55; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.seg { display: flex; gap: 6px; background: var(--soft); border-radius: 14px; padding: 4px; }
.seg button {
  flex: 1; border: none; background: none; border-radius: 11px; padding: 8px 6px; font-size: 13px; font-weight: 600; color: var(--muted); line-height: 1.2;
}
.seg button small { display: block; font-size: 10.5px; font-weight: 500; opacity: .85; }
.seg button.on { background: linear-gradient(180deg, var(--green-top), var(--green)); color: #fff; box-shadow: 0 6px 14px -8px rgba(29,181,130,.9); }

/* ---------- Generator layout ---------- */
.gen { display: grid; grid-template-columns: minmax(320px, 420px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .gen { grid-template-columns: minmax(0, 1fr); } }
.gen-form { display: flex; flex-direction: column; gap: 16px; }
.style-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; max-height: 214px; overflow-y: auto; padding: 2px; }
.style-opt { position: relative; border: 2px solid transparent; border-radius: 12px; padding: 0; overflow: hidden; aspect-ratio: 16/10; background: var(--soft); }
.style-opt img { width: 100%; height: 100%; object-fit: cover; }
.style-opt span { position: absolute; inset: auto 0 0 0; padding: 12px 6px 4px; font-size: 10.5px; font-weight: 700; color: #fff; text-align: left; background: linear-gradient(transparent, rgba(20,18,32,.75)); }
.style-opt.on { border-color: var(--green); box-shadow: 0 0 0 3px rgba(29,181,130,.22); }
.cost-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.cost-line b { color: var(--green-deep); }
.form-actions { display: flex; gap: 10px; }
.form-actions .btn { flex: 1; }

/* Queue table */
.queue-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.queue-head h3 { margin: 0; }
.tabs { display: flex; gap: 4px; background: var(--soft); border-radius: 12px; padding: 4px; }
.tabs button { border: none; background: none; padding: 6px 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tabs button.on { background: var(--card); color: var(--ink-strong); box-shadow: 0 2px 6px -2px rgba(var(--shadow-rgb), .25); }
.table { width: 100%; border-collapse: separate; border-spacing: 0 8px; font-size: 13.5px; }
.table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 0 10px; }
.table td { background: var(--base); padding: 10px; vertical-align: middle; }
.table td:first-child { border-radius: 14px 0 0 14px; width: 36px; color: var(--muted); font-weight: 600; }
.table td:last-child { border-radius: 0 14px 14px 0; }
.table .p-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink); max-width: 420px; }
.job-err { display: block; margin-top: 4px; font-size: 12px; color: #B91C1C; line-height: 1.4; max-width: 420px; }
.bar { height: 7px; background: var(--field); border-radius: 4px; overflow: hidden; min-width: 70px; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: 4px; transition: width .35s ease; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.queued { background: #FCEBD3; color: #9A6B1A; }
.status.running { background: #D6EDFB; color: #2C7BB8; }
.status.done { background: #CFF0E0; color: #147A55; }
.status.failed { background: #FEF2F2; color: #B91C1C; }
.thumb-btn { width: 84px; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; border: none; padding: 0; background: var(--field); display: block; position: relative; }
.thumb-btn img, .thumb-btn video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.g-item video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.thumb-btn .play-ic { position: absolute; inset: 0; margin: auto; width: 26px; height: 26px; border-radius: 50%; background: rgba(20,18,32,.6); color: #fff; display: grid; place-items: center; }
.thumb-btn .play-ic svg { width: 11px; height: 11px; margin-left: 2px; }
.thumb-empty { width: 84px; aspect-ratio: 16/9; border-radius: 10px; background: var(--field); }
.thumb-ph { position: absolute; inset: 0; background: linear-gradient(135deg, #2E2B45, #544D72); }

.q-acts { display: flex; gap: 8px; margin-left: auto; }
.q-acts .btn svg { width: 14px; height: 14px; }
.q-stop { color: #B91C1C; border-color: #F3C9C9; background: #FEF2F2; }
.q-stop:hover { border-color: #D9534F; }

/* Auto-save bar (finished files → user's PC) */
.save-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--base); margin-bottom: 6px; }
.save-bar.on { border-color: rgba(29,181,130,.35); background: var(--green-soft); }
.save-msg { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: var(--ink); min-width: 0; flex: 1 1 320px; }
.save-msg svg { width: 18px; height: 18px; flex: none; margin-top: 1px; fill: none; stroke: var(--green-deep); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.save-msg code { font-size: 12px; background: rgba(255,255,255,.7); padding: 1px 6px; border-radius: 6px; }
.save-acts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.save-count { font-size: 12.5px; font-weight: 600; color: var(--green-deep); }
.save-tip { font-size: 12.5px; color: var(--muted); margin: 0 2px 12px; }
.save-tag { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; border: none; white-space: nowrap; }
.save-tag svg { width: 11px; height: 11px; }
.save-tag.ok { background: #E3F3EB; color: #147A55; }
.save-tag.busy { background: #EDEBF6; color: var(--muted); }
.save-tag.bad { background: #FEF2F2; color: #B91C1C; cursor: pointer; }
.lb-saved { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12.5px; color: var(--green-deep); }
.lb-saved svg { width: 13px; height: 13px; flex: none; }
.row-act { display: flex; gap: 6px; }
.mini-btn { width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--muted); display: grid; place-items: center; }
.mini-btn:hover { color: var(--green); border-color: var(--green); }
.mini-btn.danger:hover { color: #D9534F; border-color: #E4A0A0; }
.mini-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty svg { width: 46px; height: 46px; margin: 0 auto 12px; fill: none; stroke: var(--border-2); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.empty b { display: block; color: var(--heading); font-size: 15px; margin-bottom: 4px; }
.table-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
@media (max-width: 640px) {
  .table .col-progress { display: none; }
  .table .p-text { max-width: 160px; }
}

/* ---------- Dashboard ---------- */
.welcome h2 { font-size: 22px; }
.plan-card { display: flex; flex-direction: column; gap: 14px; }
.big-num { font-size: 40px; font-weight: 800; color: var(--ink-strong); letter-spacing: -0.03em; line-height: 1; display: flex; align-items: center; gap: 10px; }
.big-num svg { width: 54px; height: 28px; fill: none; stroke: var(--green); stroke-width: 3.2; stroke-linecap: round; }
.meter { height: 10px; background: var(--field); border-radius: 6px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--green-top), var(--green)); }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; color: var(--muted); }
.kv b { color: var(--ink); font-weight: 600; }
.mini-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mini-stats > div { background: var(--soft); border-radius: 14px; padding: 14px; }
.mini-stats b { display: block; font-size: 24px; color: var(--ink-strong); letter-spacing: -0.02em; }
.mini-stats span { font-size: 12.5px; color: var(--muted); }
.chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart .col i { width: 100%; max-width: 34px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--green-top), var(--green)); min-height: 4px; }
.chart .col i.zero { background: var(--field); }
.chart .col span { font-size: 11px; color: var(--muted); }
.chart .col em { font-style: normal; font-size: 11px; color: var(--ink); font-weight: 600; }
.tool-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile {
  display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: var(--soft); border: 1px solid transparent;
  text-align: left; color: var(--heading); font-weight: 600; font-size: 14px; transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--border); transform: translateY(-2px); }
.tile .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, transparent); }
.tile .ic svg { width: 20px; height: 20px; fill: none; stroke: var(--c); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tile small { color: var(--muted); font-weight: 500; font-size: 12px; margin-top: -6px; }
.banner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px 22px; border-radius: 22px; color: #fff;
  background: linear-gradient(135deg, #1DB582 0%, #14A79E 55%, #0891B2 100%);
}
.banner h3 { color: #fff; font-size: 19px; margin: 0; }
.banner p { opacity: .9; font-size: 14px; }
.banner .btn { margin-left: auto; }

/* Creations grid */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.g-item { position: relative; border-radius: 16px; overflow: hidden; background: var(--field); aspect-ratio: 16/10; border: none; padding: 0; }
.g-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.g-item:hover img { transform: scale(1.05); }
.g-item .g-meta { position: absolute; inset: auto 0 0 0; padding: 22px 10px 8px; display: flex; align-items: center; gap: 6px; color: #fff; font-size: 12px; font-weight: 600; background: linear-gradient(transparent, rgba(20,18,32,.78)); text-align: left; }
.g-item .g-meta svg { width: 12px; height: 12px; flex: none; }
.g-item .g-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-item .g-type { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 8px; background: rgba(255,255,255,.92); color: #2E2B45; font-size: 11px; font-weight: 700; }

/* ---------- Account ---------- */
.profile { display: flex; align-items: center; gap: 16px; }
.profile .avatar { width: 56px; height: 56px; border-radius: 18px; font-size: 22px; }
.profile b { display: block; font-size: 18px; color: var(--heading); }
.profile span { color: var(--muted); font-size: 14px; }
.plans.in-app { margin-top: 18px; }
.plans.in-app .plan { padding: 28px 24px; }
.plans.in-app .plan:hover { transform: none; }
.plan-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.link-btn { background: none; border: none; color: var(--muted); font-size: 13.5px; text-decoration: underline; padding: 0; }
.link-btn:hover { color: #D9534F; }

/* ---------- Coming soon (same as the tool's overlay) ---------- */
.soon-wrap { position: relative; min-height: 460px; border-radius: 24px; overflow: hidden; }
.soon-bg { position: absolute; inset: 0; filter: blur(6px); opacity: .55; pointer-events: none; padding: 22px; display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; }
.soon-bg div { background: var(--card); border-radius: 22px; }
.soon-card {
  position: relative; max-width: 400px; margin: 70px auto; background: var(--card); border: 1px solid #E4DFF2; border-radius: 22px;
  padding: 28px; text-align: center; box-shadow: 0 30px 70px -30px rgba(var(--shadow-rgb), .45);
}
.soon-card .ic { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 14px; background: color-mix(in srgb, var(--c) 14%, transparent); }
.soon-card .ic svg { width: 28px; height: 28px; fill: none; stroke: var(--c); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.soon-card .pill-soon { display: inline-block; padding: 5px 12px; border-radius: 999px; background: var(--green-soft); color: var(--green-deep); font-weight: 700; font-size: 12px; margin-bottom: 10px; }
.soon-card h3 { justify-content: center; font-size: 20px; margin-bottom: 8px; }
.soon-card p { color: var(--muted); font-size: 14.5px; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-art {
  position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(150deg, #1DB582 0%, #14A79E 55%, #0891B2 100%);
}
.auth-art::before, .auth-art::after { content: ""; position: absolute; border: 2px solid rgba(255,255,255,.16); border-radius: 50%; pointer-events: none; }
.auth-art::before { width: 640px; height: 240px; left: -200px; top: 120px; transform: rotate(-28deg); }
.auth-art::after { width: 640px; height: 240px; right: -220px; bottom: 80px; transform: rotate(32deg); }
.auth-art a.brand { color: #fff; position: relative; }
.auth-art .brand small { color: rgba(255,255,255,.85); }
.auth-art h2 { color: #fff; font-size: clamp(30px, 3.4vw, 44px); font-weight: 800; letter-spacing: -0.03em; position: relative; }
.auth-art p { opacity: .9; font-size: 17px; margin-top: 12px; max-width: 440px; position: relative; }
.auth-reels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; position: relative; margin-top: 28px; }
.auth-reels img { border-radius: 14px; aspect-ratio: 16/10; object-fit: cover; width: 100%; box-shadow: 0 14px 30px -14px rgba(0,0,0,.5); }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--soft); border: 2px solid var(--green); border-radius: 26px; padding: 30px 28px;
  box-shadow: 0 30px 70px -36px rgba(var(--shadow-rgb), .55);
}
.auth-card h1 { font-size: 26px; text-align: center; }
.auth-card .sub { text-align: center; color: var(--muted); margin: 6px 0 20px; font-size: 14.5px; }
.auth-card form { display: grid; gap: 14px; }
.auth-card .btn-primary { width: 100%; }
.auth-switch { text-align: center; font-size: 14px; color: var(--muted); margin-top: 16px; }
.auth-switch a { color: var(--green-deep); font-weight: 600; }
.auth-legal { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 14px; line-height: 1.5; }
.auth-legal a, .plans-legal a { color: var(--green-deep); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.plans-legal { text-align: center; font-size: 13px; color: var(--muted); margin-top: 20px; }
.remember { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); cursor: pointer; user-select: none; }
.remember input { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin: 0; border-radius: 7px; border: 1px solid var(--border-2); background: var(--base); display: grid; place-items: center; cursor: pointer; flex: none; }
.remember input:checked { background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/13px no-repeat; border-color: var(--green); }
.remember input:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.form-error { background: #FEF2F2; color: #B91C1C; border-radius: 12px; padding: 10px 12px; font-size: 13.5px; }
.plan-picked { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--green-soft); color: var(--green-deep); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; font-weight: 600; }
.demo-note { margin-top: 16px; font-size: 12.5px; color: #6A4FB0; background: #E6DEF8; border-radius: 12px; padding: 10px 12px; line-height: 1.45; }
.back-home { display: block; text-align: center; margin-top: 14px; font-size: 13.5px; color: var(--muted); }
.back-home:hover { color: var(--green); }
@media (max-width: 900px) {
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-art { padding: 24px 20px 28px; }
  .auth-art h2 { font-size: 26px; margin-top: 18px; }
  .auth-art p, .auth-reels { display: none; }
}

/* ---------- Modal / lightbox / toast ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(46,43,69,.45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.modal-card {
  position: relative; width: 100%; max-width: 460px; max-height: calc(100vh - 32px); overflow: auto;
  background: var(--soft); border: 2px solid var(--green); border-radius: 22px; padding: 26px;
  box-shadow: 0 40px 90px -30px rgba(var(--shadow-rgb), .6);
}
.modal-card.wide { max-width: 920px; padding: 16px; }
.modal-card h3 { font-size: 20px; color: var(--heading); margin: 0 0 8px; padding-right: 40px; }
.modal-card p { color: var(--ink); font-size: 15px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.modal-x {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--border); display: grid; place-items: center; color: var(--heading); z-index: 2;
}
.modal-x:hover { background: #FDECEC; border-color: #E4A0A0; color: #C0392B; }
.modal-x svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; fill: none; }
.lightbox-media { border-radius: 14px; overflow: hidden; background: #000; }
.lightbox-media video, .lightbox-media img { width: 100%; max-height: 70vh; object-fit: contain; display: block; margin: 0 auto; }
.lightbox-info { display: flex; align-items: center; gap: 12px; padding: 14px 4px 2px; flex-wrap: wrap; }
.lightbox-info p { flex: 1; min-width: 200px; font-size: 14px; color: var(--ink); }
.toast-wrap { position: fixed; z-index: 120; bottom: 18px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: #2E2B45; color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px; font-weight: 500; box-shadow: 0 16px 40px -16px rgba(0,0,0,.5); animation: toastIn .25s ease; display: flex; align-items: center; gap: 10px; }
.toast.ok::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); flex: none; }
.toast.bad::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #EF5A50; flex: none; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
