/* ============================================================
   WA Business Master Kit — css/style.css
   Dark SaaS Premium Theme
   ============================================================ */

:root {
  --bg: #0b0d10;
  --bg2: #111318;
  --bg3: #181c22;
  --surface: #1a1f28;
  --surface2: #1f2530;
  --border: rgba(255,255,255,0.07);
  --border-hover: rgba(52,211,153,0.3);
  --accent: #34d399;
  --accent2: #10b981;
  --accent-glow: rgba(52,211,153,0.15);
  --accent-glow2: rgba(52,211,153,0.08);
  --text: #e8eaf0;
  --text2: #9aa0b0;
  --text3: #5c6478;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-xl: 32px;
  --font-head: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --shadow: 0 8px 32px rgba(0,0,0,0.45);
  --shadow-accent: 0 8px 24px rgba(52,211,153,0.18);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Noise texture */
.noise-overlay {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  opacity: 0.6;
}

/* ── HEADER ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,13,16,0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 1rem;
}
.header-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  height: 62px;
}
.brand { display: flex; align-items: center; gap: 12px; cursor: default; }
.logo-wrap {
  position: relative; width: 40px; height: 40px;
}
.logo-wrap img {
  width: 40px; height: 40px; border-radius: 12px;
  object-fit: contain; background: white; padding: 3px;
}
.logo-fallback {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(135deg, var(--accent2), #059669);
  align-items: center; justify-content: center;
  font-family: var(--font-head); font-weight: 800; font-size: 13px;
  color: white; letter-spacing: 1px;
}
.logo-dot {
  position: absolute; bottom: -2px; right: -2px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); border: 2.5px solid var(--bg);
  animation: pulse-dot 2.5s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%,100% { box-shadow: 0 0 0 0 rgba(52,211,153,0.4); }
  50% { box-shadow: 0 0 0 5px rgba(52,211,153,0); }
}
.brand-text { display: flex; flex-direction: column; gap: 1px; }
.brand-name {
  font-family: var(--font-head); font-weight: 800;
  font-size: 14px; color: var(--text); letter-spacing: -0.3px; line-height: 1;
}
.brand-sub {
  font-size: 10px; font-weight: 500; color: var(--text3);
  letter-spacing: 0.12em; text-transform: uppercase;
}
.header-actions { display: flex; align-items: center; gap: 10px; }
.usage-badge {
  font-size: 11px; font-weight: 600; padding: 4px 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 50px; color: var(--text2);
}
.btn-settings {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text2); cursor: pointer; transition: all .2s;
}
.btn-settings:hover { border-color: var(--accent); color: var(--accent); }

/* ── SETTINGS PANEL ── */
.settings-panel {
  position: fixed; top: 62px; right: 0; bottom: 0; z-index: 45;
  width: 340px; max-width: 100vw;
  background: var(--bg2); border-left: 1px solid var(--border);
  overflow-y: auto; transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: -12px 0 40px rgba(0,0,0,0.4);
}
.settings-panel.open { transform: translateX(0); }
.settings-panel.hidden { display: none; }
.settings-inner { padding: 24px 20px 100px; }
.settings-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px;
}
.settings-header h3 { font-family: var(--font-head); font-weight: 700; font-size: 17px; }
.settings-header button {
  background: none; border: none; cursor: pointer; color: var(--text2);
  font-size: 16px; padding: 4px 8px; border-radius: 8px;
}
.settings-header button:hover { background: var(--surface); color: var(--text); }
.settings-group { margin-bottom: 20px; }
.settings-group label {
  display: block; font-size: 11px; font-weight: 600; color: var(--text3);
  text-transform: uppercase; letter-spacing: .1em; margin-bottom: 8px;
}
.settings-group input,
.settings-group textarea {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; color: var(--text);
  font-family: var(--font-body); font-size: 14px; transition: border .2s;
  resize: none;
}
.settings-group input:focus,
.settings-group textarea:focus { outline: none; border-color: var(--accent); }
.hint-link {
  display: inline-block; margin-top: 6px; font-size: 11px;
  color: var(--accent); text-decoration: none;
}
.hint-link:hover { text-decoration: underline; }
.license-row { display: flex; gap: 8px; }
.license-row input { flex: 1; }
.btn-activate {
  background: var(--accent2); color: white; border: none;
  border-radius: 12px; padding: 0 16px; font-family: var(--font-body);
  font-weight: 700; font-size: 13px; cursor: pointer; white-space: nowrap; transition: all .2s;
}
.btn-activate:hover { background: var(--accent); }
.license-status { margin-top: 6px; font-size: 12px; min-height: 18px; }
.btn-save {
  width: 100%; background: var(--accent2); color: white; border: none;
  border-radius: 14px; padding: 14px; font-family: var(--font-head);
  font-weight: 700; font-size: 15px; cursor: pointer; letter-spacing: .02em;
  transition: all .2s; box-shadow: var(--shadow-accent);
}
.btn-save:hover { background: var(--accent); transform: translateY(-1px); }

