* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  line-height: 1.6;
  color: #333;
  background: #f5f5f5;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, #e8833a 0%, #c66b2a 100%);
  color: white;
  border-radius: 12px;
  margin-bottom: 30px;
}

header h1 {
  font-size: 2em;
  margin-bottom: 8px;
}

header .subtitle {
  opacity: 0.9;
  font-size: 1.1em;
}

/* Code Section */
.code-section {
  background: #fff8f0;
  border: 2px dashed #e8833a;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 30px;
  text-align: center;
}

.code-section h2 {
  color: #c66b2a;
  margin-bottom: 8px;
  font-size: 1.2em;
}

.code-section p {
  color: #555;
  margin-bottom: 16px;
}

.code-input-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.code-input-group input {
  padding: 12px 16px;
  font-size: 1.1em;
  text-transform: uppercase;
  letter-spacing: 2px;
  border: 2px solid #ccc;
  border-radius: 8px;
  width: 180px;
  text-align: center;
}

.code-input-group input:focus {
  outline: none;
  border-color: #e8833a;
}

.code-input-group button {
  padding: 12px 24px;
  background: #e8833a;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  cursor: pointer;
  transition: background 0.2s;
}

.code-input-group button:hover {
  background: #c66b2a;
}

/* Form Sections */
.form-section {
  background: white;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.form-section h2 {
  color: #c66b2a;
  font-size: 1.3em;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #fff0e6;
}

.section-description {
  color: #666;
  margin: -12px 0 20px 0;
  font-size: 0.95em;
}

.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group > label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.help-text {
  display: block;
  font-size: 0.85em;
  color: #666;
  margin-top: 4px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  font-size: 1em;
  border: 2px solid #ddd;
  border-radius: 8px;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #e8833a;
}

/* Form Row (side by side fields) */
.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.form-row .form-group.flex-1 { flex: 1; }
.form-row .form-group.flex-2 { flex: 2; }

/* Input with prefix (for donation) */
.input-with-prefix {
  display: flex;
  align-items: center;
  border: 2px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.input-with-prefix:focus-within {
  border-color: #e8833a;
}

.input-with-prefix .prefix {
  padding: 12px 16px;
  background: #f5f5f5;
  color: #666;
  font-weight: 600;
}

.input-with-prefix input {
  border: none !important;
  flex: 1;
  padding: 12px;
}

.input-with-prefix input:focus {
  outline: none;
}

/* Radio and Checkbox Groups */
.radio-group,
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-group.horizontal {
  flex-direction: row;
  flex-wrap: wrap;
}

.radio-group.compact {
  gap: 8px;
}

.radio-option,
.checkbox-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #f9f9f9;
  border: 2px solid #eee;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.radio-option:hover,
.checkbox-option:hover {
  background: #fff8f0;
  border-color: #f0c8a8;
}

.radio-option.compact,
.checkbox-option.compact {
  padding: 12px 16px;
  align-items: center;
}

.radio-option input,
.checkbox-option input {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}

.radio-option.compact input,
.checkbox-option.compact input {
  margin-top: 0;
}

.radio-label,
.checkbox-label {
  font-weight: 500;
}

.checkbox-option.standalone {
  background: transparent;
  border: none;
  padding: 0;
}

.checkbox-option.standalone:hover {
  background: transparent;
}

/* Tier Selection */
.tier-selection {
  gap: 16px;
}

.tier-option {
  flex-direction: row;
  align-items: flex-start;
}

.tier-option input {
  margin-top: 4px;
}

.tier-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tier-name {
  font-weight: 700;
  font-size: 1.1em;
  color: #c66b2a;
}

.tier-subtitle {
  font-weight: 600;
  color: #333;
}

.tier-description {
  font-size: 0.9em;
  color: #666;
}

/* Share Selection */
.share-options {
  gap: 10px;
}

.share-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 12px;
  padding: 14px 16px;
}

.share-option input {
  grid-row: span 2;
  align-self: center;
}

.share-label {
  font-weight: 600;
  color: #333;
}

.share-detail {
  font-size: 0.85em;
  color: #666;
  grid-column: 2;
}

.share-price {
  grid-row: span 2;
  align-self: center;
  font-weight: 700;
  color: #c66b2a;
  font-size: 1.1em;
  min-width: 60px;
  text-align: right;
}

/* Partner Section */
.partner-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eee;
}

.partner-section h3 {
  font-size: 1em;
  color: #666;
  margin-bottom: 12px;
}

/* Intro Section */
.intro-section .welcome {
  font-size: 1.1em;
}

.intro-section a {
  color: #c66b2a;
}

/* How It Works */
.how-it-works {
  padding-left: 24px;
}

.how-it-works li {
  margin-bottom: 8px;
}

/* Share List */
.share-list {
  padding-left: 20px;
}

