/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;700&display=swap');

/* --------- Base / Reset --------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  font-family: 'Poppins', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: #000; /* default text color for non-hero pages */
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------- Hero --------- */
.hero {
  position: relative;
  /* svh avoids the URL bar jump on mobile */
  min-height: 100svh;
  height: 100svh;
  overflow: hidden;
  background: linear-gradient(to bottom, #f9d423, #ff4e50);
  /* iOS safe areas */
  padding-top: max(0px, env(safe-area-inset-top));
  padding-right: max(0px, env(safe-area-inset-right));
  padding-bottom: max(0px, env(safe-area-inset-bottom));
  padding-left: max(0px, env(safe-area-inset-left));
}

/* Login button (top-right) */
.login-link {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(36px, 6vw, 44px);
  height: clamp(36px, 6vw, 44px);
  border-radius: 999px;
  background: rgba(255,255,255,0.6);
  backdrop-filter: saturate(140%) blur(4px);
}
.login-link:focus-visible {
  outline: 3px solid #000;
  outline-offset: 3px;
}

.login-icon {
  width: 70%;
  height: 70%;
  object-fit: contain;
  pointer-events: none;
}

/* Slideshow */
.slideshow {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.slideshow img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  opacity: 0;
  transition: opacity 800ms ease-in-out;
}
.slideshow img.active {
  opacity: 1;
}

/* Slight overlay gradient to help text contrast on bright photos */
.slideshow::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.25), rgba(0,0,0,0.15));
  z-index: 1;
}

/* Overlay */
.overlay {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 5vw, 40px);
  height: 100%;
  text-align: center;
  color: #fff;
  padding: 16px;
}

/* Left Content (Text + Buttons) */
.content {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* cap width so long words don't stretch too much on large screens */
  max-width: min(92vw, 900px);
}

h1 {
  /* scales from phones to desktops */
  font-size: clamp(2rem, 6vw, 4.3rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

h2 {
  font-size: clamp(1.4rem, 5.5vw, 3rem);
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: clamp(14px, 4vw, 30px);
}

/* Buttons */
.buttons {
  display: flex;
  flex-wrap: wrap;            /* allow wrapping on small screens */
  justify-content: center;
  gap: clamp(10px, 2.6vw, 20px);
  margin-top: clamp(12px, 3vw, 30px);
  max-width: min(92vw, 900px);
}

.btn {
  text-decoration: none;
  padding: clamp(10px, 2.6vw, 14px) clamp(22px, 5vw, 50px);
  border-radius: 40px;
  background: #f4c542;
  color: #000;
  font-weight: 500;
  font-size: clamp(0.95rem, 2.6vw, 1.1rem);
  transition: transform 0.15s ease, background 0.3s ease, color 0.3s ease;
  line-height: 1;
}
.btn:hover {
  background: #fff;
  color: #000;
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn:focus-visible {
  outline: 3px solid #000;
  outline-offset: 3px;
}

/* Logo */
.logo {
  width: clamp(180px, 32vw, 550px);
  height: auto;
  filter: drop-shadow(0 6px 16px rgba(0,0,0,0.25));
  user-select: none;
  pointer-events: none;
}

/* --------- Auth pages (login) --------- */
.auth-page {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(to bottom, #f9d423, #ff4e50);
  position: relative;
}

.auth-back {
  position: absolute;
  top: 16px;
  left: 16px;
  text-decoration: none;
  color: #000;
  font-weight: 600;
  background: rgba(255,255,255,0.7);
  padding: 8px 12px;
  border-radius: 999px;
}
.auth-back:focus-visible {
  outline: 3px solid #000;
  outline-offset: 3px;
}

.auth-card {
  width: min(100%, 420px);
  background: rgba(255, 255, 255, 0.94);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  text-align: left;
}

.auth-card h1 {
  font-size: clamp(1.35rem, 3.2vw, 1.8rem);
  margin-bottom: 6px;
  color: #000;
}

.auth-sub {
  color: #333;
  margin-bottom: 18px;
  font-size: clamp(0.95rem, 2.6vw, 1rem);
}

.auth-label {
  display: block;
  font-size: clamp(0.9rem, 2.6vw, 0.95rem);
  margin-bottom: 6px;
  color: #000;
}

.auth-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #ddd;
  outline: none;
  margin-bottom: 14px;
  background: #fff;
  color: #000;
  font-size: 1rem;
}

.auth-input:focus {
  border-color: #f4c542;
  box-shadow: 0 0 0 3px rgba(244, 197, 66, 0.25);
}

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 16px;
  flex-wrap: wrap;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #000;
}

.auth-link {
  color: #000;
  text-decoration: underline;
}

.auth-btn {
  width: 100%;
  border-radius: 40px;
  background: #f4c542;
  color: #000;
  font-weight: 600;
  padding: 12px 16px;
  border: none;
  cursor: pointer;
}

/* --------- Responsive Layout Tweaks --------- */

/* Stack content and logo vertically on tablets/phones */
@media (max-width: 1024px) {
  .overlay {
    flex-direction: column; /* stack */
  }
}

/* Phone-sized adjustments */
@media (max-width: 640px) {
  .login-link {
    top: 12px;
    right: 12px;
  }

  /* Reduce slideshow overlay so text is clearer on smaller screens */
  .slideshow::after {
    background: linear-gradient(to bottom, rgba(0,0,0,0.35), rgba(0,0,0,0.2));
  }

  /* Tighten gaps a bit */
  .overlay {
    gap: 18px;
    padding: 18px 14px 24px;
  }

  .buttons {
    /* Make buttons take two per row if space allows, otherwise full width */
    max-width: 520px;
  }
  .btn {
    flex: 1 1 auto;
    min-width: 44%;    /* 2 per row when possible */
    text-align: center;
  }

  /* Prevent super tall hero from being cut in landscape */
  @media (orientation: landscape) {
    .hero {
      min-height: 100vh; /* fall back to vh so content fits */
      height: auto;
    }
  }
}

/* Very small devices */
@media (max-width: 360px) {
  .btn {
    min-width: 100%;
  }
}
