/* Index Page Specific Styles */

.access-card {
  position: relative;
  width: min(740px, calc(100vw - 2rem));
  height: auto;
  border-radius: var(--card-border-radius);
  background: var(--card-bg);
  padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 5.5rem clamp(1rem, 4vw, 2.5rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  isolation: isolate;
  overflow: hidden; /* Prevent content spill */
}

.stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.title {
  margin: 0 0 0.75rem 0;
  text-align: center;
  color: var(--white);
  font-weight: 700;
  font-size: var(--fs-title);
  line-height: 1.1;
  letter-spacing: 0.2px;
}

.intro {
  margin: 0 0 0.75rem 0;
  text-align: center;
  color: var(--white);
  font-weight: 400;
  font-size: var(--fs-intro);
  line-height: 1.4;
}

.col {
  width: 100%;
  max-width: 580px;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.name-row {
  display: flex;
  flex-direction: column;
  gap: 0.13rem;
  width: 100%;
}

.input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

label {
  color: var(--white);
  font-weight: 400;
  font-size: var(--fs-label);
  margin-top: 0.25rem;
  margin-bottom: 3px;
  display: block;
}

input[type="text"],
input[type="email"] {
  width: 100%;
  height: 44px;
  background: var(--input-bg);
  border: none;
  border-radius: 6px;
  padding: 0 0.75rem;
  font-size: var(--fs-input);
  color: #111;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color var(--transition-speed) ease;
}

input.has-value {
  background-color: var(--input-filled-bg) !important;
}

/* Metadata / Error Block */
.meta-block {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 0.5rem;
}

.helper {
  color: var(--white);
  font-size: var(--fs-small);
  text-align: center;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.inline-slot {
  min-height: 1.25rem;
  width: 100%;
  text-align: center;
  margin-bottom: 0.25rem;
}

.inline-msg {
  color: var(--ink-orange);
  font-size: var(--fs-small);
  font-weight: 700;
}

.notice {
  color: var(--white);
  font-size: var(--fs-small);
  line-height: 1.4;
  text-align: justify;
  text-justify: inter-word;
}

.notice a {
  color: var(--white);
  font-weight: 700;
  text-decoration: underline;
}

/* Actions & Button */
.actions {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  width: 100%;
  z-index: 3;
}

.btn-submit {
  width: 120px;
  height: 42px;
  background: var(--ink-orange);
  border: 2px solid var(--ink-blue);
  border-radius: 6px;
  color: var(--white);
  font-weight: 700;
  font-size: 1.125rem;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  transition:
    transform var(--transition-speed) ease,
    box-shadow var(--transition-speed) ease;
}

@media (min-width: 1367px) {
  .btn-submit {
    width: 175px;
    height: 70px;
    font-size: 2rem;
  }

  .access-card {
    width: 740px;
    padding: 1.5rem 1.5rem 7rem 1.5rem;
    gap: 1rem;
  }
  .name-row {
    flex-direction: column;
    gap: 0.13rem;
  }
  .lang-switch {
    gap: 0.75rem;
  }
}

/* 5. LARGE LAPTOP (1367px - 1599px) */
@media screen and (min-width: 1367px) and (max-width: 1599px) {
  .title {
    font-size: 32px !important;
  }
  .intro {
    font-size: 15px !important;
  }
  label {
    font-size: 14px !important;
  }
  input[type="text"],
  input[type="email"] {
    height: 40px !important;
    font-size: 1.1rem !important;
  }
  .helper, .notice {
    font-size: 12px !important;
  }
  .name-row{
    gap: 0.13rem;
  }
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.btn-submit:active {
  transform: translateY(0);
}

/* Processing Overlay */
.processing-overlay {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(4, 10, 20, 0.78);
  z-index: 20000 !important;
  box-sizing: border-box;
  pointer-events: all !important;
  justify-content: center;
  align-items: center;
}

.processing-overlay.is-visible {
  display: flex;
}

/* Block interactions + scrolling while processing overlay is visible */
html.processing-lock,
body.processing-lock {
  overflow: hidden !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  height: 100vh !important;
  overscroll-behavior: none !important;
  touch-action: none !important;
}

body.processing-lock .site-footer {
  display: none !important;
}

/* Make flags unclickable while processing */
body.processing-lock .lang-switch {
  pointer-events: none !important;
  z-index: 1 !important;
  opacity: 0.2 !important;
}

/* Ensure overlay itself captures taps */
.processing-overlay {
  pointer-events: all !important;
  min-height: 100vh;
  min-width: 100vw;
}

@supports (min-height: 100dvh) {
  .processing-overlay {
    min-height: 100dvh !important;
    min-width: 100dvw !important;
  }
}

.processing-overlay.is-visible {
  pointer-events: auto;
}

.processing-card {
  max-width: 480px;
  width: 100%;
  max-height: calc(100svh - 32px);
  /* ensure it fits on small phones */
  max-height: calc(100vh - 32px);
  /* fallback */
  overflow-y: auto;
  /* allow scroll if it still exceeds */
  overscroll-behavior: contain;
  background: rgba(8, 18, 35, 0.96);
  border-radius: 24px;
  padding: 32px 28px;
  box-sizing: border-box;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  text-align: center;
  color: #ffffff;
}

.processing-card h2 {
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 800;
}

.processing-card p {
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 400;
}

.processing-spinner {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--ink-orange);
  /* T13: brand orange indicator */
  animation: ink-processing-spin 0.9s linear infinite;
  margin: 0 auto;
}

@keyframes ink-processing-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   SPECIFIC TABLET & IPAD QUERIES (REFINED)
   ========================================================================== */

/* 1. TABLET PORTRAIT (768px - 1023px) - iPad Mini, Air, Pro 10.5 */
@media only screen and (min-width: 768px) and (max-width: 1023px) and (orientation: portrait) {
  .access-card {
    width: min(600px, 90vw);
    padding: 2rem 2.5rem 5.7rem 2.5rem;
  }
  .title {
    font-size: 2rem !important;
    margin-bottom: 0.25rem;
  }
  .intro {
    font-size: 0.940rem !important;
    margin-bottom: 0.5rem;
  }
  .name-row {
    flex-direction: column;
    gap: 0.17rem;
  }
  input[type="text"],
  input[type="email"] {
    height: 40px !important;
    font-size: 1.1rem !important;
  }
  label {
    font-size: 14px !important;
    margin-bottom: 6px !important;
  }
  .btn-submit {
    width: 150px;
    height: 48px;
    font-size: 1.4rem;
  }
  .helper, .notice {
    font-size: 0.750rem !important;
  }
  .inline-slot{
    min-height: 8px !important;
}
  .card-watermark {
    height: 45px;
    bottom: 1.63rem;
    right: 1.5rem;
  }
  .lang-switch {
    /* gap: 0.8rem !important; */
    top: 1.5rem !important;
    right: 1.5rem !important;
  }
  .lang-switch img {
    margin-left: 0.5rem;
  }
}

/* 2. TABLET LANDSCAPE (768px - 1199px) - iPad Mini, Air, Pro 11 Landscape */
@media only screen and (min-width: 768px) and (max-width: 1199px) and (orientation: landscape) {
  .access-card {
    width: min(540px, 80vw);
    padding: 1.25rem 2rem 1.25rem 2rem;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  .stack {
    width: 100%;
  }
  .col {
    width: 100%;
    max-width: 600px;
    gap: 0.2rem;
  }
  .name-row {
    flex-direction: column;
    gap: 0.13rem;
  }
  .title {
    font-size: 1.9rem !important;
    margin-bottom: 0.15rem;
  }
  .intro {
    font-size: 0.940rem !important;
    margin-bottom: 0.15rem;
  }
  label{
    font-size: 14px !important;
  }
  input[type="text"],
  input[type="email"] {
    height: 40px !important;
  }
  .actions {
    position: static;
    transform: none;
    margin-top: 0.7rem;
  }
  .inline-slot{
    min-height: 10px !important
  }
  .btn-submit {
    width: 125px;
    height: 38px;
    font-size: 1.1rem;
  }
  .notice, .helper {
    font-size: 0.75rem !important;
  }
  .card-watermark {
    height: 35px;
    bottom: 1.2rem;
    right: 2rem;
  }
  .lang-switch {
    /* gap: 0.9rem !important; */
    top: 1.25rem !important;
    right: 1.25rem !important;
  }
  .lang-switch img {
    margin-left: 0.5rem;
  }
}

/* 3. LARGE TABLET PORTRAIT (1024px - 1194px) - iPad Pro 11" & 12.9" Portrait */
@media only screen and (min-width: 1024px) and (max-width: 1194px) and (orientation: portrait) {
  .access-card {
    width: 700px;
    padding: 2.4rem 4rem 6.5rem 4rem;
  }
  .title {
    font-size: 2rem !important;
  }
  .intro {
    font-size: 0.940rem !important;
  }
  .name-row {
    flex-direction: column;
    gap: 0.13rem;
  }
  label {
    font-size: 14px !important;
    margin-top: 0.25rem !important;
    margin-bottom: 6px !important;
  }
  input[type="text"],
  input[type="email"] {
    height: 54px !important;
    font-size: 1.2rem !important;
  }
   .helper, .notice {
    font-size: 12px !important;
  }
  .btn-submit {
    width: 180px;
    height: 60px;
    font-size: 1.75rem;
  }
  .card-watermark {
    height: 60px;
    bottom: 1.5rem;
    right: 2.5rem;
  }
   .lang-switch {
    gap: 0.75rem;
  }
}

/* 4. LARGE TABLET LANDSCAPE (1200px - 1366px) - iPad Pro 12.9" Landscape */
@media only screen and (min-width: 1200px) and (max-width: 1366px) and (orientation: landscape) {
  .access-card {
    width: 612px;
    padding: 1rem 2rem 5.6rem 2rem;
    gap: 0;
  }
  .name-row {
    flex-direction: column;
    gap: 0.6;
  }
  .title {
    font-size: 32px !important;
    margin-bottom: 0.15rem;
  }
  .intro {
    font-size: 0.940rem !important;
    margin-bottom: 0.15rem;
  }
  label {
    font-size: 14px !important;
    margin-top: 0.25rem !important;
    margin-bottom: 6px !important;
  }
  input[type="text"],
  input[type="email"] {
    height: 40px !important;
  }
  .inline-slot {
    min-height: 0.935rem !important;
    margin-bottom: 0.1rem !important;
  }
  .helper, .notice {
    font-size: 12px !important;
  }
  .btn-submit {
    width: 143px;
    height: 48px;
    font-size: 1.25rem;
  }
  .card-watermark {
    height: 42px;
    bottom: 1.7rem;
    right: 2rem;
  }
  .lang-switch {
    gap: 0.75rem;
  }
}

/* Landscape Mode Adjustments (High Priority for Mobile) */
@media (max-width: 932px) and (orientation: landscape) {
  .access-card {
    min-height: auto;
    height: auto;
    padding-bottom: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.7rem;
    width: 65vw;
  }

  .access-card .lang-switch {
    top: 1rem;
    right: 1rem;
  }

  .stack {
    width: 100%;
    align-items: center;
    text-align: center;
  }

  .title {
    text-align: center;
    max-width: 100%;
    padding: 0;
    font-size: 24px !important;
    margin-bottom: 0.25rem;
  }

  .helper,
  .notice {
    font-size: 11px !important;
    margin-bottom: 0 !important;
  }

  .inline-slot {
    margin-bottom: 0 !important;
  }

  .intro {
    text-align: center;
    max-width: 100%;
    padding: 0;
    font-size: 13px !important;
    margin-bottom: 0.5rem;
  }

  .col {
    width: 100%;
    max-width: none;
  }

  label {
    font-size: 14px !important;
  }

  .name-row {
    flex-direction: row !important;
    gap: 1rem;
  }

  .actions {
    position: static;
    transform: none;
    width: 100%;
    margin-top: 1rem;
    order: 10;
  }

  /* Processing Overlay Landscape Optimization */
  .processing-card {
    max-width: min(420px, 100%);
    max-height: calc(100vh - 48px);
    padding: 20px 16px;
  }

  .processing-card h2 {
    font-size: 15px !important;
    margin-bottom: 8px;
  }

  .processing-card p {
    font-size: 14px !important;
    margin-bottom: 16px;
  }

  .processing-spinner {
    width: 32px;
    height: 32px;
  }
  .card-watermark {
    height: 35px !important;
  }
  .lang-switch {
    gap: 0.45rem;
  }
}

/* Mobile specific optimizations */
@media (max-width: 767px) {
  .title {
    margin-bottom: 5px !important;
  }
  .intro {
    font-size: 13px !important;
    margin-bottom: 5px !important;
  }
  input[type="text"],
  input[type="email"] {
    height: 40px !important;
  }

  /* Processing Overlay Portrait Optimization */
  .processing-card {
    max-width: min(460px, 92%);
    padding: 18px 16px;
  }

  .processing-card h2 {
    font-size: 15px !important;
    margin-bottom: 10px;
  }

  .inline-slot{
    min-height: 15px !important
  }

  .processing-card p {
    font-size: 13px !important;
    margin-bottom: 14px;
  }

  .processing-spinner {
    width: 36px;
    height: 36px;
  }
  .card-watermark {
    height: 35px !important;
  }
  .lang-switch {
    gap: 0.45rem;
  }
}
