.section {
  padding-block: 5rem;
}

.section.alt {
  background: hsl(var(--card));
}

.section-title {
  margin-bottom: 3rem;
  text-align: center;
}

.section-title h1,
.section-title h2 {
  margin: 0 0 0.75rem;
  color: hsl(var(--foreground));
  font-size: clamp(1.7rem, 4vw, 2.25rem);
  line-height: 1.25;
}

.section-title p {
  max-width: 34rem;
  margin: 0 auto;
  color: hsl(var(--muted-foreground));
  font-size: 0.95rem;
  line-height: 1.8;
}

.section-title::after {
  content: "";
  display: block;
  width: 4rem;
  height: 2px;
  margin: 1rem auto 0;
  border-radius: 999px;
  background: hsl(var(--primary));
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    border-color 220ms ease,
    color 220ms ease,
    background 220ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.button-primary:hover {
  opacity: 0.9;
}

.button-outline {
  border: 1px solid hsl(var(--border) / 0.55);
  background: transparent;
  color: hsl(var(--foreground));
}

.button-outline:hover {
  border-color: hsl(var(--primary) / 0.55);
  color: hsl(var(--primary));
}

.card {
  overflow: hidden;
  border: 1px solid hsl(var(--border) / 0.3);
  border-radius: 1rem;
  background: hsl(var(--card));
  transition:
    border-color 300ms ease,
    box-shadow 300ms ease,
    transform 300ms ease;
}

.card:hover {
  border-color: hsl(var(--primary) / 0.25);
  box-shadow: 0 18px 55px hsl(var(--primary) / 0.06);
}

.image-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  background: hsl(var(--muted));
}

.image-card img,
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms ease;
}

.image-card:hover img,
.card:hover .card-media img,
.gallery-item:hover img {
  transform: scale(1.06);
}

.card-media {
  position: relative;
  height: 12rem;
  overflow: hidden;
}

.card-body {
  padding: 1.25rem;
}

.card-body h3 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  transition: color 220ms ease;
}

.card:hover .card-body h3 {
  color: hsl(var(--primary));
}

.card-body p {
  margin: 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.82rem;
  line-height: 1.8;
}

.event-description-preview {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.78rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  color: white;
  font-family: var(--font-poppins);
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-upcoming {
  background: hsl(142 71% 45% / 0.9);
}

.badge-ongoing {
  background: hsl(25 95% 53% / 0.9);
}

.badge-finished {
  background: hsl(0 84% 60% / 0.9);
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2,
.grid-3,
.grid-4,
.grid-5 {
  grid-template-columns: 1fr;
}

.form-card {
  border: 1px solid hsl(var(--border) / 0.3);
  border-radius: 1.25rem;
  background: hsl(var(--card));
  padding: clamp(1.25rem, 4vw, 2rem);
  box-shadow: 0 22px 60px hsl(0 0% 0% / 0.18);
}

.field,
.textarea,
.amount-input {
  width: 100%;
  border: 1px solid hsl(var(--border) / 0.5);
  border-radius: 0.85rem;
  background: hsl(var(--background));
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  outline: none;
  transition:
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.textarea {
  min-height: 8.5rem;
  resize: vertical;
}

.field:focus,
.textarea:focus,
.amount-input:focus {
  border-color: hsl(var(--primary) / 0.55);
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.08);
}

/* RTL / LTR form fields */
body[dir="rtl"] .field,
body[dir="rtl"] .textarea {
  direction: rtl;
  text-align: right;
}

body[dir="ltr"] .field,
body[dir="ltr"] .textarea {
  direction: ltr;
  text-align: left;
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap svg {
  position: absolute;
  inset-inline-start: 0.9rem;
  top: 50%;
  color: hsl(var(--muted-foreground));
  transform: translateY(-50%);
}

.input-icon-wrap .field {
  padding-inline-start: 2.65rem;
}

.input-icon-wrap.has-password-toggle .field {
  padding-inline-end: 2.65rem;
}

.password-toggle {
  position: absolute;
  inset-inline-end: 0.65rem;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: hsl(var(--muted-foreground));
  padding: 0;
  transform: translateY(-50%);
  transition:
    color 220ms ease,
    background 220ms ease;
}

.password-toggle:hover,
.password-toggle:focus-visible {
  background: hsl(var(--muted) / 0.28);
  color: hsl(var(--foreground));
}

.password-toggle svg {
  position: static;
  color: currentColor;
  transform: none;
}

.form-stack {
  display: grid;
  gap: 1rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.88rem;
  line-height: 1.5;
}

.checkbox-row input {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  accent-color: hsl(var(--primary));
}

.checkbox-row input:focus-visible {
  outline: 2px solid hsl(var(--primary));
  outline-offset: 2px;
}

.checkbox-row a {
  color: hsl(var(--primary));
  font-weight: 600;
  transition:
    color 220ms ease,
    opacity 220ms ease;
}

.checkbox-row a:hover {
  opacity: 0.8;
}

.login-options-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.82rem;
  line-height: 1.5;
}

.remember-check {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.remember-check input {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  accent-color: hsl(var(--primary));
}

.forgot-password-link {
  color: hsl(var(--primary));
  font-weight: 600;
  transition:
    color 220ms ease,
    opacity 220ms ease;
}

.forgot-password-link:hover {
  opacity: 0.8;
}

.auth-switch {
  margin: 0;
  color: hsl(var(--muted-foreground));
  font-size: 0.82rem;
  line-height: 1.6;
  text-align: center;
}

.auth-switch a {
  color: hsl(var(--primary));
  font-weight: 600;
  transition:
    color 220ms ease,
    opacity 220ms ease;
}

.auth-switch a:hover {
  opacity: 0.8;
}

.form-message {
  min-height: 1.25rem;
  margin: 0;
  color: hsl(var(--primary));
  font-size: 0.8rem;
}

.map-frame {
  overflow: hidden;
  height: 13rem;
  border: 1px solid hsl(var(--border) / 0.3);
  border-radius: 1rem;
}

.map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  filter: grayscale(0.5) brightness(0.8);
}

.tab-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}

.tab-button,
.amount-button {
  border: 1px solid hsl(var(--border) / 0.5);
  border-radius: 999px;
  background: transparent;
  color: hsl(var(--muted-foreground));
  padding: 0.65rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  transition:
    background 220ms ease,
    border-color 220ms ease,
    color 220ms ease;
}

.tab-button:hover,
.amount-button:hover {
  border-color: hsl(var(--primary) / 0.35);
  color: hsl(var(--foreground));
}

.tab-button.is-active,
.amount-button.is-active {
  border-color: hsl(var(--primary));
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
}

.amount-button {
  border-radius: 0.85rem;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
}

.amount-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0 1rem;
  color: hsl(var(--muted-foreground));
  font-size: 0.75rem;
}

.divider::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  height: 1px;
  background: hsl(var(--border) / 0.35);
}

.divider span {
  position: relative;
  padding-inline: 0.75rem;
  background: hsl(var(--card));
}

@media (min-width: 640px) {
  .grid-4,
  .grid-5 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .section {
    padding-block: 6rem;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .grid-5 {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
