/* =====================================================================
   Gigto: Group Buying - Stylesheet
   Andhra Agricultural Palette:
     - Emerald Green: #059669 / Deep Green: #1B5E20
     - Golden Harvest Amber: #d97706 / #f59e0b
     - Soft Green Surface: #F1F8E9 / #E8F5E9
   ===================================================================== */

:root {
  --primary-green: #059669;
  --primary-dark: #1B5E20;
  --primary-hover: #047857;
  --harvest-amber: #d97706;
  --amber-light: #f59e0b;
  --amber-dark: #b45309;
  --surface-soft: #F1F8E9;
  --surface-mint: #E8F5E9;
  --surface-cream: #FFFDF7;
  --bg-page: #F8FAF7;
  --bg-card: #FFFFFF;
  --text-main: #0F172A;
  --text-body: #334155;
  --text-muted: #64748B;
  --border-light: #E2E8F0;
  --border-green: #A7F3D0;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-page);
  color: var(--text-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary-green);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-dark);
}

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

/* ─────────────────────────────────────────────────────────────────
   1. NAVIGATION HEADER
   ───────────────────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 44px;
  width: 44px;
  border-radius: 11px;
  display: block;
}

.brand-name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--primary-dark);
  letter-spacing: -0.5px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
}

.nav-link {
  font-weight: 500;
  color: var(--text-body);
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--primary-green);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

/* ─────────────────────────────────────────────────────────────────
   BUTTONS & BADGES
   ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 22px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary-green);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.25);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  color: #ffffff;
  box-shadow: 0 4px 8px rgba(5, 150, 105, 0.35);
  transform: translateY(-1px);
}

.btn-amber {
  background-color: var(--harvest-amber);
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(217, 119, 6, 0.25);
}

.btn-amber:hover {
  background-color: var(--amber-dark);
  color: #ffffff;
  transform: translateY(-1px);
}

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

.btn-outline:hover {
  background-color: var(--surface-mint);
  color: var(--primary-dark);
}

.btn-download-app {
  background: #000000;
  color: #ffffff;
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #27272a;
}

.btn-download-app:hover {
  background: #18181b;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-download-app .play-icon {
  width: 22px;
  height: 22px;
}

.badge-tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: var(--radius-full);
}

.badge-green {
  background-color: var(--surface-mint);
  color: var(--primary-dark);
  border: 1px solid var(--border-green);
}

.badge-amber {
  background-color: #FEF3C7;
  color: var(--amber-dark);
  border: 1px solid #FCD34D;
}

/* ─────────────────────────────────────────────────────────────────
   2. HERO SECTION
   ───────────────────────────────────────────────────────────────── */
.hero-section {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #F1F8E9 0%, #FFFFFF 45%, #E8F5E9 100%);
  padding: 64px 0 72px;
  border-bottom: 1px solid var(--border-light);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.hero-location-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: #ffffff;
  border: 1px solid var(--border-green);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  width: fit-content;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.hero-title .highlight-amber {
  color: var(--harvest-amber);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-body);
  line-height: 1.6;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.hero-cta-group .btn-download-app {
  padding: 12px 24px;
  font-size: 1.05rem;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
  padding-top: 24px;
  border-top: 1px solid rgba(5, 150, 105, 0.15);
}

.metric-item {
  display: flex;
  flex-direction: column;
}

.metric-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-dark);
}

.metric-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Hero Right Card / QR showcase */
.hero-card-showcase {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-green);
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}

.qr-box {
  display: flex;
  align-items: center;
  gap: 20px;
  background-color: var(--surface-soft);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px dashed var(--primary-green);
}

.qr-image {
  width: 100px;
  height: 100px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 4px;
  box-shadow: var(--shadow-sm);
}

.qr-text h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 4px;
}

.qr-text p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.commodity-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.commodity-chip {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-body);
}

/* ─────────────────────────────────────────────────────────────────
   3. VALUE PROPOSITION & HOW IT WORKS
   ───────────────────────────────────────────────────────────────── */
.section {
  padding: 72px 0;
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 48px;
}

.section-header .section-tag {
  color: var(--primary-green);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: block;
}

.section-header .section-title {
  font-size: 2.1rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.section-header .section-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.feature-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-light);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-green);
}

.feature-icon-wrapper {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
}

.icon-emerald {
  background: var(--surface-mint);
  color: var(--primary-dark);
}

.icon-amber {
  background: #FEF3C7;
  color: var(--amber-dark);
}

.icon-blue {
  background: #E0F2FE;
  color: #0369A1;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.feature-desc {
  font-size: 0.95rem;
  color: var(--text-body);
  line-height: 1.55;
}

/* ─────────────────────────────────────────────────────────────────
   4. ROLE REGISTRATION PORTAL SECTION
   ───────────────────────────────────────────────────────────────── */
.registration-section {
  background: linear-gradient(180deg, #F8FAF7 0%, #F1F8E9 100%);
  padding: 80px 0 96px;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.portal-wrapper {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-green);
  overflow: hidden;
  max-width: 900px;
  margin: 0 auto;
}

/* Role Selector Tabs */
.role-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface-soft);
  border-bottom: 2px solid var(--border-green);
}

