:root {
  --purple: #8e2b99;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
}

body {
  min-height: 100vh;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  flex: 1;
}

/* Layout wrapper for sticky footer */
.page-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-content {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

footer {
  flex-shrink: 0;
}

#surveyElement {
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.loading-progress {
  width: 100%;
  max-width: 300px;
  height: 4px;
  position: relative;
  margin: 20px auto;
  background-color: #f0f0f0;
  overflow: hidden;
}

.loading-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 50%;
  height: 100%;
  background-color: var(--purple);
  animation: loading-progress-animation 1.5s infinite ease;
}

.loading-progress-text {
  text-align: center;
  font-family: Arial, sans-serif;
  font-size: 14px;
  color: #333;
  margin-top: 10px;
}

/* Animation for indeterminate loading bar */
@keyframes loading-progress-animation {
  0% {
    left: -50%;
  }

  100% {
    left: 150%;
  }
}

.bold {
  font-weight: 600;
}

.session-timeout-countdown-minutes,
.session-timeout-countdown-seconds {
  font-weight: 600;
}

/* Hero section - breaks out of container to be full width */
/* Remove top padding from container when hero section is first child */
.container.page-container:has(> .hero-section:first-child),
.container.page-container:has(> *:first-child + .hero-section) {
  padding-top: 0;
}

/* Remove bottom margin from Alert when followed by hero section */
.container.page-container:has(> .alert + .hero-section) {
  padding-top: 0;
}

/* Add padding-top to container when it follows a hero section (for overlapping login box) */
.hero-section + .container.page-container {
  padding-top: 8rem;
}

.hero-section {
  width: 100%;
  min-height: 280px;
  height: 380px;
  position: relative;
  overflow: visible;
  margin: 0;
  padding: 0;
  background-color: var(--dkfds-color-primary);
}

.hero-content {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  min-height: 280px;
  height: 100%;
  position: relative;
  width: 100%;
  z-index: 2;
}

.hero-left {
  flex: 0 0 50%;
  z-index: 2;
  padding-bottom: 2rem;
  padding-left: 2rem;
}

.hero-right {
  flex: 0 0 50%;
  height: 100%;
  background-image: url('/images/hero/hero_banner.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  position: relative;
}

.hero-right::before,
.hero-right::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: auto;
  height: 100%;
  background-size: auto 100%;
  background-repeat: no-repeat;
  pointer-events: none;
}

.hero-right::before {
  left: 0;
  background-image: url('/images/ClippingMasks/clipping_mask_left.svg');
  background-position: left center;
  width: 15%;
}

.hero-right::after {
  right: 0;
  background-image: url('/images/ClippingMasks/clipping_mask_right.svg');
  background-position: right center;
  width: 10%;
}

.hero-welcome-text {
  color: #ffffff;
  margin: 0;
  padding-top: 1.2rem;
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1.2;
}


/* Login form container */
.login-container {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  padding: 0;
  margin-bottom: 3rem;
  margin-left: 2rem;
  position: relative;
  transform: translateY(50%);
  z-index: 10;
}

/* Desktop login container - visible by default, hidden on mobile */
.login-container-desktop {
  display: flex;
}

/* Mobile login container - hidden by default, visible on mobile */
.login-container-mobile {
  display: none;
}

.login-container .login-card {
  max-width: 300px;
  width: 300px;
  margin: 0;
  background-color: #ffffff !important;
}

.login-container .login-card .card-content {
  padding: 2.5rem;
  font-size: 1.125rem;
}

.login-container .login-card .card-heading {
  text-align: center !important;
}

/* Hide heading when showing municipality info from query param */
.login-container .login-card.hide-heading .card-heading {
  display: none;
}

.login-container .button-wrapper {
  margin-bottom: 0.5rem;
  width: 100%;
}

.login-container .button-wrapper button {
  width: 100% !important;
  max-width: 100% !important;
}

.login-container .button-wrapper:last-of-type {
  margin-bottom: 0;
}

.login-container .form-group {
  margin-bottom: 1.5rem;
  width: 100%;
}

.login-container .form-select {
  width: 100%;
}

