:root {
  --teal: #0f766e;
  --teal-dark: #0b5c56;
  --orange: #ea580c;
  --orange-dark: #c2470a;
  --pastel-green: #d7f0ea;
  --soft-gray-bg: #f9fafb;
  --table-header-bg: #f1f5f9;
  --gray-btn: #94a3b8;
  --whatsapp: #25d366;
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-dark);
  background: #ffffff;
  line-height: 1.5;
}

a {
  text-decoration: none;
}

/* ===================== HERO SECTION ===================== */
.hero {
  background: var(--teal);
  color: #ffffff;
  text-align: center;
  padding: 48px 20px 40px;
}

.hero-inner {
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero h1 {
  font-size: 2.4rem;
  margin: 0 0 8px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.hero-tagline {
  font-size: 1.05rem;
  margin: 0 0 28px;
  color: #e6fbf7;
  max-width: 340px;
}

.hero-illustration-box {
  margin-bottom: 32px;
}

.hero-illustration {
  max-width: 320px;
  width: 100%;
  border-radius: 12px;
  background: #fff;
  padding: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: block;
}

.btn-cta {
  display: inline-block;
  background: var(--orange);
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-cta:hover {
  background: var(--orange-dark);
  transform: translateY(-1px);
}

/* ===================== HOW IT WORKS SECTION ===================== */
.how-it-works {
  background: #ffffff;
  padding: 48px 20px;
}

.section-inner {
  max-width: 720px;
  margin: 0 auto;
}

.how-it-works h2 {
  text-align: center;
  font-size: 1.5rem;
  margin: 0 0 12px;
  color: var(--text-dark);
}

.how-it-works-note {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 28px;
}

.steps-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 6px;
  justify-content: space-between;
}

.step {
  flex: 1;
  text-align: center;
  padding: 0 4px;
  min-width: 0;
}

.step-arrow {
  flex: 0 0 auto;
  color: var(--teal);
  font-size: 1.1rem;
  font-weight: 700;
  padding-top: 10px;
}

.step-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--pastel-green);
  color: var(--teal);
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.step h3 {
  font-size: 0.95rem;
  margin: 0 0 6px;
  color: var(--text-dark);
}

.step p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

/* ===================== FORM SECTION ===================== */
.form-section {
  background: var(--soft-gray-bg);
  padding: 40px 16px 64px;
}

.form-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 28px 20px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--border-color);
}

.form-card h2 {
  font-size: 1.3rem;
  margin: 0 0 6px;
}

.form-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
}

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

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-dark);
}

.required {
  color: var(--orange);
  font-weight: 600;
}

.field input[type="text"],
.field input[type="password"],
.field select,
.field textarea {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fafafa;
  color: var(--text-dark);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.field input[type="password"] {
  background: #f7f7f8;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
  background: #ffffff;
}

.field textarea {
  resize: vertical;
  min-height: 100px;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 6px 0 0;
}

.btn-analyze {
  width: 100%;
  background: var(--teal);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 15px;
  font-size: 1rem;
  font-weight: 700;
  margin-top: 24px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-analyze:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  opacity: 0.7;
}

.btn-analyze:not(:disabled):hover {
  background: var(--teal-dark);
}

.draft-status {
  font-size: 0.78rem;
  color: var(--teal);
  background: var(--pastel-green);
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  margin: 0 0 20px;
}

.btn-clear-draft {
  display: block;
  margin: 10px auto 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px;
}

.btn-clear-draft:hover {
  color: var(--text-dark);
}

/* ===================== RESULT AREA ===================== */
.result-area {
  margin-top: 28px;
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
}

.result-area h3 {
  font-size: 1.1rem;
  margin: 0 0 16px;
}

.loading-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--teal);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid var(--pastel-green);
  border-top-color: var(--teal);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

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

.error-message {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}

#rpp-table-wrapper {
  overflow-x: auto;
}

.rpp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.rpp-table th {
  background: var(--table-header-bg);
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  font-weight: 700;
  white-space: nowrap;
}

.rpp-table td {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  vertical-align: top;
}

.rpp-table tr:nth-child(even) td {
  background: #fafbfc;
}

.result-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-top: 20px;
}

.btn-download,
.btn-share {
  flex: 1;
  width: 50%;
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.btn-download {
  background: var(--gray-btn);
}

.btn-share {
  background: var(--whatsapp);
}

.btn-download:hover,
.btn-share:hover {
  opacity: 0.9;
}

/* ===================== FOOTER ===================== */
.site-footer {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted);
  font-size: 0.8rem;
  background: #ffffff;
}

/* ===================== RESPONSIVE (larger screens) ===================== */
@media (min-width: 640px) {
  .hero {
    padding: 64px 20px 56px;
  }
  .hero h1 {
    font-size: 3rem;
  }
  .form-card {
    padding: 40px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
