/* Otavan AI marketing toolkit - friendly, generous, normie-leaning. */
:root {
  --bg: #faf7f2;
  --ink: #1c1a17;
  --muted: #6b6b65;
  --line: #e8e4d8;
  --line-strong: #d4cfbe;
  --accent: #e36a1e;
  --accent-hover: #c95913;
  --accent-soft: #fff1e3;
  --ok: #2f7a3a;
  --err: #b03333;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 2px 4px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 8px rgba(0,0,0,0.05), 0 20px 40px rgba(0,0,0,0.06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }

/* topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark { font-weight: 700; font-size: 1.15em; letter-spacing: -0.01em; }
.brand-divider { color: var(--accent); font-weight: 400; }
.brand-mlok { color: var(--muted); font-size: 0.96em; }
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.mock-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86em;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.mock-toggle:hover { color: var(--ink); }
.mock-toggle input { margin: 0; cursor: pointer; }
body.mock-on .topbar { background: #fff8e8; border-bottom-color: #f0c869; }
body.mock-on .mock-toggle { color: #8a5a00; font-weight: 500; }
.status-light {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--muted); transition: background 0.3s;
}
.status-light.ok { background: var(--ok); }
.status-light.err { background: var(--err); }

/* page layout */
main {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 24px 48px;
}

.hero {
  text-align: center;
  padding: 8px 0 32px;
}
.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6em, 3vw, 2.2em);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hero .lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.05em;
}

/* tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  justify-content: center;
}
.tab {
  padding: 10px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 0.96em;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.tab:hover { color: var(--ink); border-color: var(--line-strong); }
.tab[aria-selected="true"] {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
  font-weight: 500;
}

/* main panel */
.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}
.panel h2 {
  margin: 0 0 6px;
  font-size: 1.3em;
  font-weight: 600;
}
.panel .blurb {
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 1em;
}

/* fields */
.field { margin-bottom: 20px; }
.field-label {
  display: block;
  font-size: 0.95em;
  margin-bottom: 8px;
  font-weight: 500;
}
.field-required { color: var(--accent); }

/* drop zone - big, generous */
.dropzone {
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  background: #fdfcf8;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dropzone:hover, .dropzone.drag {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.dropzone input[type="file"] {
  position: absolute; inset: 0;
  opacity: 0;
  cursor: pointer;
}
.dropzone .placeholder {
  color: var(--muted);
}
.dropzone .placeholder-icon {
  font-size: 2em;
  margin-bottom: 6px;
  display: block;
}
.dropzone .placeholder-main { font-weight: 500; color: var(--ink); display: block; margin-bottom: 4px; }
.dropzone .placeholder-sub { font-size: 0.88em; }
.dropzone .preview {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.dropzone.has-file .placeholder { display: none; }
.dropzone.has-file .preview { display: flex; }
.dropzone .preview img {
  max-height: 280px;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  object-fit: contain;
}
.dropzone .preview .meta {
  font-size: 0.85em;
  color: var(--muted);
}
.dropzone .preview .meta strong {
  color: var(--ink);
}
.dropzone .replace-hint {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8em;
  color: var(--muted);
  pointer-events: none;
}
.dropzone.has-file .placeholder { display: none; }

/* example chip row */
.examples-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.examples-label {
  font-size: 0.85em;
  color: var(--muted);
}
.example-btn {
  padding: 6px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 0.85em;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.example-btn:hover { border-color: var(--accent); color: var(--accent); }

/* text input */
.text-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  font: inherit;
  font-size: 1em;
  background: #fdfcf8;
  transition: border-color 0.15s, background 0.15s;
}
.text-input:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

/* buttons */
.actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  align-items: center;
}
button.primary, a.primary, button.ghost, a.ghost {
  font: inherit;
  font-size: 1em;
  padding: 12px 24px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1.5px solid transparent;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  transition: all 0.15s;
}
button.primary, a.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}
button.primary:hover, a.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
button.primary:disabled {
  background: var(--line);
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
button.ghost, a.ghost {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}
button.ghost:hover, a.ghost:hover {
  color: var(--ink);
  border-color: var(--ink);
}
.primary-large {
  padding: 14px 32px;
  font-size: 1.05em;
}

/* job / generate panel */
.job {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  margin-top: 20px;
}
.job-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.job-head h2 { margin: 0; font-size: 1.2em; font-weight: 600; }

.progress {
  display: grid;
  grid-template-columns: minmax(180px, 280px) 1fr;
  gap: 32px;
  align-items: center;
  padding: 16px 0;
}
.progress-inputs {
  display: grid;
  gap: 8px;
}
.progress-inputs img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  max-height: 240px;
  object-fit: contain;
}
.progress-status {
  text-align: left;
  padding: 16px 0;
}
.spinner {
  width: 44px;
  height: 44px;
  margin: 0 0 16px;
  border: 4px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.status-line {
  margin: 0 0 6px;
  font-size: 1.1em;
  font-weight: 500;
}
.status-hint {
  margin: 0;
  font-size: 0.9em;
  color: var(--muted);
}

/* result panel */
.result {
  margin: 0;
}
.result-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
}
.result-side {
  display: grid;
  gap: 8px;
}
.result-side-label {
  font-size: 0.82em;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
}
.result-side img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  object-fit: contain;
  max-height: 480px;
}
.result-side .input-stack {
  display: grid;
  gap: 8px;
}
.result-side .input-stack img {
  max-height: 220px;
}
.result-arrow {
  font-size: 1.6em;
  color: var(--accent);
  font-weight: 300;
}
.result figcaption {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 22px;
  justify-content: center;
}

/* footer */
.foot {
  text-align: center;
  margin: 40px 0 12px;
  font-size: 0.9em;
}

/* error banner */
.error-banner {
  background: #fbe9e7;
  border: 1px solid var(--err);
  color: var(--err);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin: 0 0 14px;
  font-size: 0.95em;
}

/* responsive */
@media (max-width: 700px) {
  main { padding: 20px 14px; }
  .topbar { padding: 12px 16px; }
  .panel, .job { padding: 18px; }
  .progress {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .progress-status { text-align: center; }
  .progress-status .spinner { margin-left: auto; margin-right: auto; }
  .result-grid {
    grid-template-columns: 1fr;
  }
  .result-arrow {
    transform: rotate(90deg);
    text-align: center;
    margin: 4px auto;
  }
  .hero h1 { font-size: 1.5em; }
}