.role-tab-btn {
  background: transparent;
  border: none;
  padding: 20px 16px;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.25s ease;
  position: relative;
  font-family: inherit;
}

.role-tab-btn:hover {
  background: rgba(255, 255, 255, 0.6);
}

.role-tab-btn.active {
  background: var(--bg-card);
  color: var(--primary-dark);
}

.role-tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background-color: var(--primary-green);
}

.tab-icon {
  font-size: 1.5rem;
}

.tab-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.tab-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Forms Container */
.forms-container {
  padding: 40px;
}

.form-role-container {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.form-role-container.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-header {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-light);
}

.form-header h3 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 6px;
}

.form-header p {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.status-callout {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-callout.pending {
  background: #FFFBEB;
  border-left: 4px solid var(--harvest-amber);
  color: #92400E;
}

.status-callout.active-instant {
  background: var(--surface-mint);
  border-left: 4px solid var(--primary-green);
  color: var(--primary-dark);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: span 2;
}

.form-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
}

.form-label .required {
  color: #DC2626;
  margin-left: 2px;
}

.form-control {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 12px 14px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-main);
  background-color: #ffffff;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.form-control.error {
  border-color: #DC2626;
  background-color: #FEF2F2;
}

.error-text {
  font-size: 0.8rem;
  color: #DC2626;
  display: none;
}

.error-text.visible {
  display: block;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Radio Cards (e.g., Vehicle selection, Language selection) */
.radio-cards-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.radio-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  cursor: pointer;
  background: #ffffff;
  transition: all 0.2s ease;
}

.radio-card:hover {
  border-color: var(--border-green);
  background: var(--surface-soft);
}

.radio-card input[type="radio"] {
  accent-color: var(--primary-green);
  width: 18px;
  height: 18px;
}

.radio-card-content {
  display: flex;
  flex-direction: column;
}

.radio-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
}

.radio-card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.radio-card input[type="radio"]:checked + .radio-card-content .radio-card-title {
  color: var(--primary-dark);
}

/* Commodity Checkboxes */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.checkbox-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #ffffff;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

.checkbox-card:hover {
  background: var(--surface-soft);
}

.checkbox-card input[type="checkbox"] {
  accent-color: var(--primary-green);
  width: 16px;
  height: 16px;
}

.form-actions {
  margin-top: 32px;
  display: flex;
  justify-content: flex-end;
}

.form-actions .btn {
  padding: 14px 32px;
  font-size: 1.05rem;
}

/* ─────────────────────────────────────────────────────────────────
   5. LOADING SPINNER & FEEDBACK MODAL
   ───────────────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.2s ease-out;
}

.modal-box {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  padding: 36px 32px;
  box-shadow: var(--shadow-xl);
  text-align: center;
  position: relative;
}

.modal-icon-circle {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.25rem;
}

.modal-icon-circle.success {
  background: var(--surface-mint);
  color: var(--primary-green);
  border: 2px solid var(--border-green);
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 10px;
}

.modal-message {
  font-size: 0.95rem;
  color: var(--text-body);
  margin-bottom: 24px;
  line-height: 1.55;
}

.modal-details-card {
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 24px;
  text-align: left;
  border: 1px solid var(--border-green);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.88rem;
  border-bottom: 1px dashed rgba(5, 150, 105, 0.2);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row .label {
  color: var(--text-muted);
}

.detail-row .value {
  font-weight: 700;
  color: var(--primary-dark);
}

.modal-btn-close {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
}

/* ─────────────────────────────────────────────────────────────────
   6. FOOTER
   ───────────────────────────────────────────────────────────────── */
.footer {
  background: #0F172A;
  color: #94A3B8;
  padding: 64px 0 32px;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand h4 {
  color: #ffffff;
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.footer-brand p {
  color: #94A3B8;
  line-height: 1.6;
  margin-bottom: 16px;
}

.footer-column h5 {
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}

.footer-column ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-column a {
  color: #94A3B8;
  transition: color 0.2s;
}

.footer-column a:hover {
  color: #34D399;
}

.footer-bottom {
  border-top: 1px solid #1E293B;
  padding-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

/* ─────────────────────────────────────────────────────────────────
   7. RESPONSIVE DESIGN (Mobile First Adjustments)
   ───────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .hero-title {
    font-size: 2.2rem;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .role-tabs {
    grid-template-columns: 1fr;
  }

  .role-tab-btn.active::after {
    left: 0;
    right: auto;
    top: 0;
    bottom: 0;
    width: 4px;
    height: 100%;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form-group.full-width {
    grid-column: span 1;
  }

  .checkbox-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .navbar {
    height: 64px;
  }

  .nav-menu {
    display: none;
  }

  .hero-title {
    font-size: 1.85rem;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .forms-container {
    padding: 24px 16px;
  }

  .radio-cards-group {
    grid-template-columns: 1fr;
  }

  .checkbox-grid {
    grid-template-columns: 1fr;
  }
}

/* Elements hidden by the script (Play Store buttons before launch) must really disappear */
[hidden] { display: none !important; }
