:root {
  /* Colors */
  --ink-blue: #0f3558;
  --ink-orange: #fe8215;
  --white: #ffffff;

  /* Background LQIPs (Orange) */
  --bg-lqip-desktop: url("data:image/webp;base64,UklGRpgAAABXRUJQVlA4IIwAAACwBACdASpAACQAPzGGvleuqCYkqBqqqdAmCUAZjmv4AFS0Zi1u7k7bANk/Ih+AAPbiVue6h/oV3Z8Rdn/bzmz28bx/qvNfDmkW5gG1oP7ln9Uuhh+dvvq9WFzf1DrBuZhBQ8mMXyI4bOaO8nD16rZdk1CbWRB7hGwVG4QfS4zKQBHGiZZ/JICpMgAAAA==");
  --bg-lqip-mobile:  url("data:image/webp;base64,UklGRrYAAABXRUJQVlA4IKoAAABwBQCdASokAE4APzGCt1SuqCWjLNgMcdAmCWMAv7AAwxygPWHFpHLD3xupJ+Yqv5FTMTQAAPcDvToZzbX9CvWX302P+onYjxgTkjGijV050Jl6Xk9aXpIVfis6itElg4CvB4Ywz7OvWqKSaM60ViAKdTXPqmxliAnbrqYM45hQddUC9MSqXB7taYcxczhSuiDSaqB1SzvQ/HirHTZgK50/mw8hZxcSeggAAA==");

  /* Fluid Typography */
  --fs-base: 1rem;
  --fs-title: clamp(1.5rem, 5vw, 2.5rem);
  --fs-intro: clamp(0.9rem, 2.5vw, 1.125rem);
  --fs-label: 1rem;
  --fs-input: 1rem;
  --fs-btn: 2rem;
  --fs-small: 0.875rem;
  --fs-footer: clamp(0.75rem, 2vw, 1.375rem);

  /* Layout Constants */
  --card-max-w: 740px;
  --card-border-radius: 30px;
  --card-bg: rgba(15, 53, 88, 0.7);
  --input-bg: #ffffff;
  --input-filled-bg: #eef1f5;
  --transition-speed: 0.08s;

  /* Safari/Firefox handles */
  --viewport-height: 100vh;
}

@media (max-width: 1366px) {
  :root {
    --card-border-radius: 24px;
    --fs-label: 13px;
    --fs-input: 14px;
    --fs-small: 11px;
  }
}

@supports (min-height: 100dvh) {
  :root {
    --viewport-height: 100dvh;
  }
}

/* Base Reset & Global Handling */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  touch-action: manipulation; /* Prevents double-tap zoom across all devices */
  -webkit-tap-highlight-color: transparent;
}

/* Global Scrollbar Hiding */
*::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

* {
  -ms-overflow-style: none !important; /* IE and Edge */
  scrollbar-width: none !important; /* Firefox */
}

html {
  background-color: var(--ink-blue);
  overflow-x: hidden;
  overscroll-behavior-y: contain; /* Prevents pull-to-refresh bounce on Android without breaking scroll */
  -webkit-text-size-adjust: 100%; /* Safari fix */
  -moz-text-size-adjust: 100%; /* Firefox fix */
}