/* ── MAIN ── */
.main-content { max-width: 900px; margin: 0 auto; padding: 24px 16px 120px; }

/* ── TABS ── */
.tab-nav {
  display: flex; gap: 6px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 6px; margin-bottom: 32px;
  position: sticky; top: 72px; z-index: 40;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.tab-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 8px; background: none; border: none; cursor: pointer;
  border-radius: 12px; font-family: var(--font-head); font-size: 11px;
  font-weight: 700; color: var(--text3); letter-spacing: .06em;
  text-transform: uppercase; transition: all .2s;
}
.tab-btn .tab-icon { font-size: 14px; }
.tab-btn:hover { color: var(--text); background: var(--surface2); }
.tab-btn.active { background: var(--accent2); color: white; box-shadow: var(--shadow-accent); }

/* ── TAB CONTENT ── */
.tab-content { animation: fadeUp .35s ease both; }
.tab-content.hidden { display: none; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── SECTION HEADER ── */
.section-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.section-icon {
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  background: var(--accent-glow); border: 1px solid rgba(52,211,153,0.2);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.section-header h2 {
  font-family: var(--font-head); font-weight: 800; font-size: 18px;
  color: var(--text); letter-spacing: -0.3px; line-height: 1.1;
}
.section-header p { font-size: 12px; color: var(--text3); margin-top: 3px; }

/* ── CARD GRID ── */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .card-grid { grid-template-columns: 1fr 1fr; } }

.kit-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  position: relative; overflow: hidden;
}
.kit-card::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent-glow2), transparent);
  opacity: 0; transition: opacity .3s;
}
.kit-card:hover { border-color: var(--border-hover); transform: translateY(-2px); box-shadow: var(--shadow); }
.kit-card:hover::before { opacity: 1; }
.kit-card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.kit-card-title {
  font-size: 10px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: .15em;
  border-left: 2px solid var(--accent); padding-left: 10px;
  font-style: italic;
}
.btn-copy {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px; transition: all .15s; flex-shrink: 0;
  color: var(--text3);
}
.btn-copy:hover { background: var(--accent2); border-color: var(--accent); color: white; }
.btn-copy.copied { background: var(--accent2); border-color: var(--accent); color: white; }
.kit-card-body { font-size: 13.5px; color: var(--text2); line-height: 1.7; font-weight: 400; }

/* ── TIMELINE ── */
.timeline-wrap { padding-left: 16px; display: flex; flex-direction: column; gap: 0; }
.timeline-item {
  position: relative; padding-left: 20px;
  border-left: 2px solid rgba(52,211,153,0.2); padding-bottom: 20px;
}
.timeline-item:last-child { border-left-color: transparent; }
.timeline-dot {
  position: absolute; left: -7px; top: 20px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 3px solid var(--accent); flex-shrink: 0;
  transition: transform .2s;
}
.timeline-item:hover .timeline-dot { transform: scale(1.3); }

/* ── AI FORM ── */
.ai-form-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 32px;
  position: relative; overflow: hidden; margin-bottom: 28px;
}
.ai-form-bg-icon {
  position: absolute; top: -20px; right: -10px;
  font-size: 140px; color: var(--accent); opacity: 0.03;
  pointer-events: none; line-height: 1; user-select: none;
}
.form-grid { display: grid; grid-template-columns: 1fr; gap: 18px; margin-bottom: 22px; }
@media (min-width: 540px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label {
  font-size: 10px; font-weight: 700; color: var(--text3);
  text-transform: uppercase; letter-spacing: .12em;
}
.form-group input,
.form-group select {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 14px; padding: 13px 16px; color: var(--text);
  font-family: var(--font-body); font-size: 14px; transition: border .2s;
  appearance: none; -webkit-appearance: none;
}
.form-group input:focus,
.form-group select:focus { outline: none; border-color: var(--accent); }
.form-group input::placeholder { color: var(--text3); }
.btn-generate {
  width: 100%; background: linear-gradient(135deg, var(--accent2), #059669);
  border: none; border-radius: 16px; padding: 17px;
  font-family: var(--font-head); font-weight: 800; font-size: 15px;
  color: white; cursor: pointer; letter-spacing: .02em;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: all .25s; box-shadow: 0 8px 28px rgba(16,185,129,0.3);
  position: relative; overflow: hidden;
}
.btn-generate::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.08), transparent);
  pointer-events: none;
}
.btn-generate:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 12px 36px rgba(16,185,129,0.4); }
.btn-generate:active:not(:disabled) { transform: scale(0.98); }
.btn-generate:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-sparkle { font-size: 18px; }
.spin { display: inline-block; width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── AI RESULT ── */
.ai-result { animation: fadeUp .4s ease both; }
.result-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px;
}
.result-label {
  font-family: var(--font-head); font-weight: 800; font-size: 22px;
  color: var(--accent); font-style: italic; letter-spacing: -0.5px;
}
.btn-reset {
  background: none; border: 1px solid var(--border);
  border-radius: 10px; padding: 6px 14px;
  font-size: 12px; font-weight: 600; color: var(--text3);
  cursor: pointer; transition: all .2s;
}
.btn-reset:hover { border-color: var(--accent); color: var(--accent); }
.result-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .result-grid { grid-template-columns: 1fr 1fr; } }
.result-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 22px;
  transition: border-color .2s;
}
.result-card:hover { border-color: var(--border-hover); }
.result-card-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.result-card-head span {
  font-size: 10px; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: .14em; border-left: 2px solid var(--accent); padding-left: 10px; font-style: italic;
}
.btn-copy-sm {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 9px; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px; transition: all .15s;
}
.btn-copy-sm:hover { background: var(--accent2); }
.result-card p { font-size: 13.5px; color: var(--text2); line-height: 1.7; white-space: pre-wrap; }
.hooks-card ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.hooks-card li {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
  font-size: 13px; color: var(--text2); display: flex; gap: 10px; align-items: flex-start;
}
.hook-num { font-family: var(--font-head); font-weight: 800; color: var(--accent); font-style: italic; flex-shrink: 0; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center; padding: 64px 20px;
  border: 2px dashed var(--border); border-radius: var(--radius-xl);
}
.empty-icon { font-size: 40px; margin-bottom: 14px; opacity: .3; }
.empty-state h3 { font-family: var(--font-head); font-weight: 700; font-size: 17px; color: var(--text2); margin-bottom: 8px; }
.empty-state p { font-size: 13px; color: var(--text3); max-width: 320px; margin: 0 auto; }

