/* =====================================================================
   Culinow SEO Bundle Builder — design tokens, reset and component classes.

   Hand-ported from the original application's tailwind.config.ts palette and
   the @layer components block in src/app/globals.css, so colours, radii,
   shadows and control sizing match the original interface exactly. No build
   step and no framework: this is the compiled result, written by hand.
   ===================================================================== */

:root {
  color-scheme: light;

  /* Ink */
  --ink: #1f2937;
  --ink-soft: #4b5563;
  --ink-muted: #6b7280;

  /* Brand */
  --brand: #f53855;
  --brand-hover: #de2144;
  --brand-dark: #b81836;
  --brand-soft: #fde8ec;
  --brand-border: #f9bdc8;
  --brand-soft-hover: #fbd8e0;

  /* Surfaces */
  --canvas: #f8fafc;
  --line: #e5e7eb;
  --white: #ffffff;

  /* Grays */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-700: #374151;

  /* Semantic */
  --ok: #047857;
  --ok-soft: #ecfdf5;
  --ok-border: #a7f3d0;
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --warn-border: #fde68a;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;
  --danger-soft-hover: #fde3e3;
  --info: #1d4ed8;
  --info-soft: #eff6ff;
  --info-border: #bfdbfe;

  /* Elevation */
  --shadow-card: 0 1px 2px 0 rgba(16, 24, 40, 0.04), 0 1px 3px 0 rgba(16, 24, 40, 0.06);
  --shadow-pop: 0 10px 30px -10px rgba(16, 24, 40, 0.25);

  /* Type */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --sidebar-width: 16rem;
}

/* ---------------------------------------------------------------- reset */

*,
*::before,
*::after {
  box-sizing: border-box;
  border-width: 0;
  border-style: solid;
  border-color: var(--line);
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  line-height: 1.5;
  tab-size: 4;
  font-family: var(--font-sans);
}

body {
  min-height: 100vh;
  background-color: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-size: inherit;
  font-weight: inherit;
}

a {
  color: inherit;
  text-decoration: inherit;
}

button,
input,
optgroup,
select,
textarea {
  font-family: inherit;
  font-size: 100%;
  font-weight: inherit;
  line-height: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
}

button,
[type="button"],
[type="submit"],
[type="reset"] {
  -webkit-appearance: button;
  background-color: transparent;
  background-image: none;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

table {
  text-indent: 0;
  border-color: inherit;
  border-collapse: collapse;
}

img, svg, video, canvas, iframe {
  display: block;
  vertical-align: middle;
  max-width: 100%;
}

ol, ul {
  list-style: none;
  padding: 0;
}

textarea {
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: var(--gray-400);
  opacity: 1;
}

hr {
  height: 0;
  color: inherit;
  border-top-width: 1px;
}

fieldset {
  padding: 0;
}

legend {
  padding: 0;
}

summary {
  display: list-item;
  cursor: pointer;
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--brand);
}

::selection {
  background-color: #fde8ec;
  color: #1f2937;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.skip-link:focus {
  position: absolute;
  left: 1rem;
  top: 1rem;
  z-index: 50;
  width: auto;
  height: auto;
  margin: 0;
  clip: auto;
  overflow: visible;
  white-space: normal;
  border-radius: 0.5rem;
  background: var(--white);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-pop);
}

/* ----------------------------------------------------------- components */

.card {
  border-radius: 0.75rem;
  border-width: 1px;
  border-color: var(--line);
  background-color: var(--white);
  box-shadow: var(--shadow-card);
}

.label {
  display: block;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: var(--ink);
}

.label .required-mark {
  margin-left: 0.25rem;
  color: var(--brand);
}

.hint {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  line-height: 1rem;
  color: var(--ink-muted);
}

.field-error {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: var(--danger);
}

.input {
  width: 100%;
  border-radius: 0.5rem;
  border-width: 1px;
  border-color: var(--line);
  background-color: var(--white);
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: var(--ink);
}

.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(245, 56, 85, 0.3);
}

.input:disabled {
  cursor: not-allowed;
  background-color: var(--gray-50);
  color: var(--ink-muted);
}

select.input {
  padding-right: 2rem;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem 1rem;
}

.input-error {
  border-color: var(--danger);
}

.input-error:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px rgba(185, 28, 28, 0.3);
}

.textarea {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.625;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 0.5rem;
  border-width: 1px;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 150ms, border-color 150ms, color 150ms;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-primary {
  border-color: var(--brand);
  background-color: var(--brand);
  color: var(--white);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--brand-hover);
  border-color: var(--brand-hover);
}