body {
  font-family: Helvetica, Arial, sans-serif;
  height: var(--viewport-height);
  background: transparent;
  color: var(--white);
  line-height: 1.4;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Background Handling */
.page-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background-color: var(--ink-blue);
  background-image: url("/assets/img/landing-bg-mobile.jpg"), var(--bg-lqip-mobile);
  background-image: image-set(
    url("/assets/img/landing-bg-mobile.webp") type("image/webp"),
    url("/assets/img/landing-bg-mobile.jpg") type("image/jpeg")
  ), var(--bg-lqip-mobile);
  background-position: center;
  background-size: 100% 100% !important;
  background-repeat: no-repeat;
  z-index: -1;
  pointer-events: none;
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Global Background Logic: Force Desktop on Landscape across all devices */
@media screen and (orientation: landscape), screen and (min-width: 1024px) {
  .page-bg {
    background-image: url("/assets/img/landing-bg-desktop.jpg"), var(--bg-lqip-mobile) !important;
    background-image: image-set(
      url("/assets/img/landing-bg-desktop.webp") type("image/webp"),
      url("/assets/img/landing-bg-desktop.jpg") type("image/jpeg")
    ), var(--bg-lqip-mobile) !important;
  }
}

/* Global Background Logic: Force Mobile on Portrait (small screens) */
@media screen and (max-width: 1023px) and (orientation: portrait) {
  .page-bg {
    background-image: url("/assets/img/landing-bg-mobile.png"), var(--bg-lqip-mobile) !important;
  }
}

/* Mobile Background & Footer Optimization */
@media screen and (max-width: 932px) {
  .page-bg {
    background-size: cover !important;
  }
}

/* Page Shell & Centering */
.page-shell {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.page-center {
  flex: 1 1 auto;
  display: grid;
  place-items: center;
  padding: 1rem;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Fix for Tablet/iPad Footer Visibility and Centering */
@media screen and (min-width: 768px) and (max-width: 1366px) {
  .page-center {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: auto !important;
  }
}

/* Language Switcher */
.lang-switch {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  /* gap: 0.75rem; */
  z-index: 10;
}

.lang-switch a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--white);
  transition: transform var(--transition-speed) ease;
}

.lang-switch img {
  width: 48px;
  height: 32px;
}

.lang-switch .lang-label {
  margin-top: 0.25rem;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

@media (max-width: 767px) {
  .lang-switch .lang-label {
    font-size: 12px;
  }
}

.lang-switch a:hover {
  transform: translateY(-2px);
}

/* Card Watermark (Common for index and success) */
.card-watermark {
  position: absolute;
  right: 1rem;
  bottom: 1.65rem;
  height: clamp(30px, 9vw, 65px);
  width: auto;
  opacity: 0.9;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/* Footer Implementation */
.site-footer {
  width: 100%;
  text-align: center;
  padding-bottom: 1.5rem;
  color: var(--white);
  font-weight: 700;
  font-size: var(--fs-footer);
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  background: transparent;
  flex-shrink: 0;
}

/* Media Element Fluidity Rule */
img,
svg,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Safari/Firefox specific alignment/rendering refinements */
@-moz-document url-prefix() {
  /* Firefox specific refinements if any */
  .notice {
    hyphens: auto;
  }
}

@supports (-webkit-touch-callout: none) {
  /* Safari specific refinements to stop rubber-band/bouncy effect */
  html,
  body {
    position: fixed;
    width: 100%;
    height: 100%;
    -webkit-overflow-scrolling: touch;
  }
}

/* ==========================================================================
   INDEPENDENT TABLET QUERIES (NO SHARING)
   ========================================================================== */

/* 1. TABLET PORTRAIT (768px - 1024px) */
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  .card-watermark {
    height: 42px;
    bottom: 1.25rem;
    right: 1.25rem;
  }
  .site-footer {
    font-size: 18px !important;
  }
}

@media (min-width: 1367px) {
  .lang-switch img {
    width: 80px;
    height: 55px;
  }
  .lang-switch .lang-label {
    font-size: 24px;
  }
}

/* 5. LAPTOP (1367px - 1599px) */
@media screen and (min-width: 1367px) and (max-width: 1599px) {
  .site-footer {
    font-size: 18px !important;
  }
}

/* 2. TABLET LANDSCAPE (768px - 1366px) */
@media screen and (min-width: 768px) and (max-width: 1366px) and (orientation: landscape) {
  .card-watermark {
    height: 42px;
    bottom: 1.25rem;
    right: 1.25rem;
  }
  .site-footer {
    font-size: 18px !important;
  }
}

@media (max-width: 933px) and (orientation: landscape) {
  .card-watermark {
    height: 34px !important;
    bottom: 1.5rem !important;
    right: 1.25rem !important;
  }
  .lang-switch img {
    margin-left: 0 !important;
  }
  .site-footer {
    font-size: 12px !important;
  }
  .page-center {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }
}

@media (max-width: 767px) and (orientation: portrait) {
  .page-center {
    padding-top: 5.5rem;
    padding-bottom: 2rem !important;
  }
}

@media (min-width: 768px) {
  .page-center {
    padding-top: 1rem;
  }
}
