/* PostFlow — Premium UI v2.0 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── Design Tokens ──────────────────────────────────────────────────────────── */
:root {
  --bg:           #07090f;
  --surface:      #0c1019;
  --card:         #111721;
  --card-alt:     #141c2c;
  --border:       #1b2740;
  --border-hi:    #253553;
  --text:         #e9eef8;
  --text-2:       #7a96b4;
  --muted:        #495f78;
  --accent:       #5c72f0;
  --accent-d:     #4a5ed8;
  --accent-glow:  rgba(92, 114, 240, 0.30);
  --accent-sub:   rgba(92, 114, 240, 0.12);
  --success:      #22c55e;
  --success-sub:  rgba(34, 197, 94, 0.12);
  --error:        #f04f4f;
  --error-sub:    rgba(240, 79, 79, 0.12);
  --founder:      #f59e0b;
  --founder-sub:  rgba(245, 158, 11, 0.12);
  --radius:       14px;
  --radius-sm:    9px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.5);
  --shadow-md:    0 4px 20px rgba(0,0,0,0.45);
  --shadow-lg:    0 8px 40px rgba(0,0,0,0.55);
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ── Navbar ─────────────────────────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 58px;
  background: rgba(7, 9, 15, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 17px;
  font-weight: 900;
  text-decoration: none;
  background: linear-gradient(125deg, #fff 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.03em;
}

.nav-links { display: flex; align-items: center; gap: 2px; }

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: 7px;
  transition: color .15s, background .15s;
}
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,0.05); }

.btn-link {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  padding: 6px 13px;
  border-radius: 7px;
  transition: color .15s, background .15s;
}
.btn-link:hover { color: var(--error); background: var(--error-sub); }

/* ── Layout ──────────────────────────────────────────────────────────────────── */
.container { max-width: 1060px; margin: 0 auto; padding: 36px 24px; }

/* ── Auth ────────────────────────────────────────────────────────────────────── */
.auth-box {
  max-width: 400px;
  margin: 72px auto;
  background: var(--card);
  border: 1px solid var(--border-hi);
  border-radius: 22px;
  padding: 44px 40px;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255,255,255,0.025);
}

.auth-logo {
  font-size: 26px;
  font-weight: 900;
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: -0.04em;
}

.auth-sub {
  color: var(--muted);
  text-align: center;
  font-size: 13.5px;
  margin-bottom: 32px;
}

.auth-footer { text-align: center; margin-top: 22px; color: var(--muted); font-size: 13px; }
.auth-footer a { color: var(--accent); text-decoration: none; font-weight: 500; }
.auth-footer a:hover { text-decoration: underline; }

/* ── Form fields ─────────────────────────────────────────────────────────────── */
.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 7px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
  -webkit-appearance: none;
  appearance: none;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-sub);
}

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

.field select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234a5f78' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
}
.field select option { background: var(--card); }

.field textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.65;
}

.field .hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  display: block;
  line-height: 1.5;
}

.field-row { display: flex; gap: 14px; }
.field-row .field { flex: 1; }
.field-sm { max-width: 140px !important; flex: unset !important; }

.field-check label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.field-check input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  border-radius: 4px;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn-primary {
  display: block;
  width: 100%;
  background: linear-gradient(135deg, var(--accent) 0%, #3b52e0 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s, transform .12s, box-shadow .15s;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 12px rgba(92, 114, 240, 0.45);
}
.btn-primary:hover {
  opacity: .9;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(92, 114, 240, 0.55);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: .35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s, color .15s, background .15s;
}
.btn-secondary:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--accent-sub);
}

/* ── Error / Success banners ─────────────────────────────────────────────────── */
.error-msg {
  background: var(--error-sub);
  border: 1px solid rgba(240, 79, 79, 0.28);
  color: #f9a8a8;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  margin-bottom: 14px;
  line-height: 1.5;
}
.success-msg {
  background: var(--success-sub);
  border: 1px solid rgba(34, 197, 94, 0.28);
  color: #86efac;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  margin-bottom: 14px;
}

