/* ===== Video Background ===== */
.video-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}

.video-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.28;
  filter: saturate(0.65) hue-rotate(15deg) brightness(0.45);
}

.video-bg-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(6, 16, 24, 0.75) 0%, rgba(6, 16, 24, 0.88) 45%, rgba(6, 16, 24, 0.97) 100%),
    radial-gradient(ellipse at 70% 40%, rgba(0, 212, 170, 0.06), transparent 55%);
}

/* ===== Hero 3D (behind hero content, right side only) ===== */
#hero-seaweed {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 55%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  opacity: 0.4;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 35%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 35%);
}

#hero-seaweed canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.hero > .container {
  position: relative;
  z-index: 2;
}

.hero-content {
  position: relative;
  z-index: 3;
  padding: 8px 12px 8px 0;
}

.seaweed-section {
  position: relative;
  z-index: 1;
  padding: 80px 0;
}

.seaweed-section > .container > [data-animate] {
  position: relative;
  z-index: 2;
}

.seaweed-viewer-wrap {
  position: relative;
  height: 520px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-glass);
  overflow: hidden;
  background: rgba(6, 16, 24, 0.6);
  backdrop-filter: blur(12px);
  isolation: isolate;
}

#seaweed-viewer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  z-index: 0;
}

#seaweed-viewer canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

#seaweed-viewer:active { cursor: grabbing; }

.seaweed-viewer-label {
  position: absolute;
  bottom: 24px;
  left: 24px;
  right: 24px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  pointer-events: none;
}

.seaweed-species {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  pointer-events: all;
}

.species-btn {
  padding: 8px 16px;
  background: rgba(6, 16, 24, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: 100px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
  font-family: var(--font-body);
}

.species-btn:hover,
.species-btn.active {
  border-color: var(--teal);
  color: var(--teal);
  background: rgba(0, 212, 170, 0.1);
}

.seaweed-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.8;
}

.seaweed-hint i { color: var(--teal); margin-right: 6px; }

/* ===== Forms ===== */
.cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
  text-align: left;
}

.cta-grid .cta-text h2 { text-align: left; }
.cta-grid .cta-text p { margin: 0 0 24px; max-width: none; text-align: left; }

.cta-benefits {
  list-style: none;
  margin-top: 24px;
}

.cta-benefits li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-glass);
}

.cta-benefits li i { color: var(--teal); }

.application-form {
  background: rgba(6, 16, 24, 0.5);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 32px;
  backdrop-filter: blur(16px);
}

.form-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 8px;
}

.form-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group.full { grid-column: 1 / -1; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-group label .req { color: var(--teal); }

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: rgba(0, 212, 170, 0.5);
  box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(139, 163, 181, 0.5);
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%238ba3b5' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-group select option {
  background: #0c1c2a;
  color: var(--text);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
  border-color: #f87171;
}

.form-error {
  font-size: 0.75rem;
  color: #f87171;
  margin-top: 4px;
  display: none;
}

.form-group.has-error .form-error { display: block; }

.form-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

.form-checkbox input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--teal);
  cursor: pointer;
  flex-shrink: 0;
}

.form-submit {
  width: 100%;
  justify-content: center;
}

.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.consent-error {
  font-size: 0.75rem;
  color: #f87171;
  margin: -12px 0 12px;
  display: none;
}

.form-checkbox.has-error + .consent-error { display: block; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(6, 16, 24, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 36px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  backdrop-filter: blur(20px);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s;
  position: relative;
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 1rem;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.modal-success {
  text-align: center;
  padding: 24px 0;
}

.modal-success .success-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: rgba(0, 212, 170, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--teal);
}

.modal-success h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.modal-success p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  padding: 16px 24px;
  background: var(--bg-card);
  border: 1px solid rgba(0, 212, 170, 0.3);
  border-radius: 12px;
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast i { color: var(--teal); font-size: 1.2rem; }

.btn-open-form { cursor: pointer; }

@media (max-width: 1100px) {
  .cta-grid { grid-template-columns: 1fr; }
  .cta-grid .cta-text h2,
  .cta-grid .cta-text p { text-align: center; }
  .cta-benefits { max-width: 400px; margin: 24px auto 0; }
}

@media (max-width: 768px) {
  .form-row { grid-template-columns: 1fr; }
  .seaweed-viewer-wrap { height: 380px; }
  .application-form { padding: 24px 20px; }
  .modal { padding: 28px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .video-bg video { display: none; }
}
