:root {
  --page-bg: #f4f7fb;
  --panel-bg: #ffffff;
  --text: #172033;
  --muted: #64748b;
  --border: #dbe3ef;
  --border-strong: #cbd5e1;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #f59e0b;
  --danger: #b91c1c;
  --success: #166534;
  --shadow: 0 18px 55px rgba(23, 32, 51, 0.11);
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 32rem),
    linear-gradient(180deg, #f8fafc 0%, var(--page-bg) 100%);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

.page-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 36px auto;
}

.app-panel {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 4vw, 42px);
  box-shadow: var(--shadow);
}

.app-header {
  max-width: 780px;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.intro {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.mockup-form {
  margin-top: 26px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  margin-bottom: 18px;
}

label {
  display: block;
  margin-bottom: 7px;
  font-size: 15px;
  font-weight: 800;
}

label span {
  color: var(--danger);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text);
  font: inherit;
  padding: 13px 14px;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(37, 99, 235, 0.85);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

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

select {
  min-height: 51px;
}

.upload-field input {
  padding: 11px;
}

.field-help {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.selected-files {
  display: grid;
  gap: 8px;
  margin-top: -6px;
  margin-bottom: 18px;
}

.selected-file {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

button {
  appearance: none;
  border: 0;
  border-radius: var(--radius-md);
  padding: 14px 20px;
  background: var(--primary);
  color: #ffffff;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    transform 160ms ease,
    opacity 160ms ease;
}

button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.65;
  cursor: wait;
  transform: none;
}

.secondary-button {
  background: #e2e8f0;
  color: #0f172a;
}

.secondary-button:hover {
  background: #cbd5e1;
}

.status {
  margin-top: 18px;
  min-height: 24px;
  font-weight: 800;
}

.status.is-error {
  color: var(--danger);
}

.status.is-success {
  color: var(--success);
}

.status.is-loading {
  color: var(--primary-dark);
}

.result {
  margin-top: 34px;
}

.result-card {
  border-top: 1px solid var(--border);
  padding-top: 28px;
}

.result-card h2 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.result-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  background: #0f172a;
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
}

.result-actions a.secondary-link {
  background: #e2e8f0;
  color: #0f172a;
}

.mockup-image {
  display: block;
  width: 100%;
  max-width: 900px;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 16px 45px rgba(15, 23, 42, 0.16);
}

.debug-brief {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #f8fafc;
  overflow: hidden;
}

.debug-brief summary {
  cursor: pointer;
  padding: 12px 14px;
  font-weight: 800;
}

.debug-brief pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 780px) {
  .page-shell {
    width: min(100% - 22px, 1120px);
    margin: 16px auto;
  }

  .field-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .app-panel {
    border-radius: 16px;
  }

  .intro {
    font-size: 16px;
  }

  button {
    width: 100%;
  }

  .result-actions a {
    width: 100%;
  }
}