/* ── SCRIPTS TAB ── */
.script-section { margin-bottom: 40px; }
.script-section-title {
  font-family: var(--font-head); font-weight: 800; font-size: 16px;
  color: var(--text); letter-spacing: .04em; text-transform: uppercase;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
  margin-bottom: 16px; display: flex; align-items: center; gap: 8px;
}

/* ── FLOATING BAR ── */
.floating-bar {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 45;
  background: rgba(26,31,40,0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 30px; padding: 10px 28px;
  display: flex; align-items: center; gap: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04) inset;
}
.fab-btn {
  background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--text3); transition: color .2s;
}
.fab-btn:hover { color: var(--accent); }
.fab-btn span { font-size: 9px; font-weight: 700; letter-spacing: .12em; }
.fab-divider { width: 1px; height: 36px; background: var(--border); }

/* ── MODAL ── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.hidden { display: none; }
.modal-box {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 36px 28px;
  max-width: 380px; width: 100%; text-align: center;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  animation: zoomIn .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes zoomIn {
  from { transform: scale(0.88); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-icon { font-size: 44px; margin-bottom: 14px; }
.modal-title { font-family: var(--font-head); font-weight: 800; font-size: 22px; margin-bottom: 10px; }
.modal-desc { font-size: 14px; color: var(--text2); line-height: 1.6; margin-bottom: 22px; }
.modal-desc strong { color: var(--accent); }
.btn-wa-license {
  display: block; width: 100%; background: linear-gradient(135deg, #25d366, #128c7e);
  color: white; text-decoration: none; padding: 14px;
  border-radius: 14px; font-family: var(--font-head); font-weight: 700; font-size: 15px;
  margin-bottom: 18px; transition: opacity .2s;
}
.btn-wa-license:hover { opacity: .9; }
.license-input-wrap { display: flex; flex-direction: column; gap: 10px; }
.license-input-wrap input {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px; color: var(--text);
  font-family: var(--font-body); font-size: 14px; width: 100%; text-align: center;
  letter-spacing: .06em; text-transform: uppercase;
}
.license-input-wrap input:focus { outline: none; border-color: var(--accent); }
.license-input-wrap button {
  background: var(--accent2); color: white; border: none;
  border-radius: 12px; padding: 12px; font-family: var(--font-head);
  font-weight: 700; font-size: 14px; cursor: pointer; transition: all .2s;
}
.license-input-wrap button:hover { background: var(--accent); }
.license-error {
  font-size: 12px; color: #f87171; margin-top: 8px;
}
.license-error.hidden { display: none; }
.modal-close {
  background: none; border: 1px solid var(--border);
  border-radius: 12px; color: var(--text3); cursor: pointer;
  padding: 10px 20px; font-size: 13px; margin-top: 14px;
  font-family: var(--font-body); transition: all .2s; width: 100%;
}
.modal-close:hover { border-color: var(--text3); color: var(--text); }

/* ── TOAST ── */
.toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  background: var(--accent2); color: white; font-size: 13px; font-weight: 600;
  padding: 10px 22px; border-radius: 50px; z-index: 99;
  box-shadow: var(--shadow-accent);
  animation: slideDown .3s ease both;
}
.toast.hidden { display: none; }
@keyframes slideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 6px; }

/* ── DISABLED OVERLAY ── */
.app-locked * { pointer-events: none !important; cursor: not-allowed !important; }
