:root {
  /* DA brand colors — placeholder values, sync with dealer-automation repo brand tokens. */
  --da-navy: #0f1b2d;
  --da-navy-light: #1c2f4a;
  --da-blue: #2e6fef;
  --da-blue-dark: #1f4fc4;
  --da-green: #1a9c5a;
  --da-green-dark: #147a45;
  --da-red: #c0392b;
  --da-bg: #f5f7fa;
  --da-card-bg: #ffffff;
  --da-text: #1a2333;
  --da-text-muted: #5b6b82;
  --da-border: #e1e6ec;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(15, 27, 45, 0.08);
  --max-width: 480px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--da-bg);
  color: var(--da-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  padding: 20px 20px 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--da-navy);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
}

.brand-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--da-text-muted);
}

.app {
  flex: 1;
  padding: 8px 20px 32px;
  display: flex;
  flex-direction: column;
}

.footer {
  padding: 16px 20px 28px;
  text-align: center;
}

.footer p {
  margin: 0;
  font-size: 12px;
  color: var(--da-text-muted);
}

/* ---------- Shared state container ---------- */

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  padding: 40px 0;
}

.state[hidden] {
  display: none;
}

/* ---------- Loading ---------- */

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--da-border);
  border-top-color: var(--da-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Preview card ---------- */

.card {
  background: var(--da-card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  width: 100%;
}

.card-media {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-media img,
.card-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 18px 18px 20px;
}

.dealer-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--da-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin: 0 0 6px;
}

.content-type-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--da-blue-dark);
  background: rgba(46, 111, 239, 0.1);
  border-radius: 999px;
  padding: 3px 10px;
  margin-bottom: 12px;
}

.platform-caption {
  margin-bottom: 16px;
}

.platform-caption h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--da-text-muted);
  margin: 0 0 6px;
}

.platform-caption p {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.hashtags {
  font-size: 14px;
  color: var(--da-blue);
  margin-top: 6px;
}

.asset-thumbs {
  display: flex;
  gap: 8px;
  padding: 12px 18px 0;
  overflow-x: auto;
}

.asset-thumbs img,
.asset-thumbs video {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--da-border);
}

/* ---------- Actions ---------- */

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  width: 100%;
}

.btn {
  appearance: none;
  border: none;
  border-radius: var(--radius);
  padding: 15px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: transform 0.05s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-approve {
  background: var(--da-green);
  color: #fff;
}

.btn-approve:hover {
  background: var(--da-green-dark);
}

.btn-outline {
  background: transparent;
  color: var(--da-text);
  border: 1.5px solid var(--da-border);
}

.btn-outline:hover {
  border-color: var(--da-text-muted);
}

.changes-panel {
  width: 100%;
  margin-top: 12px;
}

.changes-panel[hidden] {
  display: none;
}

.changes-panel textarea {
  width: 100%;
  min-height: 100px;
  border: 1.5px solid var(--da-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 10px;
}

.changes-panel textarea:focus {
  outline: none;
  border-color: var(--da-blue);
}

/* ---------- Result / error states ---------- */

.state-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.state-icon.success {
  background: rgba(26, 156, 90, 0.12);
  color: var(--da-green);
}

.state-icon.error {
  background: rgba(192, 57, 43, 0.12);
  color: var(--da-red);
}

.state h2 {
  margin: 0;
  font-size: 19px;
}

.state p {
  margin: 0;
  color: var(--da-text-muted);
  font-size: 14px;
  line-height: 1.5;
}
