/* =============================================
   AgriGreenSkills - Home page styles
   =============================================
   Contains the public homepage layout: navigation, hero, steps,
   modules, community/resources blocks, footer, modal, and mobile menu.
*/
:root {
  --nav-bg: rgba(255, 255, 255, 0.82);
  --nav-border: rgba(34, 34, 34, 0.08);
  --text-primary: #222;
  --text-secondary: #555;
  --accent: #3a9e6e;
  --accent-light: rgba(58, 158, 110, 0.1);
}

a {
  color: #ed6d6a;
}

.btn-community-offset {
  margin-top: 16px;
}

.auth-banner.error {
  background: #fff0f0;
  color: #b83038;
  border: 1px solid #fccaca;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-auth-icon.is-hidden {
  display: none;
}

nav.scrolled {
  background: rgba(244, 243, 240, 0.88);
  box-shadow:
    0 4px 20px rgba(79, 110, 247, 0.1),
    0 2px 6px rgba(0, 0, 0, 0.06);
}

.nav-actions {
  border: none;
}

.btn-signup,
.btn-login {
  color: #ed6d6a;
  background: #ffffffa6;
}

.btn-signup:active {
  transform: translateY(0);
}

.img-placeholder {
  position: relative;
  overflow: hidden;
  background: #e2ece5;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
}

.img-placeholder img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-placeholder .ph-label {
  position: relative;
  z-index: 2;
  text-align: center;
  color: #6a9e7a;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
  line-height: 1.5;
}

.img-placeholder .ph-icon {
  font-size: 28px;
  opacity: 0.5;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 150px 40px 50px;
  gap: 32px;
  min-height: 750px;
  margin: auto;
  position: relative;

  overflow: hidden;
}

.hero-text {
  max-width: 400px;
  position: relative;

  z-index: 2;
}

.hero-text h1 {
  font-size: 38px;
  font-weight: normal;
  line-height: 1.15;
  color: #505050;
  margin-bottom: 75px;
}

.hero-text p {
  font-size: 17px;
  color: #555;
  line-height: 1.7;
  margin-bottom: 28px;
}

.hero-img {
  position: absolute;
  top: 10px;
  right: calc((100vw - 1200px) / 2);

  width: 35%;
  bottom: 0;
  border-radius: 35px;
  overflow: hidden;
  margin-bottom: 30px;
}

.btn-more {
  background: #d74750;
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
}

.btn-community {
  color: #343434;
  border: none;
  border-radius: 85px;
  padding: 10px 35px;
  font-size: 43px;
  font-weight: normal;
  cursor: pointer;
  transition:
    transform 0.15s,
    box-shadow 0.15s;
  background: #ffffff8c;
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
}

.btn-more:hover,
.btn-community:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 16px rgba(232, 93, 58, 0.35);
}

section.how {
  padding: 60px 40px 50px;
  background: #fff;
  text-align: center;
}

section.how h2 {
  font-size: 30px;
  font-weight: normal;
  margin-bottom: 40px;
}

.steps {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  max-width: 160px;
}

.step-icon {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  margin-bottom: 12px;
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.step-line {
  flex: 1;
  height: 2px;
  background: #d4eadc;
  position: relative;
  top: 36px;
  z-index: 1;
}

.step-num {
  font-size: 11px;
  color: #3a9e6e;
  font-weight: 700;
  margin-bottom: 4px;
}

.step p {
  font-size: 13px;
  font-weight: 700;
  color: #222;
  line-height: 1.4;
}

section.modules {
  padding: 60px 40px 50px;
}

section.modules h2 {
  font-size: 30px;
  font-weight: normal;
  margin-bottom: 24px;
  text-align: center;
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.tab {
  padding: 8px 20px;
  border-radius: 20px;
  border: 1.5px solid #ccc;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  background: #fff;
  color: #444;
  font-family: "Nunito", sans-serif;
  transition: all 0.2s;
}

.tab span {
  display: inline-block;
  margin-left: 6px;
  font-size: 11px;
  opacity: 0.78;
}

.tab.active {
  background: #e85d3a;
  color: #fff;
  border-color: #e85d3a;
}

.tab:hover:not(.active) {
  border-color: #3a9e6e;
  color: #3a9e6e;
}

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

.card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #eee;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
}

.card.is-completed {
  border-color: #cfe8d8;
}

.card-img-wrap {
  width: 100%;
  height: 315px;
}

.card-body {
  padding: 16px;
}

.card-body h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 8px;
  color: #1a1a1a;
}

.card-body p {
  font-size: 12px;
  color: #666;
  line-height: 1.6;
}

.card-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  background: #e8f5ed;
  color: #3a9e6e;
  border-radius: 8px;
  padding: 2px 8px;
  margin-bottom: 6px;
}

.lesson-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.lesson-card-meta .card-badge {
  margin-bottom: 0;
}

.lesson-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  color: #2a7a4b;
  background: #edf8f1;
  border-radius: 50%;
  font-size: 14px;
  font-weight: 800;
}

