:root {
  --color-navy: #1a3d63;
  --color-midnight: #122c49;
  --color-dusty-blue: #52677d;
  --color-buttercream: #efe2b8;
  --color-buttercream-deep: #ddc888;
  --color-ivory: #fffdf7;
  --color-page-bg: #f3ede2;
  --color-card-bg: var(--color-ivory);
  --color-border: #e6ddc9;
  --color-text: #1c2230;
  --color-text-muted: #5b6472;
  --font-heading: "Playfair Display", Georgia, serif;
  --font-body: "Source Sans 3", -apple-system, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #f8f4ec 0%, var(--color-page-bg) 60%);
  color: var(--color-text);
  padding: 2.5rem 1rem;
}

.app {
  width: 100%;
  max-width: 660px;
  transition: max-width 0.2s ease;
}

.app.app--wide {
  max-width: 780px;
}

.app-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.app-header h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 2.75rem;
  letter-spacing: 0.02em;
  color: var(--color-navy);
}

.app-header h1::after {
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  margin: 0.6rem auto 0;
  background: var(--color-buttercream-deep);
}

.tagline {
  color: var(--color-text-muted);
  margin: 0.75rem 0 0;
  font-size: 1.05rem;
}

.card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-navy);
  border-radius: 6px;
  padding: 2.25rem;
  box-shadow: 0 20px 45px rgba(15, 26, 43, 0.14);
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.step-label {
  color: var(--color-dusty-blue);
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 0 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

h2 {
  margin-top: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.65rem;
  color: var(--color-navy);
  line-height: 1.3;
}

p {
  color: var(--color-text);
}

.about-content p {
  margin: 0 0 1rem;
  line-height: 1.65;
}

.about-intro {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--color-navy);
  line-height: 1.4;
}

.about-heading {
  margin: 2.25rem 0 0.9rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--color-navy);
}

.about-quote {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--color-navy);
  text-align: center;
  margin: 1.75rem 0 !important;
}

.about-signoff {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.3rem;
  color: var(--color-navy);
  margin-top: 1.75rem !important;
}

.about-signature {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  margin-top: 0.35rem !important;
}

.about-linkedin {
  margin: -0.4rem 0 1.25rem !important;
  font-size: 0.95rem;
}

.about-linkedin a {
  color: var(--color-navy);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.about-linkedin a:hover {
  color: var(--color-midnight);
}

.impact-callout {
  background: var(--color-navy);
  border-radius: 4px;
  padding: 1.75rem 1.5rem;
  text-align: center;
  margin: 1.5rem 0 !important;
}

.impact-stat {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 2.75rem;
  line-height: 1;
  color: var(--color-buttercream-deep);
  margin: 0 !important;
}

.impact-equivalent {
  color: var(--color-ivory);
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.05rem;
  margin: 0.5rem 0 0.9rem !important;
}

.impact-caption {
  color: var(--color-ivory);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0 !important;
}

.welcome-lead {
  font-size: 1.05rem;
  line-height: 1.55;
  margin: 0 0 1.25rem;
}

.flow-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.8rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-heading);
  font-size: 0.98rem;
  color: var(--color-navy);
}

.flow-sep {
  color: #8a6d1f;
  font-size: 1.2rem;
  line-height: 1;
}

.impact-divider {
  height: 1px;
  background: rgba(255, 253, 247, 0.2);
  margin: 1.5rem 0 !important;
}

.impact-scale-label {
  color: var(--color-buttercream-deep);
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.05rem;
  margin: 0 0 0.75rem !important;
}

.impact-stat--secondary {
  font-size: 2.1rem;
}

.success-callout {
  background: var(--color-buttercream-deep);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  text-align: center;
  margin: 1.25rem 0 !important;
  animation: success-pop 0.45s ease;
}

.success-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--color-navy);
  margin: 0 0 0.5rem !important;
}

.success-body {
  color: var(--color-midnight);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0 !important;
}

