/* ============================================================
   GIFT A TREE PAGE — STYLES
   Extends the main site design system from ../style.css
   ============================================================ */

/* Inherit Page Hero styles directly from ../donate/donate.css */

/* Main Section Layout */
.gift-section {
  background-color: #F4F6F4;
  padding: 80px 0;
}

.gift-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 48px;
  align-items: start;
}

/* Form container */
.gift-form-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(8, 75, 23, 0.06);
  padding: 36px;
}

.gift-card-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 24px;
}

.form-subheader {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin: 28px 0 16px;
  border-bottom: 1px solid rgba(8, 75, 23, 0.08);
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-subheader i {
  font-size: 1.2rem;
  color: var(--primary-accent);
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

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

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

.w-100 {
  width: 100%;
}

/* Input Styles Overrides */
.light-input {
  background-color: #ffffff;
  border: 1.5px solid #d0d8d0;
  color: var(--text-dark);
}

.light-input:focus {
  background-color: #ffffff;
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 4px rgba(74, 155, 95, 0.15);
}

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

/* Species selection cards */
.species-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.species-card {
  background-color: #ffffff;
  border: 1.5px solid #d0d8d0;
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
}

.species-card:hover {
  border-color: var(--primary-accent);
  background-color: rgba(74, 155, 95, 0.02);
}

.species-card.active {
  background-color: var(--accent-light);
  border-color: var(--primary-accent);
  box-shadow: 0 0 0 4px rgba(74, 155, 95, 0.08);
}

.species-card h4 {
  font-size: 1rem;
  color: var(--primary-dark);
  margin-bottom: 2px;
  font-weight: 600;
}

.species-card .sci-name {
  display: block;
  font-size: 0.75rem;
  font-style: italic;
  color: #6a8c71;
  margin-bottom: 8px;
}

.species-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.species-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--primary-dark);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  opacity: 0;
  transform: scale(0.6);
  transition: var(--transition-fast);
}

.species-card.active .species-check {
  opacity: 1;
  transform: scale(1);
}

/* Quantity selector */
.quantity-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.qty-btn {
  background-color: #ffffff;
  border: 1.5px solid #d0d8d0;
  border-radius: var(--radius-md);
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.qty-btn:hover {
  border-color: var(--primary-accent);
}

.qty-btn.active {
  background-color: var(--accent-light);
  border-color: var(--primary-accent);
}

.qty-num {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-dark);
}

.qty-price {
  font-size: 0.75rem;
  color: #6a8c71;
  margin-top: 2px;
}

.custom-qty-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
}

.custom-qty-input {
  width: 100%;
  background-color: #ffffff;
  border: 1.5px solid #d0d8d0;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary-dark);
  outline: none;
  text-align: center;
  transition: var(--transition-smooth);
}

.custom-qty-input:focus {
  border-color: var(--primary-accent);
}

.custom-qty-price {
  font-size: 0.7rem;
  color: #6a8c71;
  text-align: center;
  margin-top: 4px;
}

/* Price banner */
.gift-total-banner {
  background-color: var(--primary-dark);
  color: var(--text-light);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 28px 0 20px;
  font-weight: 600;
}

.gift-total-banner span:first-child {
  font-size: 0.95rem;
  opacity: 0.9;
}

.total-price {
  font-size: 1.35rem;
  font-weight: 700;
}

/* Gifting certificate preview */
.gift-preview-container {
  position: sticky;
  top: 100px;
}

.preview-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #ffffff;
  padding: 12px 24px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  border: 1px solid rgba(8, 75, 23, 0.08);
  border-bottom: none;
}

.header-indicator {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 6px;
}

.instructions-badge {
  font-size: 0.75rem;
  background-color: var(--accent-light);
  color: var(--primary-dark);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

/* The actual certificate layout */
.cert-outer-border {
  background-color: #FCFDFB;
  border: 18px solid #04270B; /* Deep dark border */
  padding: 24px;
  box-shadow: var(--shadow-md);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  position: relative;
  z-index: 10;
  aspect-ratio: 1.414 / 1; /* Standard A4 landscape ratio */
  width: 100%;
}

.cert-inner-border {
  border: 2px solid #D5AF5C; /* Elegant Gold thin border */
  height: 100%;
  padding: 32px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Decorative leaf corners */
.cert-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 3.5px solid #D5AF5C;
  z-index: 15;
}

.cert-corner.tl { top: -2px; left: -2px; border-right: none; border-bottom: none; }
.cert-corner.tr { top: -2px; right: -2px; border-left: none; border-bottom: none; }
.cert-corner.bl { bottom: -2px; left: -2px; border-right: none; border-top: none; }
.cert-corner.br { bottom: -2px; right: -2px; border-left: none; border-top: none; }

.cert-body {
  text-align: center;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Certificate Header Details */
.cert-logo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.cert-logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.cert-ngo-details {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #6a8c71;
}

.cert-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #04270B;
  letter-spacing: 1px;
  margin: 8px 0 2px;
}

.cert-intro {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #6a8c71;
  font-weight: 500;
}

/* Recipient large script */
.cert-recipient {
  font-family: 'Great Vibes', cursive;
  font-size: 2.8rem;
  color: #D5AF5C; /* Gold */
  line-height: 1;
  margin: 8px 0;
  letter-spacing: 1.5px;
  word-break: break-all;
}

.cert-cause {
  font-size: 0.8rem;
  color: var(--text-dark);
  line-height: 1.5;
  margin-bottom: 12px;
  font-weight: 500;
}

.cert-highlight-accent {
  font-weight: 600;
  color: var(--primary-dark);
}

/* Tree Specs Details Row */
.cert-tree-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(8, 75, 23, 0.08);
  border-bottom: 1px solid rgba(8, 75, 23, 0.08);
  padding: 10px 0;
  margin-bottom: 12px;
}