/* ── Usage bar ───────────────────────────────────────────────────────────────── */
.usage-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 22px;
}
.usage-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
#usageText, .usage-bar span { font-size: 13px; color: var(--text-2); }
.progress-track {
  background: var(--border-hi);
  border-radius: 4px;
  height: 5px;
  overflow: hidden;
}
.progress-fill {
  background: linear-gradient(90deg, var(--accent), #7c5af0);
  border-radius: 4px;
  height: 5px;
  transition: width .4s ease;
}
.usage-upgrade { font-size: 12px; color: var(--accent); text-decoration: none; font-weight: 600; }
.usage-upgrade:hover { text-decoration: underline; }

/* ── Dashboard grid ──────────────────────────────────────────────────────────── */
.dash {
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 28px;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
}
@media (max-width: 900px) { .dash { grid-template-columns: 1fr; } }

/* ── Tabs ────────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 24px;
}

.tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .18s, color .18s, box-shadow .18s;
  letter-spacing: 0.01em;
}
.tab.active {
  background: var(--card-alt);
  color: var(--text);
  box-shadow: var(--shadow-sm), 0 0 0 1px rgba(255,255,255,0.04);
}
.tab:not(.active):hover { color: var(--text-2); background: rgba(255,255,255,0.03); }

.tab-pane { animation: fadeUp .18s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ── Slide editor ────────────────────────────────────────────────────────────── */
.slide-field {
  background: var(--card-alt);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: border-color .15s;
}
.slide-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-sub);
}

.slide-num {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 10px;
}

.slide-field .field { margin-bottom: 10px; }
.slide-field .field:last-child { margin-bottom: 0; }

.slide-field input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: 7px;
  color: var(--text);
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.slide-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-sub);
}
.slide-field input::placeholder { color: var(--muted); }

.lbl-opt {
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.btn-gen { margin-top: 10px; }

/* ── Preview panel ───────────────────────────────────────────────────────────── */
.dash-preview { position: sticky; top: 78px; }

.preview-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.preview-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .09em;
}
.preview-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.7);
  animation: pulse 2.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(34,197,94,.7); }
  50%       { opacity: .25; box-shadow: none; }
}

/* ── Tweet mock card ─────────────────────────────────────────────────────────── */
.tweet-mock {
  background: #06080e;
  border: 1px solid #1b2640;
  border-radius: 18px;
  padding: 22px 22px 18px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  box-shadow: var(--shadow-md);
}

.tm-avatar-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.tm-avatar-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: #1a2535;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #1e2d42;
}
.tm-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.tm-avatar-fallback { font-size: 20px; }
.tm-identity { display: flex; flex-direction: column; gap: 1px; padding-top: 2px; }
.tm-name-row { display: flex; align-items: center; gap: 5px; }
.tm-name { font-size: 15px; font-weight: 700; color: #e9eef8; line-height: 1.2; }
.tm-verified { display: inline-flex; align-items: center; }
.tm-handle { font-size: 13.5px; color: #495f78; }

.tm-body {
  font-size: 15.5px;
  line-height: 1.65;
  color: #e9eef8;
  word-break: break-word;
  min-height: 52px;
  margin-bottom: 14px;
}
.tm-body p { margin: 0 0 12px; }
.tm-body p:last-child { margin: 0; }
.tm-placeholder { color: #253248; font-size: 14px; }

.tm-metrics {
  font-size: 13px;
  color: #495f78;
  padding-top: 12px;
  border-top: 1px solid #1b2640;
}

.mock-note {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 10px;
  opacity: .45;
}

/* ── Generated result ────────────────────────────────────────────────────────── */
.result-img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border-hi);
  display: block;
  box-shadow: var(--shadow-md);
}
.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.result-actions .btn-download { flex: 1; margin: 0; }

/* ── Download button ─────────────────────────────────────────────────────────── */
.btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--success), #16a34a);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  text-align: center;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  font-size: 14px;
  transition: opacity .15s, transform .12s;
  box-shadow: 0 2px 12px rgba(34, 197, 94, 0.35);
}
.btn-download:hover { opacity: .9; transform: translateY(-1px); }