.login-button,
.mitid-button {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mitid-button {
  background-color: #0066cc !important;
  border-color: #0066cc !important;
}

.mitid-button:hover:not(:disabled) {
  background-color: #0052a3 !important;
  border-color: #0052a3 !important;
}

.mitid-button .icon-svg,
.mitid-button img.icon-svg {
  width: 3.5em;
  height: 1.75em;
  filter: brightness(0) invert(1);
  margin-left: 0.5rem;
  vertical-align: middle;
  object-fit: contain;
}

.separator {
  margin: 0.5rem 0;
}

.separator-line {
  width: 100%;
  height: 1px;
  background-color: #e0e0e0;
}

.municipality-info {
  margin-bottom: 1rem;
  font-size: 1.25rem !important;
}

.municipality-info p {
  margin: 0 0 1rem 0;
  font-size: 1.5rem !important;
  line-height: 1.5;
  font-weight: 500 !important;
}

.change-municipality-link {
  color: var(--dkfds-color-link);
  text-decoration: underline;
  cursor: pointer;
  font-size: 1.25rem !important;
  display: inline-block;
  margin-top: 0.75rem;
  font-weight: 600 !important;
}

.change-municipality-link:hover {
  color: var(--dkfds-color-link-hover);
  text-decoration: underline;
}

/* Loading container - used across multiple components */
.loading-container {
  min-height: 50vh;
  padding: 2rem;
}

/* Responsive hero section - medium screens (tablets like iPad Air, Surface Pro) */
@media (max-width: 1024px) {
  .hero-content {
    max-width: 100%;
    padding: 0;
  }

  .hero-left {
    flex: 0 0 40%;
    max-width: 40%;
  }

  .hero-right {
    flex: 0 0 60%;
    width: 60%;
  }
}

@media (max-width: 992px) {
  .hero-left {
    flex: 0 0 35%;
    max-width: 350px;
  }

  .hero-right {
    flex: 0 0 65%;
    width: 65%;
  }
}

/* Responsive hero section - small screens */
@media (max-width: 768px) {
  .hero-section {
    min-height: 150px;
    height: 150px;
    overflow: hidden;
  }

  /* Hero image takes 50% width on mobile, positioned on the right */
  .hero-right {
    flex: 0 0 50%;
    width: 50%;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    left: auto;
  }

  /* Show only left clipping mask on mobile */
  .hero-right::before {
    display: block;
  }

  .hero-right::after {
    display: none;
  }

  .hero-content {
    flex-direction: row;
    align-items: stretch;
    padding: 0;
    min-height: auto;
    height: 100%;
  }

  /* Hide hero-left content on mobile (welcome text moves to content section) */
  .hero-left {
    flex: 0 0 50%;
    width: 50%;
    padding-bottom: 0;
    padding-left: 0;
    max-width: 50%;
  }

  .hero-welcome-text {
    padding-top: 0.6rem;
    font-size: 1.75rem;
  }

  /* Hide desktop login container on mobile */
  .login-container-desktop {
    display: none;
  }

  /* Show mobile login container */
  .login-container-mobile {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    margin-top: 0;
    margin-left: 0;
    width: 100%;
    transform: none;
  }

  .login-container-mobile .login-card {
    margin: 0 auto;
    width: 100%;
    max-width: 400px;
  }

  .login-container-mobile .login-card .card-content {
    padding: 1.5rem;
  }

  /* Reduce padding after hero on mobile */
  .hero-section + .container.page-container {
    padding-top: 1rem;
  }

  /* Smaller logo text on mobile */
  .header .portal-info a span {
    font-size: 3rem !important;
  }

  /* Portal info layout - logo and menu inline */
  .header .portal-info-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* Style menu button - icon above text, no underline, no blue color */
  .header .button-menu-open {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none !important;
    color: inherit !important;
    background: none !important;
    border: none !important;
    padding: 0.5rem;
  }

  .header .button-menu-open .menu-icon {
    width: 2.5rem;
    height: 2.5rem;
    margin-bottom: 0;
    fill: var(--dkfds-color-primary);
    display: block;
  }

  .header .button-menu-open .menu-text {
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--dkfds-color-primary);
    line-height: 1;
    margin-top: 0;
  }

  .header .button-menu-open:hover,
  .header .button-menu-open:focus {
    text-decoration: none !important;
    color: inherit !important;
  }
}
