 /* ═══════════════════════════════════════════════════════════════
       CRITICAL CSS - All above-the-fold styles in one block
       Prevents layout shift and flickering
    ═══════════════════════════════════════════════════════════════ */

    :root {
      --primary: #961622;
      --primary-dark: #78121b;
      --secondary: #FFFFFF;
      --dark: #111111;
      --light: #F8F9FA;
      --header-height: 70px;
      --bs-primary: #961622;
      --font-primary: 'Oswald', sans-serif;
      --font-secondary: 'Rubik', sans-serif;
    }

    /* Prevent layout shift */
    html { overflow-y: scroll; scroll-behavior: smooth; }

    *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

    body {
      font-family: var(--font-secondary);
      font-size: 16px;
      line-height: 1.6;
      color: #212529;
      background-color: #fff;
      padding-top: var(--header-height);
      overflow-x: hidden;
      opacity: 1;
      visibility: visible;
    }

    /* Fixed header placeholder - reserves space */
    #header-placeholder {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      height: var(--header-height);
      background: var(--dark);
      z-index: 1040;
      contain: layout style;
    }

    .fixed-top {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 1040;
      height: var(--header-height);
      background-color: var(--dark);
    }

    .navbar {
      min-height: var(--header-height);
      height: var(--header-height);
      padding: 0 1rem;
      background-color: var(--dark) !important;
    }

    .header-logo { width: 140px; height: 56px; object-fit: contain; }
    .header-title { font-size: 1.75rem; font-weight: 700; line-height: 1.2; color: var(--primary) !important; white-space: nowrap; }
    .header-tagline { font-size: .75rem; line-height: 1.1; color: rgba(255,255,255,.75); white-space: nowrap; }

    /* Membership Hero */
    .membership-hero {
      background: linear-gradient(135deg, rgba(150, 22, 34, 0.9) 0%, rgba(120, 18, 27, 0.95) 100%),
                  url('/img/hero_images/WBi_Tournament-guidelines.webp') center center/cover;
      min-height: 400px;
      display: flex;
      align-items: center;
      justify-content: center;
      text-align: center;
      color: white;
      position: relative;
      overflow: hidden;
      margin-top: 0;
      margin-bottom: 0;
      contain: layout paint;
    }

    .membership-hero::before {
      content: '';
      position: absolute;
      top: -50%;
      right: -10%;
      width: 500px;
      height: 500px;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 50%;
      animation: float 6s ease-in-out infinite;
      will-change: transform;
    }

    @keyframes float {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-30px); }
    }

    .membership-hero h1 {
      font-family: var(--font-primary);
      font-size: 3rem;
      font-weight: 700;
      color: #fff;
      text-shadow: 2px 2px 6px rgba(0,0,0,.4);
    }

    .membership-hero .lead {
      font-size: 1.2rem;
      color: #fff;
      text-shadow: 1px 1px 3px rgba(0,0,0,.3);
    }

    /* Container */
    .container {
      width: 100%;
      padding-right: 15px;
      padding-left: 15px;
      margin-right: auto;
      margin-left: auto;
    }

    @media (min-width: 576px) { .container { max-width: 540px; } }
    @media (min-width: 768px) { .container { max-width: 720px; } }
    @media (min-width: 992px) { .container { max-width: 960px; } }
    @media (min-width: 1200px) { .container { max-width: 1140px; } }

    /* Typography */
    h1, h2, h3, h4, h5, h6 {
      font-family: var(--font-primary);
      font-weight: 600;
      line-height: 1.2;
      margin-top: 0;
      margin-bottom: .5rem;
    }

    .display-3, .display-5 {
      font-family: var(--font-primary);
      font-weight: 700;
    }

    .text-primary { color: var(--primary) !important; }
    .text-uppercase { text-transform: uppercase; }
    .text-center { text-align: center !important; }
    .text-muted { color: #6c757d !important; }
    .text-white { color: #fff !important; }
    .text-danger { color: #dc3545 !important; }
    .text-success { color: #28a745 !important; }

    .bg-light { background-color: var(--light) !important; }
    .bg-primary { background-color: var(--primary) !important; }

    /* Utility classes */
    .mb-0 { margin-bottom: 0 !important; }
    .mb-2 { margin-bottom: .5rem !important; }
    .mb-3 { margin-bottom: 1rem !important; }
    .mb-4 { margin-bottom: 1.5rem !important; }
    .mb-5 { margin-bottom: 3rem !important; }
    .mt-1 { margin-top: .25rem !important; }
    .mt-2 { margin-top: .5rem !important; }
    .mt-3 { margin-top: 1rem !important; }
    .mt-4 { margin-top: 1.5rem !important; }
    .mt-5 { margin-top: 3rem !important; }
    .my-5 { margin-top: 3rem !important; margin-bottom: 3rem !important; }
    .me-2 { margin-right: .5rem !important; }
    .ms-2 { margin-left: .5rem !important; }
    .py-3 { padding-top: 1rem !important; padding-bottom: 1rem !important; }
    .px-5 { padding-left: 3rem !important; padding-right: 3rem !important; }
    .p-3 { padding: 1rem !important; }

    .d-flex { display: flex !important; }
    .d-none { display: none !important; }
    .d-block { display: block !important; }
    .align-items-center { align-items: center !important; }
    .align-items-start { align-items: flex-start !important; }
    .justify-content-center { justify-content: center !important; }
    .justify-content-between { justify-content: space-between !important; }
    .flex-wrap { flex-wrap: wrap !important; }
    .gap-3 { gap: 1rem !important; }
    .gap-4 { gap: 1.5rem !important; }

    .w-100 { width: 100% !important; }

    .fw-bold { font-weight: 700 !important; }
    .fw-semibold { font-weight: 600 !important; }
    .small { font-size: .875em; }
    .lead { font-size: 1.25rem; font-weight: 300; }

    .position-relative { position: relative !important; }

    /* Grid */
    .row {
      display: flex;
      flex-wrap: wrap;
      margin-right: -15px;
      margin-left: -15px;
    }

    .row > * {
      flex-shrink: 0;
      width: 100%;
      max-width: 100%;
      padding-right: 15px;
      padding-left: 15px;
    }

    .g-3 > * { padding: calc(1rem * .5); }
    .g-4 > * { padding: calc(1.5rem * .5); }

    @media (min-width: 768px) {
      .col-md-3 { flex: 0 0 auto; width: 25%; }
      .col-md-6 { flex: 0 0 auto; width: 50%; }
      .col-md-8 { flex: 0 0 auto; width: 66.666667%; }
    }

    .col-12 { flex: 0 0 auto; width: 100%; }

    /* Breadcrumb */
    .breadcrumb {
      display: flex;
      flex-wrap: wrap;
      padding: 0;
      margin-bottom: 1rem;
      list-style: none;
    }

    .breadcrumb-item + .breadcrumb-item::before {
      float: left;
      padding-right: .5rem;
      color: #6c757d;
      content: "/";
    }

    .breadcrumb-item a { color: var(--primary); text-decoration: none; }
    .breadcrumb-item a:hover { text-decoration: underline; }
    .breadcrumb-item.active { color: #961622 !important; }

    /* Step Indicator */
    .step-indicator {
      display: flex;
      justify-content: space-between;
      margin-bottom: 3rem;
      position: relative;
    }

    .step-indicator::before {
      content: '';
      position: absolute;
      top: 20px;
      left: 0;
      right: 0;
      height: 2px;
      background: #e0e0e0;
      z-index: 0;
    }

    .step {
      flex: 1;
      text-align: center;
      position: relative;
      z-index: 1;
    }

    .step-circle {
      width: 40px;
      height: 40px;
      border-radius: 50%;
      background: white;
      border: 2px solid #e0e0e0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 0.5rem;
      font-weight: 700;
      transition: all 0.3s ease;
    }

    .step.active .step-circle {
      background: var(--primary);
      border-color: var(--primary);
      color: white;
    }

    .step.completed .step-circle {
      background: #28a745;
      border-color: #28a745;
      color: white;
    }

    .step-label {
      font-size: 0.875rem;
      color: #666;
      font-weight: 600;
    }

    .step.active .step-label {
      color: var(--primary);
    }

    /* Plan Cards */
    .plan-card {
      border: 2px solid #dee2e6;
      border-radius: 16px;
      transition: all 0.3s ease;
      background: white;
      position: relative;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      padding: 2rem;
      height: 100%;
    }

    .plan-card:hover {
      transform: translateY(-5px);
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    }

    .plan-card.popular {
      border-color: var(--primary);
      border-width: 3px;
    }

    .plan-card.popular::before {
      content: 'MOST POPULAR';
      position: absolute;
      top: 18px;
      right: -40px;
      background: var(--primary);
      color: white;
      padding: 6px 50px;
      font-size: 0.65rem;
      font-weight: 700;
      letter-spacing: 1.5px;
      transform: rotate(45deg);
      box-shadow: 0 2px 8px rgba(150, 22, 34, 0.3);
      z-index: 10;
    }

    .plan-card h3 {
      font-size: 1.125rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      margin-bottom: 1.5rem;
      color: #212529;
    }

    .plan-price {
      font-size: 3.5rem;
      font-weight: 700;
      color: var(--primary);
      line-height: 1;
      font-family: var(--font-primary);
      margin: 0.5rem 0;
    }

    .plan-price .currency {
      font-size: 2rem;
      vertical-align: super;
    }

    .plan-price .period {
      font-size: 0.95rem;
      color: #6c757d;
      font-weight: 400;
      display: block;
      margin-top: 0.25rem;
    }

    .plan-subtitle {
      font-size: 0.9rem;
      color: #6c757d;
      margin-bottom: 1.5rem;
      min-height: 2rem;
    }

    .plan-subtitle.highlight {
      color: var(--primary);
      font-weight: 700;
      font-size: 0.95rem;
    }

    .plan-card .benefits {
      flex-grow: 1;
      margin: 1.5rem 0;
    }

    .benefit-item {
      padding: 0.625rem 0;
      border-bottom: 1px solid #f0f0f0;
      display: flex;
      align-items: flex-start;
      font-size: 0.9rem;
    }

    .benefit-item:first-child { padding-top: 0; }
    .benefit-item:last-child { border-bottom: none; padding-bottom: 0; }

    .benefit-item i {
      color: var(--primary);
      margin-right: 0.625rem;
      flex-shrink: 0;
      font-size: 1rem;
      margin-top: 0.125rem;
    }

    .benefit-item span {
      flex: 1;
      color: #495057;
      line-height: 1.5;
    }

    .benefit-item strong {
      color: #212529;
      font-weight: 600;
    }

    /* Buttons */
    .btn {
      display: inline-block;
      font-weight: 600;
      text-align: center;
      white-space: nowrap;
      vertical-align: middle;
      user-select: none;
      border: 1px solid transparent;
      padding: .5rem 1rem;
      font-size: 1rem;
      line-height: 1.5;
      border-radius: .375rem;
      transition: all .15s ease-in-out;
      text-decoration: none;
      cursor: pointer;
    }

    .btn-primary {
      background-color: var(--primary) !important;
      border-color: var(--primary) !important;
      color: #fff !important;
    }

    .btn-primary:hover {
      background-color: #78121b !important;
      border-color: #78121b !important;
    }

    .btn-outline-primary {
      color: var(--primary) !important;
      border: 2px solid var(--primary) !important;
      background: transparent;
    }

    .btn-outline-primary:hover {
      background: var(--primary) !important;
      color: white !important;
      border-color: var(--primary) !important;
    }

    .btn-outline-secondary {
      color: #6c757d;
      border: 2px solid #6c757d;
      background: transparent;
    }

    .btn-outline-secondary:hover {
      background: #6c757d;
      color: white;
    }

    .plan-card .btn {
      padding: 0.75rem 1.5rem;
      font-size: 0.875rem;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      border-radius: 8px;
      transition: all 0.2s ease;
      margin-top: auto;
    }

    /* Form Styles */
    .form-section {
      background: #f8f9fa;
      border-radius: 16px;
      padding: 2rem;
      margin-bottom: 2rem;
    }

    .form-label {
      font-weight: 600;
      color: #333;
      margin-bottom: 0.5rem;
      display: block;
    }

    .form-control, .form-select {
      display: block;
      width: 100%;
      border-radius: 8px;
      border: 2px solid #e0e0e0;
      padding: 0.75rem 1rem;
      font-size: 1rem;
      transition: all 0.3s ease;
      background-color: #fff;
    }

    .form-control:focus, .form-select:focus {
      border-color: var(--primary);
      box-shadow: 0 0 0 0.2rem rgba(150, 22, 34, 0.15);
      outline: none;
    }

    .invalid-feedback {
      font-size: 0.875rem;
      margin-top: 0.25rem;
      color: #dc3545;
      display: none;
    }

    .form-control.is-invalid ~ .invalid-feedback {
      display: block;
    }

    .input-group {
      position: relative;
      display: flex;
      flex-wrap: wrap;
      align-items: stretch;
      width: 100%;
    }

    .input-group > .form-control {
      position: relative;
      flex: 1 1 auto;
      width: 1%;
      min-width: 0;
    }

    .input-group-text {
      display: flex;
      align-items: center;
      padding: 0.75rem 1rem;
      font-size: 1rem;
      font-weight: 400;
      line-height: 1.5;
      color: #212529;
      text-align: center;
      white-space: nowrap;
      background-color: #f8f9fa;
      border: 2px solid #e0e0e0;
      border-radius: 8px;
    }

    /* Review Section */
    .review-section {
      background: white;
      border: 2px solid var(--primary);
      border-radius: 16px;
      padding: 2rem;
      margin-bottom: 2rem;
    }

    .review-item {
      display: flex;
      justify-content: space-between;
      padding: 0.75rem 0;
      border-bottom: 1px solid #e0e0e0;
    }

    .review-item:last-child { border-bottom: none; }

    .review-label {
      font-weight: 600;
      color: #666;
    }

    .review-value {
      font-weight: 600;
      color: #333;
      text-align: right;
    }

    /* Checkbox Cards */
    .checkbox-card {
      border: 2px solid #e0e0e0;
      border-radius: 12px;
      padding: 1.25rem;
      margin-bottom: 1rem;
      transition: all 0.3s ease;
      cursor: pointer;
    }

    .checkbox-card:hover {
      border-color: var(--primary);
      background-color: rgba(150, 22, 34, 0.02);
    }

    .form-check {
      position: relative;
      display: block;
      padding-left: 1.5rem;
    }

    .form-check-input {
      position: absolute;
      margin-top: .3rem;
      margin-left: -1.5rem;
    }

    .form-check-label {
      margin-bottom: 0;
    }

    /* Alert */
    .alert {
      position: relative;
      padding: 1rem 1rem;
      margin-bottom: 1rem;
      border: 1px solid transparent;
      border-radius: .375rem;
    }

    .alert-primary {
      color: #084298;
      background-color: #cfe2ff;
      border-color: #b6d4fe;
    }

    .alert-info {
      color: #055160;
      background-color: #cff4fc;
      border-color: #b6effb;
    }

    .alert-success {
      color: #0f5132;
      background-color: #d1e7dd;
      border-color: #badbcc;
    }

    .alert-danger {
      color: #842029;
      background-color: #f8d7da;
      border-color: #f5c2c7;
    }

    /* Success Animation */
    .success-animation {
      text-align: center;
      padding: 3rem 0;
    }

    .success-checkmark {
      width: 80px;
      height: 80px;
      border-radius: 50%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: #28a745;
      color: white;
      font-size: 3rem;
      margin-bottom: 1rem;
      animation: scaleIn 0.5s ease;
    }

    @keyframes scaleIn {
      from { transform: scale(0); }
      to { transform: scale(1); }
    }

    /* Icon placeholders */
    .bi::before, i.bi::before {
      display: inline-block;
      font-style: normal;
      font-variant: normal;
      text-rendering: auto;
      -webkit-font-smoothing: antialiased;
      width: 1em;
      text-align: center;
    }

    /* Spinner */
    .spinner-border {
      display: inline-block;
      width: 1rem;
      height: 1rem;
      vertical-align: -.125em;
      border: .2em solid currentColor;
      border-right-color: transparent;
      border-radius: 50%;
      animation: spinner-border .75s linear infinite;
    }

    .spinner-border-sm {
      width: 1rem;
      height: 1rem;
      border-width: .2em;
    }

    @keyframes spinner-border {
      100% { transform: rotate(360deg); }
    }

    /* Modal */
    .modal { z-index: 1055; }
    .modal-backdrop { z-index: 1050; }
    .modal-dialog { z-index: 1056; }
    .modal-content {
      z-index: 1057;
      border-radius: 16px;
      overflow: hidden;
      border: none;
      box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    }

    /* Links */
    a { color: var(--primary); text-decoration: none; }
    a:hover { color: #78121b; text-decoration: underline; }

    /* Content visibility for performance */
    #formStep,
    #reviewStep,
    #successStep {
      content-visibility: auto;
      contain-intrinsic-size: auto 800px;
    }

    /* Hide steps initially */
    #reviewStep, #successStep {
      display: none;
    }

    /* Responsive */
    @media (max-width: 991.98px) {
      :root { --header-height: 64px; }
      .header-logo { width: 100px; height: 40px; }
      .header-title { font-size: 1.25rem; }
      .header-tagline { font-size: .65rem; }
      .membership-hero h1 { font-size: 2.5rem; }
      .membership-hero .lead { font-size: 1rem; }
      .plan-price { font-size: 3rem; }
      .plan-price .currency { font-size: 1.75rem; }
    }

    @media (max-width: 767.98px) {
      .plan-card {
        padding: 2rem 1.5rem;
        margin-bottom: 2rem;
      }
      .plan-price { font-size: 2.5rem; }
      .plan-price .currency { font-size: 1.5rem; }
      .plan-card h3 { font-size: 1.1rem; }
      .benefit-item { font-size: 0.9rem; }
      .step-indicator { flex-wrap: wrap; gap: 1rem; }
      .step { flex: 0 0 30%; }
    }

    @media (max-width: 575.98px) {
      :root { --header-height: 60px; }
      .header-logo { width: 80px; height: 32px; }
      .header-title { font-size: 1rem; }
      .membership-hero h1 { font-size: 2rem; }
      .membership-hero .lead { font-size: 0.95rem; }
      .form-section { padding: 1.5rem 1rem; }
    }

    /* Navbar link styles */
    .navbar-nav .nav-link { color: rgba(255,255,255,.85) !important; }
    .navbar-nav .nav-link:hover, .navbar-nav .nav-link.active { color: #961622 !important; }

    /* Keep membership registration modals above shared header/backdrop overrides */
    #registrationErrorModal,
    #registrationInfoModal {
      z-index: 20010 !important;
      pointer-events: auto !important;
    }

    #registrationErrorModal .modal-dialog,
    #registrationInfoModal .modal-dialog {
      z-index: 20011 !important;
      pointer-events: auto !important;
    }

    #registrationErrorModal .modal-content,
    #registrationInfoModal .modal-content {
      z-index: 20012 !important;
      pointer-events: auto !important;
    }

    .modal-backdrop {
      z-index: 20000 !important;
    }

    #footer-placeholder .row > * {
      flex-shrink: 0;
      width: 100%;
      max-width: 100%;
      padding-right: 15px;
      padding-left: 15px;
    }

    /* sm: ≥576px */
    @media (min-width: 576px) {
      #footer-placeholder .col-sm-3  { flex: 0 0 auto; width: 25%; }
      #footer-placeholder .col-sm-4  { flex: 0 0 auto; width: 33.33333333%; }
      #footer-placeholder .col-sm-6  { flex: 0 0 auto; width: 50%; }
      #footer-placeholder .col-sm-8  { flex: 0 0 auto; width: 66.66666667%; }
      #footer-placeholder .col-sm-12 { flex: 0 0 auto; width: 100%; }
    }

    /* md: ≥768px — used by footer.html for col-md-6 / col-md-12 */
    @media (min-width: 768px) {
      #footer-placeholder .col-md-3  { flex: 0 0 auto; width: 25%; }
      #footer-placeholder .col-md-4  { flex: 0 0 auto; width: 33.33333333%; }
      #footer-placeholder .col-md-6  { flex: 0 0 auto; width: 50%; }
      #footer-placeholder .col-md-8  { flex: 0 0 auto; width: 66.66666667%; }
      #footer-placeholder .col-md-12 { flex: 0 0 auto; width: 100%; }   /* ← added */
    }

    /* lg: ≥992px — used by footer.html for col-lg-4 / col-lg-8 */
    @media (min-width: 992px) {
      #footer-placeholder .col-lg-3  { flex: 0 0 auto; width: 25%; }
      #footer-placeholder .col-lg-4  { flex: 0 0 auto; width: 33.33333333%; }
      #footer-placeholder .col-lg-6  { flex: 0 0 auto; width: 50%; }
      #footer-placeholder .col-lg-8  { flex: 0 0 auto; width: 66.66666667%; }  /* ← added */
      #footer-placeholder .col-lg-12 { flex: 0 0 auto; width: 100%; }
    }

    /* xl: ≥1200px (footer-bottom-bar uses col-lg-8 + col-lg-4 only,
      but include xl for completeness in case footer.html is updated) */
    @media (min-width: 1200px) {
      #footer-placeholder .col-xl-3  { flex: 0 0 auto; width: 25%; }
      #footer-placeholder .col-xl-4  { flex: 0 0 auto; width: 33.33333333%; }
      #footer-placeholder .col-xl-6  { flex: 0 0 auto; width: 50%; }
      #footer-placeholder .col-xl-8  { flex: 0 0 auto; width: 66.66666667%; }
      #footer-placeholder .col-xl-12 { flex: 0 0 auto; width: 100%; }
    }

    /* The newsletter "STAY UPDATED" panel — match the dark-red/maroon
      tone that footer.html emits via the bootstrap dark theme so the
      right column reads identically to the home page. */
    #footer-placeholder .footer-bottom-bar { background: #111111; }
    #footer-placeholder .row.gx-5 { --bs-gutter-x: 3rem; }