.lesson-status.completed {
  background: #3a9e6e;
  color: #fff;
  box-shadow: 0 6px 18px rgba(58, 158, 110, 0.28);
}

.module-block {
  border: 1px solid #eee;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 24px;
  background: #fff;
  transition: box-shadow 0.2s;
}

.module-block:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.07);
}

.module-thumb-wrap {
  width: 100%;
  height: 220px;
  overflow: hidden;
}

.module-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.module-info {
  padding: 20px 20px 12px;
}

.module-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  border-radius: 8px;
  padding: 3px 10px;
  margin-bottom: 8px;
}

.module-title {
  font-size: 18px;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.module-desc {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
}

.lessons-list {
  border-top: 1px solid #eee;
}

.lesson-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background 0.18s;
  text-decoration: none;
  color: #222;
}

.lesson-item:last-child {
  border-bottom: none;
}

.lesson-item:hover {
  background: #f9f9f6;
}

.lesson-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lesson-name {
  font-size: 14px;
  font-weight: 500;
  flex: 1;
}

.lesson-arrow {
  color: #aaa;
  font-size: 14px;
}

.auth-banner.warning {
  background: #fff8e1;
  color: #7a5800;
  border: 1px solid #ffe082;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-lesson {
  display: inline-block;
  margin-top: 12px;
  background: none;
  border: 1.5px solid #d74750;
  color: #d74750;
  border-radius: 20px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.2s,
    color 0.2s;
}

.btn-lesson:hover {
  background: #d74750;
  color: #fff;
}

.auth-banner.warning {
  background: #fff8e1;
  color: #7a5800;
  border: 1px solid #ffe082;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

section.community {
  margin: 90px 40px 40px;
  border-radius: 35px;
  overflow: hidden;
  min-height: 420px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.community-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.community-fallback {
  position: absolute;
  inset: 0;
  background: #c8e6d0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #4a8a5e;
  font-weight: 700;
}

.community-overlay {
  position: absolute;
  inset: 0;
}

.community-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.community-content h2 {
  font-size: 32px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

section.resources {
  padding: 40px;
  text-align: center;
}

.resources-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 40px;
  border-radius: 50px;
  font-size: 43px;
  font-weight: normal;
  color: #1a1a1a;
  margin-bottom: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition:
    box-shadow 0.2s,
    transform 0.15s;
  margin-top: 40px;
}

.resources-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("images/resources.jpg");
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.resources-pill::after {
  content: "";
  position: absolute;
  inset: 0;
  backdrop-filter: blur(4px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  z-index: 1;
}

.resources-pill span {
  position: relative;
  z-index: 2;
}

.resources-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.resources-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.resources-pill img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  border-radius: 30px;
}

.anim {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.5s ease,
    transform 0.5s ease;
}

.anim.visible {
  opacity: 1;
  transform: translateY(0);
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  width: 100%;
  max-width: 500px;
  border-radius: 24px;
  padding: 35px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  animation: modalShow 0.25s ease;
}

@keyframes modalShow {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-content h2 {
  margin-bottom: 25px;
  color: #333;
}

.close-modal {
  position: absolute;
  right: 20px;
  top: 15px;
  border: none;
  background: none;
  font-size: 28px;
  cursor: pointer;
  color: #888;
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 600;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 14px;
}

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

.btn-submit {
  width: 100%;
  border: none;
  padding: 14px;
  border-radius: 12px;
  background: #d74750;
  color: white;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
}

.btn-submit:hover {
  opacity: 0.9;
}

.switch-form {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
}

.switch-form a {
  cursor: pointer;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #444;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.nav-auth-icon {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #ed6d6a;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 8px;
  border-radius: 20px;
}

.nav-actions-mobile-sep {
  display: none;
  width: 100%;
  height: 1px;
  background: #eee;
  margin: 4px 0;
}

@media (max-width: 768px) {
  .navbar-wrapper {
    width: calc(100% - 24px);
    top: 10px;
  }

  nav {
    flex-wrap: wrap;
    padding: 0 16px;
    height: auto;
    min-height: 54px;
    border-radius: 20px;
    gap: 0;
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    padding: 10px 0 14px;
    gap: 2px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    width: 100%;
    padding: 10px 12px;
  }

  .nav-actions {
    display: none;
    width: 100%;
    padding: 0 0 14px;
    border: none !important;
    justify-content: flex-start;
    gap: 4px;
  }

  .nav-actions.open {
    display: flex;
  }

  .nav-actions.open span {
    display: inline;
  }

  .hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .hamburger.open span:nth-child(2) {
    opacity: 0;
  }

  .hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .nav-auth-icon {
    order: 3;
  }

  .nav-actions-mobile-sep {
    display: block;
  }

  .nav-actions.open {
    background: #f9f9f6;
    border-radius: 12px;
    padding: 10px 12px 14px;
    margin: 0 0 8px;
  }

  .logo {
    order: 1;
  }

  #navAuthBadge {
    order: 2;
    margin-left: auto;
  }

  .hamburger {
    order: 3;
    margin-left: 16px;
  }

  .nav-links {
    order: 4;
  }

  .nav-actions {
    order: 5;
  }
}
