/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green: #cda435;
  --green-light: #b8902d;
  --green-pale: #fdf5e0;
  --text: #1a1a1a;
  --text-muted: #555;
  --border: #d0d7de;
  --bg: #f9f7f2;
  --white: #ffffff;
  --error: #b91c1c;
  --error-bg: #fef2f2;
  --radius: 8px;
  --shadow: 0 1px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --btn-primary-text: #ffffff;
  --body-copy-size: 23px;
  --body-copy-small: 20px;
  --body-copy-xs: 18px;
}

html { font-size: 16px; }

body {
  font-family: 'Alegreya Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: #fff;
  font-size: var(--body-copy-size);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Alegreya Sans', serif;
  letter-spacing: 1.5px;
}

a { color: var(--green-light); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

/* ===== HEADER ===== */
.site-header {
  background: var(--green);
  color: var(--white);
  padding: 3rem 0 2.5rem;
  text-align: center;
}

.site-tag {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--green-pale);
  margin-bottom: 0.75rem;
}

.site-header h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1rem;
}

.site-sub {
  font-size: var(--body-copy-size);
  color: rgba(255,255,255,0.85);
  max-width: 600px;
  margin: 0 auto;
}

/* ===== MAIN ===== */
main {
  padding: 4rem 0 6rem;
}

/* ===== ERROR BOX ===== */
.error-box {
  background: var(--error-bg);
  border: 1px solid #fca5a5;
  border-left: 4px solid var(--error);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  color: var(--error);
}

.error-box ul {
  margin-top: 0.5rem;
  padding-left: 1.25rem;
}

.error-box li { margin-bottom: 0.25rem; }

/* ===== FORM SECTIONS ===== */
.form-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.form-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--green);
}

.section-note {
  font-size: var(--body-copy-small);
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ===== FIELDS ===== */
.field { display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }

.field-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.field-row--3 .field { flex: 1 1 150px; }

label { font-size: var(--body-copy-small); font-weight: 600; color: var(--text); }

.req { color: var(--error); }
.optional { font-weight: 400; color: var(--text-muted); }

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--body-copy-size);
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--green-light);
  box-shadow: 0 0 0 3px rgba(64,145,108,0.2);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23555' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2rem;
}

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

.char-count {
  font-size: var(--body-copy-xs);
  color: var(--text-muted);
  text-align: right;
  margin-top: 0.25rem;
}

/* ===== RADIO OPTIONS ===== */
.question-block {
  border: none;
  padding: 0;
  margin-bottom: 1.75rem;
}

.question-block legend {
  font-size: var(--body-copy-size);
  font-weight: 700;
  margin-bottom: 0.85rem;
  color: var(--text);
  display: block;
}

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.radio-option:hover { border-color: var(--green-light); background: var(--green-pale); }

.radio-option.selected {
  border-color: var(--green);
  background: var(--green-pale);
}

.radio-option input[type="radio"] {
  width: auto;
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--green);
}

.radio-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.radio-label strong { font-size: var(--body-copy-size); }
.radio-desc { font-size: var(--body-copy-small); color: var(--text-muted); }

/* ===== CONSENT ===== */
.form-section--consent {
  border-color: var(--border);
  background: var(--bg);
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  font-size: var(--body-copy-small);
  font-weight: 400;
  color: var(--text);
}

.consent-label input[type="checkbox"] {
  width: auto;
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--green);
}

.consent-label--optional {
  margin-top: 0.75rem;
  color: var(--text-muted, #666);
}

.compose-help--expanded {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.compose-help--expanded p {
  flex-basis: 100%;
  margin: 0;
  color: var(--text-muted);
  font-size: var(--body-copy-small);
}

/* ===== BUTTONS ===== */
.form-actions {
  text-align: center;
  margin-top: 2rem;
  margin-bottom: 2rem;

}

.form-actions--secondary { margin-top: 1rem; }

.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  border-radius: var(--radius);
  font-size: var(--body-copy-small);
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn--primary {
  background: var(--green);
  color: var(--btn-primary-text);
  border-color: var(--green);
}

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

.btn--primary:disabled {
  background: #d9c07a;
  border-color: #d9c07a;
  color: #6b5a1a;
  cursor: not-allowed;
}

.btn--secondary {
  background: transparent;
  color: var(--green);
  border-color: var(--green);
}

.btn--secondary:hover { background: var(--green-pale); }

.btn--small {
  padding: 0.45rem 0.85rem;
  font-size: var(--body-copy-xs);
}

.btn--donate {
  background: #e07b1a;
  color: var(--white);
  border-color: #e07b1a;
}

.btn--donate:hover { background: #c96a12; border-color: #c96a12; }

.form-note, .send-note, .editor-note {
  font-size: var(--body-copy-xs);
  color: var(--text-muted);
  margin-top: 0.6rem;

  ;
}

.compose-help {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.65rem;
}

/* ===== REVIEW PAGE ===== */
.review-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}

.review-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--green);
}

.letter-cards { display: flex; flex-direction: column; gap: 1rem; }

.letter-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.letter-card:hover { border-color: var(--green-light); background: var(--green-pale); }