.share-list li {
  margin-bottom: 8px;
}

/* Tier Info Blocks */
.tier-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 20px 0;
}

.tier-block {
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid;
}

.tier-block h3 {
  margin: 0 0 8px 0;
  font-size: 1.1em;
}

.tier-block p {
  margin: 0;
  font-size: 0.95em;
}

.tier-block.sunset {
  background: #fff8f0;
  border-left-color: #e8833a;
}

.tier-block.sunset h3 {
  color: #c66b2a;
}

.tier-block.park {
  background: #f0fff4;
  border-left-color: #38a169;
}

.tier-block.park h3 {
  color: #276749;
}

.tier-block.brooklyn {
  background: #ebf8ff;
  border-left-color: #3182ce;
}

.tier-block.brooklyn h3 {
  color: #2c5282;
}

/* Farmer Info */
.farmer-info {
  display: grid;
  gap: 16px;
}

.farmer {
  padding: 16px;
  background: #f9f9f9;
  border-radius: 8px;
}

.farmer h3 {
  margin: 0 0 8px 0;
  font-size: 1em;
  color: #333;
}

.farmer h3 .crop {
  font-weight: normal;
  color: #666;
  font-size: 0.9em;
}

.farmer h3 .crop::before {
  content: "— ";
}

.farmer p {
  margin: 0 0 8px 0;
  font-size: 0.95em;
  color: #555;
}

.farmer p:last-child {
  margin-bottom: 0;
}

.farmer .pricing {
  font-weight: 600;
  color: #c66b2a;
}

/* Info Box */
.info-box {
  background: #f0f7ff;
  border-left: 4px solid #3b82f6;
  padding: 16px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 20px;
}

.info-box p {
  margin: 0 0 8px 0;
  color: #1e40af;
}

.info-box p:last-child {
  margin-bottom: 0;
}

.info-box ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
  color: #1e40af;
}

.info-box ul li {
  margin-bottom: 4px;
}

.info-box.roast-info {
  background: #faf5f0;
  border-left-color: #8b6914;
}

.info-box.roast-info p {
  color: #5c4a1a;
}

.info-box.donation-examples {
  background: #f0fff4;
  border-left-color: #38a169;
}

.info-box.donation-examples p,
.info-box.donation-examples ul {
  color: #276749;
}

.info-box.warning {
  background: #fef3c7;
  border-left-color: #f59e0b;
}

.info-box.warning p {
  color: #92400e;
}

.info-box.warning a {
  color: #92400e;
  font-weight: 600;
}

/* Form Footer */
.form-footer {
  text-align: center;
  padding: 20px;
  color: #666;
  font-size: 0.9em;
}

.form-footer a {
  color: #c66b2a;
}

/* Price Summary */
.price-summary {
  background: linear-gradient(135deg, #c66b2a 0%, #a85520 100%);
  color: white;
  position: sticky;
  bottom: 20px;
  z-index: 100;
}

.price-summary h2 {
  color: white;
  border-bottom-color: rgba(255,255,255,0.2);
}

.summary-line {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.summary-line.credit {
  color: #90EE90;
}

.summary-line.total {
  font-size: 1.3em;
  font-weight: 700;
  border-bottom: none;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 2px solid rgba(255,255,255,0.3);
}

.price-summary .note {
  margin-top: 12px;
  font-size: 0.85em;
  opacity: 0.85;
  text-align: center;
  font-style: italic;
}

/* Form Actions */
.form-actions {
  margin-top: 24px;
  text-align: center;
}

#submitBtn {
  padding: 16px 48px;
  font-size: 1.2em;
  font-weight: 600;
  background: linear-gradient(135deg, #e8833a 0%, #c66b2a 100%);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

#submitBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(200, 107, 42, 0.4);
}

#submitBtn:disabled {
  background: #ccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Status Messages */
.status-message {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  text-align: center;
  display: none;
}

.status-message.success {
  display: block;
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-message.error {
  display: block;
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.status-message.loading {
  display: block;
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeeba;
}

.status-message.info {
  display: block;
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* Responsive */
@media (max-width: 600px) {
  .container {
    padding: 12px;
  }

  header {
    padding: 30px 16px;
  }

  header h1 {
    font-size: 1.6em;
  }

  .form-section {
    padding: 16px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .radio-group.horizontal {
    flex-direction: column;
  }

  .code-input-group {
    flex-direction: column;
    align-items: center;
  }

  .code-input-group input,
  .code-input-group button {
    width: 100%;
    max-width: 250px;
  }

  .share-option {
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto auto;
  }

  .share-price {
    grid-column: 2;
    grid-row: 3;
    text-align: left;
    margin-top: 4px;
  }

  .price-summary {
    position: relative;
    bottom: auto;
  }
}