.btn-secondary {
  border-color: var(--line);
  background-color: var(--white);
  color: var(--ink);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--gray-50);
}

.btn-soft {
  border-color: var(--brand-border);
  background-color: var(--brand-soft);
  color: var(--brand-dark);
}

.btn-soft:hover:not(:disabled) {
  background-color: var(--brand-soft-hover);
}

.btn-ghost {
  border-color: transparent;
  background-color: transparent;
  color: var(--ink-soft);
}

.btn-ghost:hover:not(:disabled) {
  background-color: var(--gray-100);
}

.btn-danger {
  border-color: var(--danger-border);
  background-color: var(--danger-soft);
  color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background-color: var(--danger-soft-hover);
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: 9999px;
  border-width: 1px;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
}

.badge-neutral { border-color: var(--line); background-color: var(--canvas); color: var(--ink-soft); }
.badge-brand   { border-color: var(--brand-border); background-color: var(--brand-soft); color: var(--brand-dark); }
.badge-ok      { border-color: var(--ok-border); background-color: var(--ok-soft); color: var(--ok); }
.badge-warn    { border-color: var(--warn-border); background-color: var(--warn-soft); color: var(--warn); }
.badge-danger  { border-color: var(--danger-border); background-color: var(--danger-soft); color: var(--danger); }
.badge-info    { border-color: var(--info-border); background-color: var(--info-soft); color: var(--info); }

.table-wrap {
  overflow-x: auto;
  border-radius: 0.75rem;
  border-width: 1px;
  border-color: var(--line);
  background-color: var(--white);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.data-table th {
  white-space: nowrap;
  border-bottom-width: 1px;
  border-color: var(--line);
  background-color: var(--canvas);
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: var(--ink-soft);
}

.data-table td {
  border-bottom-width: 1px;
  border-color: var(--line);
  padding: 0.5rem 0.75rem;
  vertical-align: top;
  color: var(--ink);
}

.data-table tbody tr:last-child td {
  border-bottom-width: 0;
}

.data-table tbody tr:hover {
  background-color: var(--gray-50);
}

.section-title {
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: var(--ink-muted);
}

/* --------------------------------------------------------- prose preview */

.prose-preview {
  font-size: 0.875rem;
  line-height: 1.625;
  color: var(--ink);
}

.prose-preview h1 { margin: 1.5rem 0 0.75rem; font-size: 1.5rem; line-height: 2rem; font-weight: 600; }
.prose-preview h2 { margin: 1.5rem 0 0.5rem; font-size: 1.25rem; line-height: 1.75rem; font-weight: 600; }
.prose-preview h3 { margin: 1rem 0 0.5rem; font-size: 1rem; line-height: 1.5rem; font-weight: 600; }
.prose-preview p  { margin-bottom: 0.75rem; }
.prose-preview ul { margin-bottom: 0.75rem; padding-left: 1.25rem; list-style: disc; }
.prose-preview ol { margin-bottom: 0.75rem; padding-left: 1.25rem; list-style: decimal; }
.prose-preview li { margin-bottom: 0.25rem; }
.prose-preview table { margin-bottom: 1rem; width: 100%; border-collapse: collapse; font-size: 0.75rem; }
.prose-preview th,
.prose-preview td { border-width: 1px; border-color: var(--line); padding: 0.25rem 0.5rem; text-align: left; }
.prose-preview th { background-color: var(--canvas); font-weight: 600; }
.prose-preview a  { color: var(--brand); text-decoration: underline; }
.prose-preview img { margin: 0.75rem 0; max-width: 100%; border-radius: 0.5rem; }
.prose-preview figure { margin: 0.75rem 0; }
.prose-preview blockquote {
  margin: 0.75rem 0;
  border-left: 3px solid var(--brand-border);
  padding-left: 0.75rem;
  color: var(--ink-soft);
}
.prose-preview code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  background: var(--gray-100);
  padding: 0.0625rem 0.25rem;
  border-radius: 0.25rem;
}

/* ------------------------------------------------------------ scrollbars */

.scroll-thin::-webkit-scrollbar { width: 10px; height: 10px; }
.scroll-thin::-webkit-scrollbar-thumb {
  background-color: var(--gray-300);
  border-radius: 9999px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.scroll-thin::-webkit-scrollbar-track { background: transparent; }

/* -------------------------------------------------------------- spinner */

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

.animate-spin { animation: cn-spin 1s linear infinite; }

@keyframes cn-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-in { animation: cn-fade-in 150ms ease-out; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .no-print { display: none !important; }
}
