/* Licentium-style Marketing Checker */

:root {
  --bg: #f6f4ff;
  --panel: #ffffff;
  --text: #1c1f26;
  --muted: #6b7280;

  --primary: #6f4cff;        /* Licentium purple */
  --primary-soft: #ede9ff;

  --ok: #16a34a;
  --warn: #f59e0b;
  --fail: #dc2626;

  --neutral: #9ca3af;
  --line: #e5e7eb;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(180deg, #ffffff 0%, #f6f4ff 100%);
  color: var(--text);
}

/* Layout */

.container {
  max-width: 1100px;
  margin: 56px auto;
  padding: 0 20px;
}

h1 {
  font-size: 36px;
  font-weight: 800;
  margin: 0 0 32px;
  letter-spacing: -0.5px;
}

/* Form */

form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(111, 76, 255, 0.06);
}

label {
  display: block;
  margin: 14px 0 6px;
  font-size: 13px;
  color: var(--muted);
}

textarea,
input[type="text"],
select,
input[type="file"] {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fafafa;
  color: var(--text);
  padding: 12px 14px;
  font-size: 14px;
}

textarea {
  min-height: 160px;
  resize: vertical;
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Button */

button[type="submit"] {
  margin-top: 20px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.05s ease, box-shadow 0.15s ease, opacity 0.15s;
  box-shadow: 0 8px 20px rgba(111, 76, 255, 0.35);
}

button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(111, 76, 255, 0.45);
}

button[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Result */

#result {
  margin-top: 32px;
}

.topline {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topline h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
}

/* Badges */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.badge-ok {
  background: #dcfce7;
  color: var(--ok);
}

.badge-warn {
  background: #fef3c7;
  color: var(--warn);
}

.badge-fail {
  background: #fee2e2;
  color: var(--fail);
}

.badge-neutral {
  background: #f3f4f6;
  color: var(--neutral);
}

/* Grid */

.grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  margin-top: 20px;
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

/* Cards */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
}

.card + .card {
  margin-top: 14px;
}

.card-title {
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 10px;
}

/* Findings */

.row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.right {
  margin-left: auto;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

.finding .excerpt {
  margin: 10px 0;
  font-style: italic;
  color: #374151;
}

.issue,
.suggestion {
  margin: 8px 0;
}

.citations,
.sources {
  margin: 10px 0 0 20px;
  font-size: 13px;
}

usage-counter {
  margin: 12px 0 20px;
  padding: 10px 14px;
  background: #f5f6fa;
  border-radius: 10px;
  font-weight: 500;
}

.limit-warning {
  border: 2px solid #ffb4b4;
  background: #fff5f5;
}

.limit-warning h2 {
  margin-top: 0;
  color: #c0392b;
}

/* Rewrite */

.grid-full {
  grid-column: 1 / -1;
}

.rewrite {
  white-space: pre-wrap;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  font-size: 13px;
}

/* States */

.spinner {
  padding: 16px;
  border: 2px dashed var(--primary-soft);
  border-radius: 16px;
  text-align: center;
  color: var(--muted);
}

.disclaimer {
  margin-top: 24px;
  padding-top: 12px;
  font-size: 12px;
  line-height: 1.4;
  color: #6b7280; /* neutral gray */
  border-top: 1px solid #e5e7eb;
}

.error pre {
  white-space: pre-wrap;
  background: #fff1f2;
  border: 1px solid #fecdd3;
  border-radius: 14px;
  padding: 12px;
}

.card-title.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-copy {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid #ddd;
  background: #fff;
  cursor: pointer;
}

.btn-copy:hover {
  background: #f3f3f3;
}