.cert-detail-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cert-detail-item:not(:last-child) {
  border-right: 1px solid rgba(8, 75, 23, 0.08);
}

.detail-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #6a8c71;
  font-weight: 600;
}

.detail-val {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-dark);
}

/* Personal Quote box */
.cert-message-box {
  background-color: rgba(213, 175, 92, 0.04);
  border-radius: var(--radius-sm);
  padding: 10px 24px;
  margin-bottom: 16px;
  position: relative;
  display: inline-block;
  margin-left: auto;
  margin-right: auto;
  max-width: 90%;
}

.cert-message-box p {
  font-size: 0.78rem;
  font-style: italic;
  line-height: 1.4;
  color: #4a5c4e;
}

.msg-quote-icon {
  font-size: 1.6rem;
  font-family: serif;
  color: rgba(213, 175, 92, 0.3);
  position: absolute;
  line-height: 1;
}

.msg-quote-icon:first-child { top: -2px; left: 8px; }
.msg-quote-icon:last-child { bottom: -14px; right: 8px; }

/* Signature and seal footer */
.cert-signature-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 10px;
}

.cert-signature-item {
  width: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.giver-name {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary-dark);
  font-style: italic;
  max-height: 24px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.director-signature {
  font-family: 'Great Vibes', cursive;
  font-size: 1.5rem;
  color: var(--primary-dark);
  line-height: 1;
}

.signature-line {
  width: 100%;
  height: 1px;
  background-color: #6a8c71;
  margin: 4px 0;
}

.signature-title {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #6a8c71;
  font-weight: 600;
}

/* Gold Seal element */
.cert-gold-seal {
  width: 56px;
  height: 56px;
  background: radial-gradient(circle, #f3d489 0%, #d5af5c 100%);
  border-radius: 50%;
  border: 1px dashed #937128;
  box-shadow: 0 2px 8px rgba(213, 175, 92, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  transform: translateY(4px);
}

.gold-seal-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #4c370a;
}

.gold-seal-inner i {
  font-size: 1.1rem;
}

.seal-text {
  font-size: 0.28rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.cert-download-strip {
  margin-top: 14px;
  background-color: #f1f8f3;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  color: #3b744b;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(74, 155, 95, 0.15);
}

/* Success Download Card inside portal */
.mock-download-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--accent-light);
  border: 1px solid rgba(74, 155, 95, 0.25);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin: 20px 0;
  text-align: left;
}

.download-info {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--primary-dark);
}

.download-info i {
  font-size: 2.2rem;
}

.download-info div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.download-info strong {
  font-size: 0.9rem;
  font-weight: 600;
}

.download-info span {
  font-size: 0.75rem;
  opacity: 0.8;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.modal-success-actions {
  display: flex;
  gap: 12px;
}

/* Gateway overlay styling */
.gateway-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.gateway-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.gateway-box {
  background: #ffffff;
  padding: 36px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  text-align: center;
  max-width: 440px;
  width: 100%;
  animation: scaleUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes scaleUp {
  from { transform: scale(0.9); }
  to { transform: scale(1); }
}

.gateway-loader {
  width: 48px;
  height: 48px;
  border: 4px solid var(--accent-light);
  border-top: 4px solid var(--primary-dark);
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.gateway-status {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 6px;
}

.gateway-message {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Success Card details */
.success-tick-animation {
  color: #3b744b;
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 12px;
  animation: popTick 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popTick {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.gateway-success-summary {
  font-size: 0.95rem;
  margin: 16px 0 8px;
  color: var(--text-dark);
  line-height: 1.5;
}

.text-green {
  color: #127230 !important;
}

.ref-email {
  font-weight: 600;
  color: var(--primary-dark);
}

.success-box .btn {
  width: 100%;
}

/* Responsive Overrides */
@media (max-width: 1024px) {
  .gift-grid {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .gift-preview-container {
    position: static;
  }
}

@media (max-width: 768px) {
  .gift-section {
    padding: 50px 0 60px;
  }
  .gift-form-card {
    padding: 24px 20px;
  }
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .species-grid {
    grid-template-columns: 1fr;
  }
  .quantity-picker-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .custom-qty-wrapper {
    grid-column: span 2;
  }
  .cert-outer-border {
    padding: 12px;
    border-width: 10px;
  }
  .cert-inner-border {
    padding: 16px;
  }
  .cert-title {
    font-size: 1.5rem;
  }
  .cert-recipient {
    font-size: 2rem;
  }
  .cert-tree-details {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px 0;
  }
  .cert-detail-item:not(:last-child) {
    border-right: none;
    border-bottom: 1px solid rgba(8, 75, 23, 0.08);
    padding-bottom: 6px;
  }
  .cert-signature-row {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  .cert-signature-item {
    width: 100%;
  }
  .cert-gold-seal {
    transform: none;
  }
}

/* Quantity Presets Button Layout overrides */
.qty-presets-layout .amount-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
  padding: 12px 8px;
}
.qty-presets-layout .preset-qty {
  font-size: 1.1rem;
  font-weight: 700;
  display: block;
}
.qty-presets-layout .preset-subtext {
  font-size: 0.85rem;
  opacity: 0.85;
  display: block;
  margin-top: 4px;
}