/* ── Clone grid ──────────────────────────────────────────────────────────────── */
.clone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 14px;
}
.clone-item { display: flex; flex-direction: column; gap: 7px; }
.clone-item img {
  width: 100%;
  height: auto;          /* mantém proporção real do slide */
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
  transition: border-color .15s, box-shadow .15s;
}
.clone-item:hover img {
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.clone-dl {
  display: block;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-decoration: none;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 7px;
  transition: all .15s;
}
.clone-dl:hover {
  background: var(--accent-sub);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Slide editor (carrossel) — scrollável com muitos slides ──────────────────── */
#slidesEditor {
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hi) transparent;
}

/* ── Loading spinner para botões ─────────────────────────────────────────────── */
.btn-primary.loading {
  position: relative;
  color: transparent;
  pointer-events: none;
}
.btn-primary.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .65s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Handle input ────────────────────────────────────────────────────────────── */
.handle-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
  transition: border-color .18s, box-shadow .18s;
}
.handle-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-sub);
}
.handle-at {
  padding: 10px 8px 10px 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  background: var(--surface);
  user-select: none;
}
.handle-input input { border: none; border-radius: 0; flex: 1; box-shadow: none !important; }
.handle-input input:focus { outline: none; box-shadow: none !important; border-color: transparent !important; }

/* ── Settings page ───────────────────────────────────────────────────────────── */
.settings h1 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.03em;
}
.settings-sub { color: var(--muted); font-size: 14px; margin-bottom: 32px; }

.settings-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 40px;
  align-items: start;
}
@media (max-width: 600px) { .settings-grid { grid-template-columns: 1fr; } }

.avatar-section { display: flex; flex-direction: column; align-items: center; gap: 14px; }

.avatar-preview {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--border-hi);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.avatar-preview:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.upload-label {
  cursor: pointer;
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}
.upload-label:hover { text-decoration: underline; }

.identity-form .hint { font-size: 12px; color: var(--muted); }

/* ── Upgrade / Plans page ────────────────────────────────────────────────────── */
.upgrade { max-width: 920px; margin: 0 auto; }

.upgrade h1 {
  font-size: 32px;
  text-align: center;
  margin-bottom: 10px;
  font-weight: 900;
  letter-spacing: -0.04em;
}
.upgrade-sub {
  text-align: center;
  color: var(--muted);
  margin-bottom: 48px;
  font-size: 15px;
}

.plans-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 740px) { .plans-grid { grid-template-columns: 1fr; } }

.plan-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
}
.plan-card:hover { transform: translateY(-3px); }

.plan-pro {
  border-color: var(--accent);
  box-shadow: 0 0 30px rgba(92, 114, 240, 0.18);
}
.plan-founder {
  border-color: var(--founder);
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.18);
}

.plan-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .09em;
}
.badge-pro { color: var(--accent); }
.badge-founder { color: var(--founder); }

.plan-price { font-size: 38px; font-weight: 900; letter-spacing: -0.04em; }
.plan-price span { font-size: 15px; font-weight: 400; color: var(--muted); }

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 14px;
  flex: 1;
}
.plan-features li { display: flex; align-items: flex-start; gap: 8px; }
.plan-features li.feat-no { color: var(--muted); }

.plan-cta {
  text-align: center;
  border-radius: var(--radius-sm);
  padding: 13px 20px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  display: block;
  font-size: 14.5px;
  cursor: pointer;
  border: none;
  transition: opacity .15s, transform .12s;
}
.plan-cta:hover { opacity: .9; transform: translateY(-1px); }
.plan-current { color: var(--muted); font-size: 13px; text-align: center; }

.btn-founder {
  background: linear-gradient(135deg, var(--founder), #d97706);
  color: #000;
  font-weight: 800;
}
