*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #000;
  color: #f7f7f7;
}

/* Preview */

.preview-body {
  min-height: 100vh;
  background: radial-gradient(circle at top, #333, #000);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-overlay {
  max-width: 900px;
  width: 100%;
  padding: 40px 24px;
}

.preview-header {
  text-align: center;
  margin-bottom: 32px;
}

.ace-logo {
  font-size: 40px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.subtitle {
  margin: 0;
  color: #d0d0d0;
  font-size: 15px;
}

.preview-main {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 32px;
}

.preview-info h2 {
  margin-top: 0;
  font-size: 18px;
}

.preview-info ol {
  margin: 0;
  padding-left: 18px;
  color: #ddd;
  font-size: 14px;
}

.preview-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.preview-note {
  margin: 0;
  font-size: 13px;
  color: #bbbbbb;
}

/* Builder */

.builder-body {
  min-height: 100vh;
  background: radial-gradient(circle at top, #222, #000);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 12px 40px;
}

.builder-container {
  width: 100%;
  max-width: 1100px;
}

.builder-header {
  text-align: center;
  margin-bottom: 24px;
}

.builder-form {
  background: #111;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: 0 0 24px rgba(0,0,0,0.6);
}

.form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 14px;
}

.form-row-inline {
  flex-direction: row;
  gap: 12px;
  align-items: flex-end;
}

.form-column {
  flex: 1;
}

label {
  font-size: 13px;
  margin-bottom: 4px;
  color: #cccccc;
}

input[type="text"],
textarea,
select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #444;
  background: #050505;
  color: #f7f7f7;
  font-size: 14px;
}

textarea {
  resize: vertical;
}

.primary-button,
.secondary-button {
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.primary-button {
  background: #ffd600;
  color: #000;
}

.primary-button:hover:not(:disabled) {
  filter: brightness(1.1);
}

.primary-button:disabled {
  background: #555555;
  color: #bfbfbf;
  cursor: not-allowed;
  opacity: 1;
}

.secondary-button {
  background: #222;
  color: #f7f7f7;
}

.secondary-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: #333;
  overflow: hidden;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: #ffd600;
  transition: width 0.2s linear;
}

.progress-label {
  font-size: 12px;
  color: #cccccc;
  min-width: 80px;
  text-align: right;
}

.error-box {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #3b0000;
  color: #ffb3b3;
  font-size: 13px;
}

.builder-results h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.ads-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.ad-card {
  background: #101010;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 0 16px rgba(0,0,0,0.5);
}

.ad-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  background: #222;
}

.ad-headline {
  font-size: 14px;
  margin: 0;
}

.ad-copy {
  font-size: 13px;
  color: #cccccc;
  flex: 1;
}

/* Responsive */

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

  .ads-grid {
    grid-template-columns: 1fr;
  }

  .builder-body {
    padding: 16px 10px 30px;
  }
}
