/* ============================================================
   REN Public — responsive system (mobile, tablet, all devices)
   Loaded after base.css on all public_base pages.
   ============================================================ */

:root {
  --pub-nav-height: 65px;
  --pub-safe-inline: max(var(--space-4), env(safe-area-inset-left, 0px));
  --pub-safe-inline-end: max(var(--space-4), env(safe-area-inset-right, 0px));
  --pub-safe-bottom: max(var(--space-4), env(safe-area-inset-bottom, 0px));
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--pub-nav-height) + var(--space-4));
}

body {
  overflow-x: hidden;
}

/* ============================================================
   Reduced motion — animations & transitions
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Disable hover lift on touch devices */
@media (hover: none) and (pointer: coarse) {
  .btn-primary:hover,
  .btn-outline:hover,
  .btn-outline-light:hover,
  .pub-form-submit:hover,
  .featured-card:hover {
    transform: none;
  }
}

/* ============================================================
   Touch targets (all breakpoints)
   ============================================================ */
.btn-primary,
.btn-outline,
.btn-outline-light,
.pub-form-submit,
.pub-menu-toggle,
.pub-mobile-accordion-toggle,
.pub-mobile-menu a,
.pub-nav-dropdown-toggle {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-primary,
.btn-outline,
.pub-form-submit {
  min-height: 44px;
}

/* ============================================================
   Layout — tablet (≤1023px)
   ============================================================ */
@media (max-width: 1023px) {
  section:not([class*="hero-window"]):not([class*="discover-search"]):not([class*="whats-new"]):not([class*="quote-section"]):not([class*="cta-section"]) {
    padding: var(--space-12) 0;
  }

  .pub-container {
    padding-inline: var(--pub-safe-inline) var(--pub-safe-inline-end);
  }

  .coming-soon-page {
    min-height: 70vh;
    padding: var(--space-12) var(--pub-safe-inline) var(--space-16);
  }
}

/* ============================================================
   Layout — mobile (≤767px)
   ============================================================ */
@media (max-width: 767px) {
  section:not([class*="hero-window"]):not([class*="discover-search"]):not([class*="whats-new"]):not([class*="quote-section"]):not([class*="cta-section"]) {
    padding: var(--space-10) 0;
  }

  .inner-page-hero {
    padding: var(--space-10) 0 var(--space-8);
  }

  .inner-page-hero h1 {
    font-size: clamp(1.625rem, 6vw, 2.25rem);
  }

  .inner-page-lead {
    font-size: 1rem;
  }

  .inner-page-content {
    padding: var(--space-10) 0 var(--space-12);
  }

  .breadcrumb ol {
    padding-inline: 0;
    font-size: 0.8125rem;
  }

  .btn-lg {
    width: 100%;
    justify-content: center;
    padding: 14px var(--space-5);
  }

  .coming-soon-icon {
    width: 60px;
    height: 60px;
    font-size: 1.75rem;
  }

  .coming-soon-inner .btn-primary {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   Auth / form pages
   ============================================================ */
@media (max-width: 767px) {
  .pub-form-page {
    min-height: auto;
    justify-content: flex-start;
    padding:
      var(--space-8)
      var(--pub-safe-inline-end)
      calc(var(--space-10) + var(--pub-safe-bottom))
      var(--pub-safe-inline);
  }

  .pub-form-card {
    padding: var(--space-6);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    max-width: none;
  }

  .pub-form-card h1 {
    font-size: clamp(1.375rem, 5vw, 1.75rem);
  }

  .pub-form-card .pub-form-subtitle {
    margin-bottom: var(--space-6);
    font-size: 0.9375rem;
  }

  .pub-field input,
  .pub-field select,
  .pub-field textarea {
    font-size: 16px;
    min-height: 44px;
    padding: var(--space-3) var(--space-4);
  }

  .pub-field input.auth-code-input {
    font-size: clamp(1.125rem, 5vw, 1.375rem);
    letter-spacing: 0.28em;
  }

  .pub-form-submit {
    min-height: 48px;
    font-size: 1rem;
  }

  .pub-role-grid {
    grid-template-columns: 1fr;
  }

  .pub-role-card {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    text-align: left;
  }

  .pub-role-card .role-icon {
    margin-bottom: 0;
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .pub-form-page {
    padding-top: var(--space-6);
  }

  .pub-form-card {
    padding: var(--space-5);
  }

  .pub-form-alt {
    font-size: 0.8125rem;
    line-height: 1.5;
  }
}

@media (max-width: 360px) {
  .pub-form-card h1 {
    font-size: 1.25rem;
  }

  .pub-field input.auth-code-input {
    letter-spacing: 0.18em;
  }
}

/* Tablet: centre simple one-card forms when there is room */
@media (min-width: 640px) and (max-width: 1023px) {
  .pub-form-page {
    min-height: calc(100dvh - var(--pub-nav-height));
    justify-content: center;
  }
}

/* ============================================================
   Register page (public layout)
   ============================================================ */
@media (max-width: 767px) {
  .reg-page {
    padding-top: var(--space-6);
    padding-bottom: calc(var(--space-12) + var(--pub-safe-bottom));
  }

  .reg-page .pub-container {
    padding-inline: max(var(--space-3), env(safe-area-inset-left)) max(var(--space-3), env(safe-area-inset-right));
  }

  .reg-page .auth-container.auth-register {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
  }

  .reg-signin-prompt {
    flex-direction: column;
    text-align: center;
    padding: var(--space-4);
  }

  .reg-signin-prompt a {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .reg-page .auth-container.auth-register {
    padding: var(--space-4);
  }
}
