/*
 * Sodalite HQ - progressive front-end enhancements
 *
 * Loaded after style.css so the original layout remains the source of truth.
 * This file contains typography, interaction, accessibility, form and footer
 * refinements that can be maintained independently from the legacy layout.
 */

/* --------------------------------------------------------------------------
   Typography and global interaction states
   -------------------------------------------------------------------------- */

body {
  color: #202437;
  font-size: clamp(15px, 0.2vw + 14px, 18px);
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

.hero-text {
  max-width: 620px;
  font-size: clamp(18px, 1vw + 10px, 23px);
  line-height: 1.55;
}

.vr-p,
.sp-p,
.research-p {
  line-height: 1.55;
}

a,
button,
input {
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid #ffcf4a;
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Hero actions
   -------------------------------------------------------------------------- */

.hero-primary {
  background: #282463 !important;
  border-color: #282463 !important;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(40, 36, 99, 0.25);
}

.hero-primary:hover {
  background: #171343 !important;
  transform: translateY(-2px);
}

.hero-secondary:hover,
.tooltip1:hover {
  background: #238e93 !important;
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Room imagery and scroll reveal motion
   -------------------------------------------------------------------------- */

.room-image {
  height: auto;
  object-fit: cover;
  transition: transform 260ms ease, box-shadow 260ms ease, opacity 500ms ease;
}

.room-image:hover {
  transform: translateY(-6px) scale(1.012);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.34), 0 16px 16px rgba(0, 0, 0, 0.2) !important;
}

/*
 * Hide reveal items only after the observer has initialized successfully.
 * If JavaScript fails, page content remains visible instead of leaving blank
 * sections.
 */
.js.reveal-ready .reveal-item {
  opacity: 0;
  transition: opacity 600ms ease var(--reveal-delay, 0ms), transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1) var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.js.reveal-ready .reveal-from-left { transform: translateX(-36px); }
.js.reveal-ready .reveal-from-right { transform: translateX(36px); }
.js.reveal-ready .reveal-from-bottom { transform: translateY(36px); }

.js.reveal-ready .reveal-item.is-visible {
  opacity: 1;
  transform: none;
  will-change: auto;
}

.js.reveal-ready .reveal-item.room-image.is-visible:hover {
  transform: translateY(-6px) scale(1.012);
}

/* --------------------------------------------------------------------------
   Registration and account forms
   -------------------------------------------------------------------------- */

/*
 * The current registration form is always the active form. Explicitly reset
 * the transform/visibility properties used by the retired sliding auth panel
 * so stale cached CSS cannot leave a white, empty registration card.
 */
#signup-form.form.sign-up {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: none;
}

.form label {
  width: min(320px, calc(100% - 32px));
}

.required-marker {
  color: #b42318;
}

.form input:focus {
  border-bottom-color: #2dadaf;
  box-shadow: 0 2px 0 #2dadaf;
}

.form input:user-invalid {
  border-bottom-color: #b42318;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  right: 0;
  bottom: 4px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  color: #282463;
  background: transparent;
  border: 0;
  border-radius: 50%;
}

.password-toggle:hover {
  color: #fff;
  background: #2dadaf;
}

#message {
  position: relative;
  z-index: auto;
  display: none;
  width: min(360px, calc(100% - 32px));
  height: auto;
  margin: 14px auto 0;
  padding: 16px 20px;
  color: #fff;
  background: #252a38;
  border-radius: 10px;
}

#message.is-active { display: block; }

#message h3 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 15px;
  text-align: left;
}

#message p {
  margin: 4px 0;
  padding: 0;
  font-size: 14px;
}

.valid { color: #72e5a8; }
.invalid { color: #ff9d95; }

.valid::before,
.invalid::before {
  position: static;
  display: inline-block;
  width: 22px;
  margin-right: 4px;
}

.form-feedback {
  width: min(320px, calc(100% - 32px));
  min-height: 20px;
  margin: 4px auto 0;
  font-size: 13px;
  text-align: left;
}

.form-feedback.is-error { color: #b42318; }
.form-feedback.is-success { color: #16794a; }

.auth-page {
  min-height: 100vh;
  background: #a8a7a7;
}

.auth-page .section-form {
  min-height: 100vh;
  padding: clamp(28px, 6vh, 72px) 16px;
}

.form-helper {
  margin: 10px auto 24px;
  padding: 0 16px;
  text-align: center;
}

.auth-back {
  display: block;
  width: fit-content;
  margin: 20px auto 0;
}

.submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(45, 173, 175, 0.24);
}

/* --------------------------------------------------------------------------
   Accessibility helpers
   -------------------------------------------------------------------------- */

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* --------------------------------------------------------------------------
   Footer and newsletter form
   -------------------------------------------------------------------------- */

footer {
  height: auto;
  padding: clamp(36px, 5vw, 72px);
}

footer a {
  color: #20245f;
  text-underline-offset: 3px;
}

footer a:hover { color: #0b5559; }

#newsletter-name,
#newsletter-email {
  padding: 8px 4px;
}

#newsletter-submit {
  width: 48px;
  min-width: 48px;
  height: 90px;
  border-radius: 8px;
}

#newsletter-submit:hover {
  background: #282463 !important;
}

#newsletter-checkbox {
  align-items: flex-start;
  gap: 10px;
}

#newsletter-checkbox > input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
}

#newsletter-checkbox > label {
  width: auto;
  font-size: 13px;
  text-align: left;
  text-transform: none;
}

.footer-legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 8px;
}

.socials a {
  display: inline-block;
  border-radius: 8px;
}

/* --------------------------------------------------------------------------
   Responsive and reduced-motion behaviour
   -------------------------------------------------------------------------- */

@media (max-width: 991px) {
  footer .col-md-4 {
    flex: 0 0 100%;
    width: 100%;
    margin-bottom: 24px;
  }

  footer .row:first-child .col-md-4:first-child {
    display: none;
  }

  .footer-heading { margin-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .js .reveal-item {
    opacity: 1;
    transform: none;
  }
}
