/* ==========================================================================
   Index/Login Page - Responsive Overrides
   ========================================================================== */

/* CSS Variables */
:root {
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --touch-target-min: 44px;
}

/* Remove fixed width constraints - scoped to responsive class */
html.responsive {
  min-width: 0 !important;
}

/* Responsive background */
@media (max-width: 767px) {
  html.responsive {
    background-size: cover !important;
    background-position: center !important;
    min-width: 0 !important;
  }

  .responsive body {
    min-width: 0 !important;
  }
}

/* Page title - responsive */
.responsive h1 {
  min-width: 0 !important;
}

@media (max-width: 767px) {
  .responsive h1 {
    font-size: clamp(2rem, 8vw, 4.5rem) !important;
    min-width: 0 !important;
    padding: 0 var(--space-md);
    margin-top: var(--space-lg) !important;
    width: 100% !important;
  }
}

/* Flex container - stack on mobile */
.responsive .flex-container {
  max-width: 100%;
  padding: 0 var(--space-md);
}

@media (max-width: 767px) {
  .responsive .flex-container {
    padding: 0 var(--space-md);
  }

  .responsive .flex-wrapper {
    flex-direction: column;
  }

  .col {
    float: none !important;
    width: 100% !important;
    padding: var(--space-md);
  }

  .col-main {
    order: 2;
  }

  .col-complementary {
    order: 1;
  }
}

/* Form wrapper */
@media (max-width: 767px) {
  .wrapper {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* Form inputs - full width on mobile */
@media (max-width: 767px) {
  form,
  form.form {
    display: flex !important;
    flex-direction: column !important;
    gap: var(--space-sm);
    padding: var(--space-md) 0;
    width: 100% !important;
  }

  form input,
  form.form input {
    width: 100% !important;
    max-width: 100% !important;
    min-height: var(--touch-target-min);
    font-size: 16px !important; /* Prevent iOS zoom */
    display: block !important;
    margin-bottom: var(--space-sm);
    box-sizing: border-box !important;
  }

  form input:focus,
  form.form input:focus {
    width: 100% !important;
  }

  form button,
  form.form button,
  #login-button {
    width: 100% !important;
    min-height: var(--touch-target-min);
    display: block !important;
    margin: var(--space-sm) auto;
    box-sizing: border-box !important;
  }

  .bottom_button {
    width: 100% !important;
  }
}

/* h4 description text - fix contrast on light background */
@media (max-width: 767px) {
  h4 {
    width: 100% !important;
    font-size: 1.125rem !important;
    padding: 0 var(--space-sm);
    color: #333 !important; /* Dark text for readability on light background */
  }

  /* Remove background from full wrapper */
  .wrapper {
    background: transparent !important;
  }

  /* Blue background only around the login form */
  .col-complementary {
    background: rgba(59, 185, 255, 0.9) !important;
    border-radius: 8px;
    padding: var(--space-lg) !important;
    margin-bottom: 80px;
  }

  /* Ensure top section has enough height */
  .top-wrapper {
    min-height: auto !important;
    height: auto !important;
    padding-bottom: 100px;
  }

  /* Keep description text readable on cloud background */
  .col-main h4 {
    color: white !important;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
  }
}

/* Links - touch friendly */
@media (max-width: 767px) {
  center a,
  .col-complementary a {
    display: inline-block;
    padding: var(--space-sm) 0;
    min-height: var(--touch-target-min);
  }
}

/* Preview/slideshow section */
.preview-background {
  padding: var(--space-xl) var(--space-md);
}

@media (max-width: 767px) {
  .preview-background {
    padding: var(--space-lg) var(--space-sm);
    background-color: white !important;
  }

  /* Make text darker for better contrast */
  .preview-background .content p,
  .preview-background .guest_text p {
    color: #333 !important;
  }

  .preview-background h2 {
    color: #3BB9FF !important; /* Brand blue for headings */
  }

  #sky_background {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: var(--space-md) !important;
    padding-right: var(--space-md) !important;
  }
}

/* Slideshow container */
.slideshow-container {
  max-width: 100%;
  overflow: hidden;
}

@media (max-width: 767px) {
  .slideshow-container {
    display: flex;
    flex-direction: column;
    position: static !important;
    height: auto !important;
  }

  /* Remove absolute positioning from text */
  .text,
  .guest_text {
    position: static !important;
    float: none !important;
    width: 100% !important;
    padding: var(--space-md) !important;
    order: 2;
  }

  /* Remove absolute positioning from images */
  .mySlides {
    float: none !important;
    width: 100% !important;
    order: 1;
  }

  .image_screenshot,
  .g.image_screenshot {
    position: static !important;
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    padding: 0 !important;
    margin: 0 auto;
  }

  .cloudTextBorder {
    display: none;
  }
}

/* Guest sections */
@media (max-width: 767px) {
  .guest_sections {
    width: 100% !important;
  }

  .guest_left,
  .guest_right {
    float: none !important;
    padding: var(--space-md) !important;
    text-align: center;
  }

  .guest_section_image {
    width: 100% !important;
    max-width: 300px;
    height: auto !important;
  }
}

/* Slideshow buttons */
@media (max-width: 767px) {
  .prev,
  .next {
    min-width: var(--touch-target-min);
    min-height: var(--touch-target-min);
    padding: var(--space-sm) var(--space-md);
  }
}

/* Arrows animation section - prevent overlap with login button */
@media (max-width: 767px) {
  .arrows {
    position: static !important;
    margin: var(--space-xl) auto;
    display: block;
    clear: both;
    left: auto !important;
    bottom: auto !important;
    transform: translateX(0) !important;
    order: 2;
  }

  /* Add spacing between form section and arrows */
  .top-wrapper {
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .flex-container {
    order: 1;
  }
}

/* Feature sections */
@media (max-width: 767px) {
  .feature {
    flex-direction: column !important;
  }

  .feature .content {
    width: 100% !important;
    padding: var(--space-md) !important;
  }

  .img-contain {
    width: 100% !important;
    max-width: 300px;
    margin: var(--space-md) auto;
  }

  .huge_background {
    margin-left: 0 !important;
    margin-right: 0 !important;
    height: auto !important;
    min-height: auto;
  }
}