.letter-card--selected {
  border-color: var(--green);
  background: var(--green-pale);
  box-shadow: 0 0 0 3px rgba(45,106,79,0.15);
}

.letter-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.letter-version {
  font-size: var(--body-copy-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.letter-select-badge {
  font-size: var(--body-copy-xs);
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--border);
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.letter-select-badge--active {
  background: var(--green);
  color: var(--white);
}

.letter-preview {
  font-size: var(--body-copy-size);
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.7;
  max-height: 220px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

.letter-card--selected .letter-preview {
  max-height: none;
  -webkit-mask-image: none;
  mask-image: none;
}

#editor {
  width: 100%;
  min-height: 320px;
  margin-top: 1rem;
  font-size: var(--body-copy-size);
  line-height: 1.75;
  padding: 1rem 1.25rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-family: 'Georgia', 'Times New Roman', serif;
  color: var(--text);
}

#editor:focus {
  outline: none;
  border-color: var(--green-light);
  box-shadow: 0 0 0 3px rgba(64,145,108,0.2);
}

.send-section { text-align: left; }

/* Two send-option cards stacked vertically */
.send-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.25rem;
}

.send-option {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.send-option--primary {
  border-color: var(--green);
  background: var(--green-pale);
}

.send-option h3 {
  font-size: var(--body-copy-size);
  font-weight: 700;
  color: var(--green);
  margin-bottom: 0.2rem;
}

.send-option p {
  font-size: var(--body-copy-small);
  color: var(--text-muted);
  margin: 0;
}

.send-option-body { flex: 1; }

.send-option .btn { align-self: flex-start; }

.send-option-note {
  font-size: var(--body-copy-xs);
  color: var(--text-muted);
  min-height: 1.2em;
}

/* Success confirmation shown after joining Pacific Wild's submission */
.success-state {
  text-align: center;
  padding: 2rem 1rem;
}

.success-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  font-size: 1.5rem;
  line-height: 3rem;
  margin: 0 auto 1rem;
}

.success-state h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 0.5rem;
}

.success-state p {
  font-size: var(--body-copy-small);
  color: var(--text-muted);
}

/* ===== HONEYPOT (bot trap — never visible to real users) ===== */
.honeypot {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(246, 248, 250, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.loading-overlay--visible {
  display: flex;
}

.loading-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem;
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.loading-wolf {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.12); opacity: 0.8; }
}

.loading-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 0.4rem;
  transition: opacity 0.3s;
  min-height: 1.75rem;
}

.loading-sub {
  font-size: var(--body-copy-small);
  color: var(--text-muted);
  margin-bottom: 1.75rem;
}

.loading-bar-track {
  height: 6px;
  background: var(--green-pale);
  border-radius: 999px;
  overflow: hidden;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--green), var(--green-light));
  border-radius: 999px;
  transition: width 0.4s ease-out;
}

/* ===== CONFIRMATION OVERLAY ===== */
.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.confirm-overlay[hidden] { display: none; }

.confirm-card {
  position: relative;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 2.5rem 2rem 2rem;
  text-align: center;
  max-width: 420px;
  width: 100%;
}

.confirm-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
}

.confirm-close:hover { color: var(--text); background: var(--bg); }

.confirm-card h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 0.6rem;
}

.confirm-card p {
  font-size: var(--body-copy-small);
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.share-box {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.confirm-card .share-title {
  margin: 0 0 0.15rem;
  color: var(--green);
  font-weight: 700;
  font-size: 1.15rem;
}

.share-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.share-row input {
  min-width: 0;
  flex: 1;
  font-size: var(--body-copy-xs);
  padding: 0.7rem 0.85rem;
}

.share-row .btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,0.6);
  padding: 1.5rem 0;
  font-size: 0.8rem;
  text-align: center;
}

.site-footer a { color: rgba(255,255,255,0.8); }

/* ===== RESPONSIVE ===== */
@media (max-width: 540px) {
  .field-row { flex-direction: column; }
  .form-section { padding: 1.25rem; }
  .review-section { padding: 1.25rem; }
}

/* ===== LANDING PAGE ===== */
.landing-intro {
  text-align: center;
  padding: 2rem 0 1rem;
}

.landing-intro h2 {
  font-size: clamp(1.3rem, 3.5vw, 1.8rem);
  color: var(--green);
  margin-bottom: 0.75rem;
}

.landing-options {
  display: flex;
  gap: 1.5rem;
  margin: 1.5rem 0 2rem;
}

@media (max-width: 580px) {
  .landing-options { flex-direction: column; }
}

.landing-option {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.landing-option:hover {
  border-color: var(--green);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.landing-option--primary {
  border-color: var(--green);
  background: var(--green-pale);
}

.landing-option h3 {
  margin: 0 0 0.75rem;
  font-size: 1.35rem;
  color: var(--green);
}

.landing-option p {
  flex: 1;
  margin: 0 0 1.5rem;
  color: var(--text-muted);
  font-size: var(--body-copy-size);
  line-height: 1.6;
}

.landing-option .btn {
  align-self: flex-start;
}