@keyframes success-pop {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.btn-option {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: #fbf7ec;
  color: var(--color-text);
  font-size: 1.05rem;
  font-weight: 600;
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.option-examples {
  font-size: 0.88rem;
  font-weight: normal;
  color: var(--color-text-muted);
}

.btn-option:hover {
  border-color: var(--color-navy);
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 26, 43, 0.1);
}

.btn-primary {
  margin-top: 1.5rem;
  padding: 0.9rem 1.8rem;
  border: none;
  border-radius: 4px;
  background: var(--color-navy);
  color: var(--color-ivory);
  font-size: 0.98rem;
  font-weight: 600;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  background: var(--color-midnight);
  box-shadow: 0 6px 16px rgba(15, 26, 43, 0.25);
}

.btn-secondary {
  margin-top: 1.5rem;
  margin-left: 0.75rem;
  padding: 0.9rem 1.8rem;
  border: 1px solid var(--color-navy);
  border-radius: 4px;
  background: transparent;
  color: var(--color-navy);
  font-size: 0.98rem;
  font-weight: 600;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-secondary:hover {
  background: #fbf3de;
}

textarea {
  width: 100%;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: var(--color-ivory);
  font-family: var(--font-body);
  font-size: 1.05rem;
  line-height: 1.5;
  color: var(--color-text);
  resize: vertical;
}

textarea:focus {
  outline: none;
  border-color: var(--color-navy);
  box-shadow: 0 0 0 3px rgba(15, 26, 43, 0.12);
}

.step-actions,
.result-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.step-actions .btn-primary,
.step-actions .btn-secondary,
.result-actions .btn-primary,
.result-actions .btn-secondary {
  margin-top: 0;
  margin-left: 0;
}

#retry-btn {
  display: none;
}

.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.field-error {
  color: #9c3b3b;
  font-size: 0.9rem;
  min-height: 1.2rem;
  margin-top: 0.5rem;
  font-weight: 600;
}

.char-count {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.copy-confirm {
  color: #3f6b3f;
  font-size: 0.9rem;
  height: 1.2rem;
  margin-top: 0.5rem;
  font-weight: 600;
}

.reminders-panel {
  background: var(--color-navy);
  border: 1px solid var(--color-navy);
  border-left: 3px solid var(--color-buttercream-deep);
  border-radius: 4px;
  padding: 0.9rem 1.1rem;
  margin-top: 1.1rem;
}

.reminders-label {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-ivory);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.reminders-panel ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--color-ivory);
  font-size: 0.92rem;
}

.reminders-panel li + li {
  margin-top: 0.4rem;
}

.btn-link {
  display: inline-block;
  margin-top: 1.1rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--color-navy);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: var(--font-body);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.example-panel {
  background: #fbf3de;
  border: 1px solid var(--color-buttercream-deep);
  border-left: 3px solid var(--color-buttercream-deep);
  border-radius: 4px;
  padding: 0.9rem 1.1rem;
  margin-top: 0.6rem;
}

.example-label {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #8a6d1f;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.example-panel p#example-text {
  margin: 0;
  color: var(--color-text);
  font-size: 0.95rem;
  font-style: italic;
}

.water-badge {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 240px;
  background: var(--color-navy);
  border-radius: 999px;
  padding: 0.65rem 1.1rem 0.65rem 0.75rem;
  box-shadow: 0 10px 28px rgba(15, 26, 43, 0.3);
  animation: water-badge-in 0.4s ease;
}

.water-badge[hidden] {
  display: none;
}

.water-badge-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--color-buttercream-deep);
  animation: water-badge-pulse 2.4s ease-in-out infinite;
}

.water-badge-text {
  line-height: 1.2;
}

.water-badge-title {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--color-ivory);
}

.water-badge-subtitle {
  margin: 0.1rem 0 0;
  font-size: 0.72rem;
  color: rgba(255, 253, 247, 0.75);
}

@keyframes water-badge-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; }
}

@keyframes water-badge-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
  .water-badge {
    right: 0.75rem;
    bottom: 0.75rem;
    max-width: 160px;
    padding: 0.5rem 0.75rem 0.5rem 0.55rem;
  }

  .water-badge-title {
    font-size: 0.75rem;
  }

  .water-badge-subtitle {
    font-size: 0.65rem;
  }

  .card {
    padding-bottom: 4.5rem;
  }

  .flow-strip {
    flex-direction: column;
    gap: 0.3rem;
  }

  .flow-sep {
    display: none;
  }
}

.step-actions--center {
  justify-content: center;
  margin-top: 1.75rem;
}

.back-top {
  display: inline-block;
  margin: 0;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--color-navy);
  border-radius: 4px;
  background: transparent;
  color: var(--color-navy);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.15s ease;
}

.back-top:hover {
  background: #fbf3de;
}

.back-top[hidden] {
  display: none;
}

.back-top--page {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  z-index: 50;
}

@media (max-width: 480px) {
  .app.app--has-back {
    margin-top: 2.5rem;
  }
}

#char-count {
  margin: 0.5rem 0 0;
}

#result-error {
  margin: 0.5rem 0 0;
  min-height: 0;
}

#result-error:empty {
  display: none;
}

#screen-result .success-callout {
  margin: 1rem 0 0 !important;
}

.ai-links {
  margin-top: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.ai-links[hidden] {
  display: none;
}

.ai-links-label {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-dusty-blue);
}

.ai-links-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.9rem;
}

.ai-link {
  color: var(--color-navy);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ai-link:hover {
  color: var(--color-midnight);
}

.ai-sep {
  color: #8a6d1f;
  font-size: 1.2rem;
  line-height: 1;
}

.back-top:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.result-actions--center {
  justify-content: center;
}

.btn-primary--lg {
  padding: 1rem 2.6rem;
}

#copy-confirm {
  text-align: center;
}

.result-footer {
  margin-top: 1.25rem;
  text-align: center;
}

.text-link {
  padding: 0;
  border: none;
  background: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.text-link:hover {
  color: var(--color-navy);
}

.text-link:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 200;
}

.success-callout {
  padding: 1rem 1.25rem;
}

.success-callout .success-title {
  margin: 0 !important;
  font-size: 1.2rem;
}
