/* ==========================================================================
   custom.css — Баяр наадмын зөвшөөрлийн бүртгэлийн форм
   Bootstrap 5 CSS variable системтэй нийцүүлэн бичигдсэн.
   Light / Dark mode автоматаар дэмжинэ.
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties — форм хувьсагчид
   (Bootstrap vars-д тулгуурлана, тусдаа override хэрэгтэй бол энд нэм)
   -------------------------------------------------------------------------- */
:root,
[data-bs-theme="light"] {
  --lf-primary:          #1a5276;
  --lf-primary-end:      #2e86c1;
  --lf-primary-text:     #2e86c1;
  --lf-header-text:      #ffffff;
  --lf-header-sub:       rgba(255, 255, 255, 0.88);

  --lf-info-bg:          #eaf4fb;
  --lf-info-border:      #2e86c1;
  --lf-info-color:       #1a3a4a;
  --lf-info-strong:      #1a5276;

  --lf-warn-bg:          #fef9e7;
  --lf-warn-border:      #f39c12;
  --lf-warn-color:       #7d6608;
  --lf-warn-strong:      #b7770d;

  --lf-body-bg:          #ffffff;
  --lf-body-border:      #d6e4f0;

  --lf-section-color:    #2e86c1;
  --lf-section-border:   #d6e4f0;

  --lf-label-color:      #34495e;
  --lf-input-border:     #c8d6e0;
  --lf-input-focus:      #2e86c1;
  --lf-input-focus-shadow: rgba(46, 134, 193, 0.18);

  --lf-file-bg:          #f8fbfd;
  --lf-file-border:      #e8f0f7;
  --lf-file-border-hover:#aed6f1;
  --lf-file-input-border:#aed6f1;
  --lf-file-label-color: #2c3e50;
  --lf-file-num-bg:      #2e86c1;
  --lf-file-num-color:   #ffffff;
  --lf-hint-color:       #7f8c8d;
  --lf-error-color:      #e74c3c;
  --lf-req-color:        #e74c3c;

  --lf-submit-bg:        #1a5276;
  --lf-submit-hover:     #2e86c1;
  --lf-submit-text:      #ffffff;

  --lf-divider:          #eaf0f6;
  --lf-link-btn-bg:      rgba(255, 255, 255, 0.18);
  --lf-link-btn-border:  rgba(255, 255, 255, 0.4);
  --lf-link-btn-hover:   rgba(255, 255, 255, 0.32);
}

[data-bs-theme="dark"] {
  --lf-primary:          #2563a8;
  --lf-primary-end:      #1a4a7a;
  --lf-primary-text:     #7eb8e8;
  --lf-header-text:      #f0f4f8;
  --lf-header-sub:       rgba(220, 235, 248, 0.82);

  --lf-info-bg:          #0f1e2e;
  --lf-info-border:      #2e6fa3;
  --lf-info-color:       #aac8e0;
  --lf-info-strong:      #7eb8e8;

  --lf-warn-bg:          #1e1700;
  --lf-warn-border:      #a07010;
  --lf-warn-color:       #d4aa50;
  --lf-warn-strong:      #e0be60;

  --lf-body-bg:          var(--bs-body-bg, #050401);
  --lf-body-border:      var(--bs-border-color, #576071);

  --lf-section-color:    #7eb8e8;
  --lf-section-border:   var(--bs-border-color, #576071);

  --lf-label-color:      var(--bs-emphasis-color, #f6f9fc);
  --lf-input-border:     var(--bs-border-color, #576071);
  --lf-input-focus:      #5ba3d4;
  --lf-input-focus-shadow: rgba(91, 163, 212, 0.22);

  --lf-file-bg:          var(--bs-tertiary-bg, #2b3038);
  --lf-file-border:      var(--bs-border-color, #576071);
  --lf-file-border-hover:#5ba3d4;
  --lf-file-input-border:#4a6880;
  --lf-file-label-color: var(--bs-emphasis-color, #f6f9fc);
  --lf-file-num-bg:      #2e6fa3;
  --lf-file-num-color:   #e8f4ff;
  --lf-hint-color:       var(--bs-secondary-color, #a0a8b2);
  --lf-error-color:      #f87171;
  --lf-req-color:        #f87171;

  --lf-submit-bg:        #2563a8;
  --lf-submit-hover:     #3b82c4;
  --lf-submit-text:      #f0f4f8;

  --lf-divider:          var(--bs-border-color, #576071);
  --lf-link-btn-bg:      rgba(255, 255, 255, 0.10);
  --lf-link-btn-border:  rgba(255, 255, 255, 0.22);
  --lf-link-btn-hover:   rgba(255, 255, 255, 0.20);
}

/* OS-level dark mode fallback (theme switcher дарахаас өмнө) */
@media (prefers-color-scheme: dark) {
  :root:not([data-bs-theme="light"]) {
    --lf-primary:          #2563a8;
    --lf-primary-end:      #1a4a7a;
    --lf-primary-text:     #7eb8e8;
    --lf-header-text:      #f0f4f8;
    --lf-header-sub:       rgba(220, 235, 248, 0.82);
    --lf-info-bg:          #0f1e2e;
    --lf-info-border:      #2e6fa3;
    --lf-info-color:       #aac8e0;
    --lf-info-strong:      #7eb8e8;
    --lf-warn-bg:          #1e1700;
    --lf-warn-border:      #a07010;
    --lf-warn-color:       #d4aa50;
    --lf-warn-strong:      #e0be60;
    --lf-body-bg:          #050401;
    --lf-body-border:      #576071;
    --lf-section-color:    #7eb8e8;
    --lf-section-border:   #576071;
    --lf-label-color:      #f6f9fc;
    --lf-input-border:     #576071;
    --lf-input-focus:      #5ba3d4;
    --lf-input-focus-shadow: rgba(91, 163, 212, 0.22);
    --lf-file-bg:          #2b3038;
    --lf-file-border:      #576071;
    --lf-file-border-hover:#5ba3d4;
    --lf-file-input-border:#4a6880;
    --lf-file-label-color: #f6f9fc;
    --lf-file-num-bg:      #2e6fa3;
    --lf-file-num-color:   #e8f4ff;
    --lf-hint-color:       #a0a8b2;
    --lf-error-color:      #f87171;
    --lf-req-color:        #f87171;
    --lf-submit-bg:        #2563a8;
    --lf-submit-hover:     #3b82c4;
    --lf-submit-text:      #f0f4f8;
    --lf-divider:          #576071;
    --lf-link-btn-bg:      rgba(255, 255, 255, 0.10);
    --lf-link-btn-border:  rgba(255, 255, 255, 0.22);
    --lf-link-btn-hover:   rgba(255, 255, 255, 0.20);
  }
}

/* ==========================================================================
   License Form — бүтэц
   ========================================================================== */

.license-form-wrapper {
  font-family: inherit;
}

/* --- Header --- */
.license-form-wrapper .form-header {
  background: linear-gradient(135deg, var(--lf-primary), var(--lf-primary-end));
  color: var(--lf-header-text);
  border-radius: 8px 8px 0 0;
  padding: 20px 24px 22px;
  position: relative;
}

.license-form-wrapper .form-header h3 {
  margin: 0 0 6px 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--lf-header-text);
  line-height: 1.4;
  padding-right: 110px;
}

.license-form-wrapper .form-header p {
  margin: 0;
  font-size: 13px;
  color: var(--lf-header-sub);
}

.license-form-wrapper .form-header .list-link {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--lf-link-btn-bg);
  color: var(--lf-header-text);
  border: 1px solid var(--lf-link-btn-border);
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 12px;
  text-decoration: none;
  transition: background 0.2s;
  white-space: nowrap;
}

.license-form-wrapper .form-header .list-link:hover {
  background: var(--lf-link-btn-hover);
  text-decoration: none;
  color: var(--lf-header-text);
}

/* --- Info boxes --- */
.license-form-wrapper .info-box {
  background: var(--lf-info-bg);
  border-left: 4px solid var(--lf-info-border);
  padding: 12px 16px;
  font-size: 13px;
  color: var(--lf-info-color);
  border-radius: 0;
  transition: background 0.3s, color 0.3s;
}

/* About мэдээлэл хайрцаг */
.license-form-wrapper .info-box--about {
  border-top: none;
}

/* Холбоо барих хайрцаг — дээрхтэй зөөлөн зааглана */
.license-form-wrapper .info-box--contact {
  border-top: 1px solid var(--lf-body-border);
}

.license-form-wrapper .contact-row--phone {
  margin-top: 8px;
}

.license-form-wrapper .info-box strong {
  display: block;
  margin-bottom: 3px;
  color: var(--lf-info-strong);
}

.license-form-wrapper .info-box .contact-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.license-form-wrapper .info-box .contact-row span {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* --- Warning box --- */
.license-form-wrapper .warning-box {
  background: var(--lf-warn-bg);
  border-left: 4px solid var(--lf-warn-border);
  padding: 11px 16px;
  font-size: 13px;
  color: var(--lf-warn-color);
  transition: background 0.3s, color 0.3s;
}

.license-form-wrapper .warning-box strong {
  color: var(--lf-warn-strong);
}

/* --- Form body --- */
.license-form-wrapper .form-body {
  background: var(--lf-body-bg);
  border: 1px solid var(--lf-body-border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 24px;
  transition: background 0.3s, border-color 0.3s;
}

/* --- Section labels --- */
.license-form-wrapper .section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--lf-section-color);
  border-bottom: 1px solid var(--lf-section-border);
  padding-bottom: 7px;
  margin: 26px 0 16px 0;
}

.license-form-wrapper .section-label:first-of-type {
  margin-top: 0;
}

/* --- Form elements --- */
.license-form-wrapper .form-group {
  margin-bottom: 16px;
}

.license-form-wrapper label.control-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--lf-label-color);
  padding-top: 7px;
}

.license-form-wrapper label.control-label .req {
  color: var(--lf-req-color);
  margin-left: 2px;
}

.license-form-wrapper .form-control {
  border-radius: 5px;
  border-color: var(--lf-input-border);
  font-size: 13px;
  height: 36px;
  background-color: var(--bs-body-bg, #fff);
  color: var(--bs-body-color, #212529);
  transition: border-color 0.18s, box-shadow 0.18s, background-color 0.3s, color 0.3s;
}

.license-form-wrapper .form-control:focus {
  border-color: var(--lf-input-focus);
  box-shadow: 0 0 0 3px var(--lf-input-focus-shadow);
  background-color: var(--bs-body-bg, #fff);
  color: var(--bs-body-color, #212529);
}

.license-form-wrapper select.form-control {
  height: 36px;
}

/* --- File hint text --- */
.license-form-wrapper .file-hint {
  font-size: 11px;
  color: var(--lf-hint-color);
  margin-top: 3px;
}

.license-form-wrapper .file-hint.error-hint {
  color: var(--lf-error-color);
  display: none;
}

/* --- File upload groups --- */
.license-form-wrapper .file-group {
  border: 1px solid var(--lf-file-border);
  border-radius: 6px;
  padding: 12px 14px 10px;
  margin-bottom: 10px;
  background: var(--lf-file-bg);
  transition: border-color 0.2s, background 0.3s;
}

.license-form-wrapper .file-group:hover {
  border-color: var(--lf-file-border-hover);
}

.license-form-wrapper .file-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--lf-file-label-color);
  margin-bottom: 6px;
  display: flex;
  align-items: flex-start;
  gap: 0;
  flex-wrap: wrap;
}

.license-form-wrapper .file-group label .req {
  color: var(--lf-req-color);
  margin-left: 2px;
}

.license-form-wrapper .file-group .file-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  background: var(--lf-file-num-bg);
  color: var(--lf-file-num-color);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  margin-right: 7px;
  margin-top: 1px;
  flex-shrink: 0;
  transition: background 0.3s;
}

.license-form-wrapper .file-group input[type="file"] {
  display: block;
  width: 100%;
  font-size: 12px;
  padding: 5px 8px;
  border: 1px dashed var(--lf-file-input-border);
  border-radius: 4px;
  background: var(--lf-body-bg);
  color: var(--bs-body-color, #212529);
  cursor: pointer;
  transition: border-color 0.2s, background 0.3s, color 0.3s;
}

.license-form-wrapper .file-group input[type="file"]:focus {
  outline: 2px solid var(--lf-input-focus);
  outline-offset: 1px;
}

.license-form-wrapper .file-group input[type="file"]:hover {
  border-color: var(--lf-file-border-hover);
}

/* --- Inline file alert (bootstrap override) --- */
.license-form-wrapper .alert-info,
.license-form-wrapper .lf-file-alert {
  background-color: var(--lf-info-bg);
  border-color: var(--lf-info-border);
  color: var(--lf-info-color);
  font-size: 13px;
  padding: 10px 14px;
  margin-bottom: 16px;
  transition: background 0.3s, color 0.3s;
}

.license-form-wrapper .alert-info strong,
.license-form-wrapper .lf-file-alert strong {
  color: var(--lf-info-strong);
}

/* --- Файлын нэрийн туслах текст --- */
.license-form-wrapper .lf-small-hint {
  font-weight: 400;
  color: var(--lf-hint-color);
}

/* --- Submit row --- */
.license-form-wrapper .submit-row {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--lf-divider);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.license-form-wrapper .btn-submit {
  background: var(--lf-submit-bg);
  color: var(--lf-submit-text);
  border: none;
  border-radius: 5px;
  padding: 9px 28px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.02em;
}

.license-form-wrapper .btn-submit:hover {
  background: var(--lf-submit-hover);
}

.license-form-wrapper .btn-submit:active {
  transform: scale(0.98);
}

.license-form-wrapper .req-note {
  font-size: 12px;
  color: var(--lf-hint-color);
}

.license-form-wrapper .req-note span {
  color: var(--lf-req-color);
}

/* --- PHP server-side validation error box --- */
.license-form-wrapper .lf-php-errors {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-left: 4px solid var(--lf-error-color);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #7f1d1d;
  transition: background 0.3s, color 0.3s;
}

[data-bs-theme="dark"] .license-form-wrapper .lf-php-errors {
  background: #2d0a0a;
  border-color: #7f1d1d;
  color: #fca5a5;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-bs-theme="light"]) .license-form-wrapper .lf-php-errors {
    background: #2d0a0a;
    border-color: #7f1d1d;
    color: #fca5a5;
  }
}

.license-form-wrapper .lf-php-errors__icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}

.license-form-wrapper .lf-php-errors strong {
  display: block;
  margin-bottom: 6px;
  color: inherit;
  font-weight: 700;
}

.license-form-wrapper .lf-php-errors ul {
  margin: 0;
  padding-left: 18px;
}

.license-form-wrapper .lf-php-errors ul li {
  margin-bottom: 3px;
  line-height: 1.5;
}

/* --- JS / PHP validation error feedback --- */
.license-form-wrapper .lf-field-error {
  display: none;
  align-items: flex-start;
  gap: 5px;
  font-size: 12px;
  color: var(--lf-error-color);
  margin-top: 5px;
  line-height: 1.4;
  font-weight: 500;
}

.license-form-wrapper .lf-field-error::before {
  content: '⚠';
  font-size: 11px;
  margin-top: 1px;
  flex-shrink: 0;
}

/* Invalid state — input/select border */
.license-form-wrapper .lf-input-invalid,
.license-form-wrapper .form-control.lf-input-invalid {
  border-color: var(--lf-error-color) !important;
  box-shadow: 0 0 0 2px rgba(231, 76, 60, 0.15) !important;
}

/* File group invalid */
.license-form-wrapper .file-group input[type="file"].lf-input-invalid {
  border-color: var(--lf-error-color);
  border-style: dashed;
}

/* Legacy .invalid-feedback дэмжих */
.license-form-wrapper .invalid-feedback {
  font-size: 11px;
  color: var(--lf-error-color);
}

.license-form-wrapper .was-validated .form-control:invalid,
.license-form-wrapper .form-control.is-invalid {
  border-color: var(--lf-error-color);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .license-form-wrapper .form-header {
    padding: 16px 16px 18px;
  }

  .license-form-wrapper .form-header h3 {
    font-size: 14px;
    padding-right: 0;
    margin-bottom: 10px;
  }

  .license-form-wrapper .form-header .list-link {
    position: static;
    display: inline-block;
    margin-top: 8px;
  }

  .license-form-wrapper .form-body {
    padding: 14px;
  }

  .license-form-wrapper .submit-row {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   INDEX PAGE — Hero Countdown + Sections
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS vars for index page components
   -------------------------------------------------------------------------- */
:root,
[data-bs-theme="light"] {
  --idx-hero-from:       #0d2137;
  --idx-hero-to:         #1a4a7a;
  --idx-hero-text:       #ffffff;
  --idx-hero-sub:        rgba(200, 230, 255, 0.80);
  --idx-hero-badge-bg:   rgba(255,255,255,0.12);
  --idx-hero-badge-border: rgba(255,255,255,0.30);

  --idx-cd-box-bg:       rgba(255,255,255,0.10);
  --idx-cd-box-border:   rgba(255,255,255,0.20);
  --idx-cd-num:          #ffffff;
  --idx-cd-label:        rgba(200,225,255,0.75);
  --idx-cd-sep:          rgba(255,255,255,0.50);

  --idx-status-open-bg:  #d1fae5;
  --idx-status-open-text:#065f46;
  --idx-status-open-dot: #10b981;
  --idx-status-wait-bg:  #fef3c7;
  --idx-status-wait-text:#92400e;
  --idx-status-wait-dot: #f59e0b;
  --idx-status-end-bg:   #fee2e2;
  --idx-status-end-text: #991b1b;
  --idx-status-end-dot:  #ef4444;

  --idx-section-bg:      #f8fbfd;
  --idx-card-bg:         #ffffff;
  --idx-card-border:     #e0eaf4;
  --idx-card-shadow:     0 2px 12px rgba(26,82,118,0.07);
  --idx-card-icon-bg:    #e8f4fb;
  --idx-card-icon-color: #1a5276;
  --idx-card-title:      #1a3a4a;
  --idx-card-text:       #4a6070;

  --idx-step-num-bg:     #2e86c1;
  --idx-step-num-color:  #ffffff;
  --idx-step-line:       #d0e8f5;

  --idx-table-head-bg:   #1a5276;
  --idx-table-head-text: #ffffff;
  --idx-table-row-even:  #f0f7fc;
  --idx-table-row-odd:   #ffffff;
  --idx-table-border:    #d6e8f5;
  --idx-table-active-bg: #d1fae5;
  --idx-table-active-text:#065f46;
  --idx-table-pending-text: #6b7280;

  --idx-section-title:   #1a3a4a;
  --idx-divider:         #d6e8f5;
  --idx-tab-active-bg:   #2e86c1;
  --idx-tab-active-text: #ffffff;
  --idx-tab-bg:          #eaf4fb;
  --idx-tab-text:        #2e86c1;
  --idx-tab-border:      #aed6f1;
}

[data-bs-theme="dark"] {
  --idx-hero-from:       #020d1a;
  --idx-hero-to:         #0a2540;
  --idx-hero-text:       #e8f4ff;
  --idx-hero-sub:        rgba(160, 200, 240, 0.75);
  --idx-hero-badge-bg:   rgba(255,255,255,0.08);
  --idx-hero-badge-border: rgba(255,255,255,0.18);

  --idx-cd-box-bg:       rgba(255,255,255,0.07);
  --idx-cd-box-border:   rgba(255,255,255,0.14);
  --idx-cd-num:          #e8f4ff;
  --idx-cd-label:        rgba(160,200,240,0.70);
  --idx-cd-sep:          rgba(255,255,255,0.30);

  --idx-status-open-bg:  #052e16;
  --idx-status-open-text:#6ee7b7;
  --idx-status-open-dot: #10b981;
  --idx-status-wait-bg:  #1c1400;
  --idx-status-wait-text:#fbbf24;
  --idx-status-wait-dot: #f59e0b;
  --idx-status-end-bg:   #2d0a0a;
  --idx-status-end-text: #fca5a5;
  --idx-status-end-dot:  #ef4444;

  --idx-section-bg:      var(--bs-body-bg, #050401);
  --idx-card-bg:         var(--bs-tertiary-bg, #2b3038);
  --idx-card-border:     var(--bs-border-color, #576071);
  --idx-card-shadow:     0 2px 12px rgba(0,0,0,0.30);
  --idx-card-icon-bg:    rgba(46,134,193,0.15);
  --idx-card-icon-color: #7eb8e8;
  --idx-card-title:      var(--bs-emphasis-color, #f6f9fc);
  --idx-card-text:       var(--bs-secondary-color, #a0a8b2);

  --idx-step-num-bg:     #2563a8;
  --idx-step-num-color:  #e8f4ff;
  --idx-step-line:       #2d3a4a;

  --idx-table-head-bg:   #0a2540;
  --idx-table-head-text: #b0d4f0;
  --idx-table-row-even:  var(--bs-tertiary-bg, #2b3038);
  --idx-table-row-odd:   var(--bs-secondary-bg, #434a57);
  --idx-table-border:    var(--bs-border-color, #576071);
  --idx-table-active-bg: #052e16;
  --idx-table-active-text:#6ee7b7;
  --idx-table-pending-text: var(--bs-secondary-color, #a0a8b2);

  --idx-section-title:   var(--bs-emphasis-color, #f6f9fc);
  --idx-divider:         var(--bs-border-color, #576071);
  --idx-tab-active-bg:   #2563a8;
  --idx-tab-active-text: #e8f4ff;
  --idx-tab-bg:          rgba(46,134,193,0.12);
  --idx-tab-text:        #7eb8e8;
  --idx-tab-border:      #2e6fa3;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-bs-theme="light"]) {
    --idx-hero-from:       #020d1a;
    --idx-hero-to:         #0a2540;
    --idx-hero-text:       #e8f4ff;
    --idx-hero-sub:        rgba(160, 200, 240, 0.75);
    --idx-hero-badge-bg:   rgba(255,255,255,0.08);
    --idx-hero-badge-border: rgba(255,255,255,0.18);
    --idx-cd-box-bg:       rgba(255,255,255,0.07);
    --idx-cd-box-border:   rgba(255,255,255,0.14);
    --idx-cd-num:          #e8f4ff;
    --idx-cd-label:        rgba(160,200,240,0.70);
    --idx-cd-sep:          rgba(255,255,255,0.30);
    --idx-status-open-bg:  #052e16;
    --idx-status-open-text:#6ee7b7;
    --idx-status-open-dot: #10b981;
    --idx-status-wait-bg:  #1c1400;
    --idx-status-wait-text:#fbbf24;
    --idx-status-wait-dot: #f59e0b;
    --idx-status-end-bg:   #2d0a0a;
    --idx-status-end-text: #fca5a5;
    --idx-status-end-dot:  #ef4444;
    --idx-section-bg:      #050401;
    --idx-card-bg:         #2b3038;
    --idx-card-border:     #576071;
    --idx-card-shadow:     0 2px 12px rgba(0,0,0,0.30);
    --idx-card-icon-bg:    rgba(46,134,193,0.15);
    --idx-card-icon-color: #7eb8e8;
    --idx-card-title:      #f6f9fc;
    --idx-card-text:       #a0a8b2;
    --idx-step-num-bg:     #2563a8;
    --idx-step-num-color:  #e8f4ff;
    --idx-step-line:       #2d3a4a;
    --idx-table-head-bg:   #0a2540;
    --idx-table-head-text: #b0d4f0;
    --idx-table-row-even:  #2b3038;
    --idx-table-row-odd:   #434a57;
    --idx-table-border:    #576071;
    --idx-table-active-bg: #052e16;
    --idx-table-active-text:#6ee7b7;
    --idx-table-pending-text: #a0a8b2;
    --idx-section-title:   #f6f9fc;
    --idx-divider:         #576071;
    --idx-tab-active-bg:   #2563a8;
    --idx-tab-active-text: #e8f4ff;
    --idx-tab-bg:          rgba(46,134,193,0.12);
    --idx-tab-text:        #7eb8e8;
    --idx-tab-border:      #2e6fa3;
  }
}

/* --------------------------------------------------------------------------
   Hero section
   -------------------------------------------------------------------------- */
.idx-hero {
  background: linear-gradient(155deg, var(--idx-hero-from) 0%, var(--idx-hero-to) 100%);
  padding: 56px 0 48px;
  position: relative;
  overflow: hidden;
}

.idx-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 80% 50%, rgba(46,134,193,0.18) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 10% 80%, rgba(26,82,118,0.25) 0%, transparent 60%);
  pointer-events: none;
}

.idx-hero .container { position: relative; z-index: 1; }

.idx-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--idx-hero-badge-bg);
  border: 1px solid var(--idx-hero-badge-border);
  color: var(--idx-hero-sub);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.idx-hero h1 {
  color: var(--idx-hero-text);
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
  line-height: 1.35;
  margin: 0 0 10px 0;
}

.idx-hero-subtitle {
  color: var(--idx-hero-sub);
  font-size: 14px;
  margin: 0 0 28px 0;
  max-width: 560px;
}

/* Status badge */
.idx-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 28px;
}
.idx-status-badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.idx-status-badge.status--wait   { background: var(--idx-status-wait-bg); color: var(--idx-status-wait-text); }
.idx-status-badge.status--wait .dot { background: var(--idx-status-wait-dot); animation: pulse-dot 1.4s infinite; }
.idx-status-badge.status--open   { background: var(--idx-status-open-bg); color: var(--idx-status-open-text); }
.idx-status-badge.status--open .dot { background: var(--idx-status-open-dot); animation: pulse-dot 1.4s infinite; }
.idx-status-badge.status--ended  { background: var(--idx-status-end-bg); color: var(--idx-status-end-text); }
.idx-status-badge.status--ended .dot { background: var(--idx-status-end-dot); }

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.75); }
}

/* --------------------------------------------------------------------------
   Countdown
   -------------------------------------------------------------------------- */
.idx-countdown {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

.idx-cd-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
}

.idx-cd-box {
  background: var(--idx-cd-box-bg);
  border: 1px solid var(--idx-cd-box-border);
  border-radius: 10px;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.idx-cd-num {
  font-size: 32px;
  font-weight: 800;
  color: var(--idx-cd-num);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  font-feature-settings: "tnum";
}

.idx-cd-label {
  font-size: 11px;
  color: var(--idx-cd-label);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}

.idx-cd-sep {
  font-size: 28px;
  font-weight: 700;
  color: var(--idx-cd-sep);
  margin-top: 18px;
  line-height: 1;
  align-self: flex-start;
}

/* --------------------------------------------------------------------------
   Period info row
   -------------------------------------------------------------------------- */
.idx-period-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.10);
}

.idx-period-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--idx-hero-sub);
  font-size: 13px;
}

.idx-period-item strong {
  color: var(--idx-hero-text);
}

.idx-list-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.28);
  color: var(--idx-hero-text);
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
  margin-top: 4px;
}
.idx-list-btn:hover {
  background: rgba(255,255,255,0.20);
  color: var(--idx-hero-text);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Info cards section
   -------------------------------------------------------------------------- */
.idx-section {
  background: var(--idx-section-bg);
  padding: 40px 0;
  transition: background 0.3s;
}

.idx-section + .idx-section {
  border-top: 1px solid var(--idx-divider);
}

.idx-section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--idx-section-title);
  margin: 0 0 4px 0;
}

.idx-section-sub {
  font-size: 13px;
  color: var(--idx-card-text);
  margin: 0 0 28px 0;
}

/* Info card */
.idx-info-card {
  background: var(--idx-card-bg);
  border: 1px solid var(--idx-card-border);
  border-radius: 10px;
  padding: 20px;
  height: 100%;
  box-shadow: var(--idx-card-shadow);
  transition: background 0.3s, border-color 0.2s, box-shadow 0.2s;
}

.idx-info-card:hover {
  box-shadow: 0 6px 24px rgba(26,82,118,0.12);
  border-color: var(--lf-info-border);
}

.idx-info-card .card-icon {
  width: 44px; height: 44px;
  background: var(--idx-card-icon-bg);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  color: var(--idx-card-icon-color);
  margin-bottom: 14px;
  flex-shrink: 0;
  transition: background 0.3s;
}

.idx-info-card h6 {
  font-size: 14px;
  font-weight: 700;
  color: var(--idx-card-title);
  margin: 0 0 8px 0;
}

.idx-info-card p, .idx-info-card ul {
  font-size: 13px;
  color: var(--idx-card-text);
  margin: 0;
  line-height: 1.6;
}

.idx-info-card ul {
  padding-left: 16px;
}

.idx-info-card ul li {
  margin-bottom: 4px;
}

/* Steps */
.idx-steps {
  display: flex;
  gap: 0;
  position: relative;
  flex-wrap: wrap;
}

.idx-step {
  flex: 1;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 12px;
  position: relative;
}

.idx-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 21px;
  left: calc(50% + 22px);
  right: calc(-50% + 22px);
  height: 2px;
  background: var(--idx-step-line);
}

.idx-step-num {
  width: 44px; height: 44px;
  background: var(--idx-step-num-bg);
  color: var(--idx-step-num-color);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  transition: background 0.3s;
}

.idx-step h6 {
  font-size: 13px;
  font-weight: 700;
  color: var(--idx-card-title);
  margin: 0 0 4px 0;
}

.idx-step p {
  font-size: 12px;
  color: var(--idx-card-text);
  margin: 0;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Registration list
   -------------------------------------------------------------------------- */
.idx-list-section {
  background: var(--idx-section-bg);
  padding: 40px 0;
  border-top: 1px solid var(--idx-divider);
  transition: background 0.3s;
}

/* Category tabs */
.idx-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.idx-tab {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--idx-tab-border);
  background: var(--idx-tab-bg);
  color: var(--idx-tab-text);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.idx-tab:hover,
.idx-tab.active {
  background: var(--idx-tab-active-bg);
  color: var(--idx-tab-active-text);
  border-color: var(--idx-tab-active-bg);
  text-decoration: none;
}

.idx-tab .count {
  background: rgba(255,255,255,0.20);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
}

/* Table */
.idx-table-wrap {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--idx-table-border);
  box-shadow: var(--idx-card-shadow);
}

.idx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.idx-table thead tr {
  background: var(--idx-table-head-bg);
}

.idx-table thead th {
  color: var(--idx-table-head-text);
  font-weight: 700;
  padding: 12px 14px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: none;
  white-space: nowrap;
}

.idx-table tbody tr:nth-child(odd) {
  background: var(--idx-table-row-odd);
}
.idx-table tbody tr:nth-child(even) {
  background: var(--idx-table-row-even);
}

.idx-table tbody td {
  padding: 10px 14px;
  color: var(--idx-card-text);
  border-bottom: 1px solid var(--idx-table-border);
  vertical-align: middle;
}

.idx-table tbody td:first-child {
  color: var(--idx-card-text);
  font-weight: 600;
  opacity: 0.6;
  width: 40px;
  text-align: center;
}

.idx-table tbody td.org-name {
  color: var(--idx-card-title);
  font-weight: 600;
}

.idx-badge-active {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--idx-table-active-bg);
  color: var(--idx-table-active-text);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
}

.idx-badge-pending {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--idx-cd-box-bg);
  color: var(--idx-table-pending-text);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--idx-table-border);
}

.idx-empty-row td {
  text-align: center;
  padding: 32px !important;
  color: var(--idx-card-text);
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Countdown ended / waiting message
   -------------------------------------------------------------------------- */
.idx-message-box {
  text-align: center;
  padding: 32px 24px;
  background: var(--idx-cd-box-bg);
  border: 1px solid var(--idx-cd-box-border);
  border-radius: 12px;
  color: var(--idx-hero-text);
  margin-top: 24px;
}

.idx-message-box .msg-icon {
  font-size: 36px;
  margin-bottom: 12px;
  display: block;
}

.idx-message-box h4 {
  color: var(--idx-hero-text);
  font-weight: 700;
  margin: 0 0 6px 0;
  font-size: 17px;
}

.idx-message-box p {
  color: var(--idx-hero-sub);
  margin: 0;
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .idx-hero { padding: 36px 0 32px; }
  .idx-cd-box { width: 58px; height: 58px; }
  .idx-cd-num { font-size: 26px; }
  .idx-cd-unit { min-width: 58px; }
  .idx-step:not(:last-child)::after { display: none; }
  .idx-period-row { gap: 12px; }
}

/* ==========================================================================
   GROUP SELECTOR CARDS
   ========================================================================== */

:root,
[data-bs-theme="light"] {
  --gc-bg:           #ffffff;
  --gc-border:       #d6e4f0;
  --gc-border-hover: #7eb8e8;
  --gc-border-active:#2e86c1;
  --gc-shadow:       0 2px 12px rgba(26,82,118,0.08);
  --gc-shadow-hover: 0 6px 24px rgba(26,82,118,0.14);
  --gc-shadow-active:0 0 0 3px rgba(46,134,193,0.20);
  --gc-icon-bg:      #eaf4fb;
  --gc-icon-color:   #1a5276;
  --gc-title:        #1a3a4a;
  --gc-text:         #4a6070;
  --gc-count-bg:     #eaf4fb;
  --gc-count-text:   #2e86c1;
  --gc-check-bg:     #2e86c1;
  --gc-check-color:  #ffffff;
  --gc-next-bg:      #1a5276;
  --gc-next-hover:   #2e86c1;
  --gc-next-disabled:#b4bbc3;
  --gc-next-text:    #ffffff;
  --gc-hint-color:   #7f8c8d;
  --gc-back-bg:      transparent;
  --gc-back-border:  var(--lf-input-border);
  --gc-back-color:   var(--lf-label-color);
  --gc-label-bg:     #eaf4fb;
  --gc-label-color:  #1a5276;
}

[data-bs-theme="dark"] {
  --gc-bg:           var(--bs-tertiary-bg, #2b3038);
  --gc-border:       var(--bs-border-color, #576071);
  --gc-border-hover: #5ba3d4;
  --gc-border-active:#5ba3d4;
  --gc-shadow:       0 2px 12px rgba(0,0,0,0.25);
  --gc-shadow-hover: 0 6px 24px rgba(0,0,0,0.35);
  --gc-shadow-active:0 0 0 3px rgba(91,163,212,0.22);
  --gc-icon-bg:      rgba(46,134,193,0.15);
  --gc-icon-color:   #7eb8e8;
  --gc-title:        var(--bs-emphasis-color, #f6f9fc);
  --gc-text:         var(--bs-secondary-color, #a0a8b2);
  --gc-count-bg:     rgba(46,134,193,0.12);
  --gc-count-text:   #7eb8e8;
  --gc-check-bg:     #2563a8;
  --gc-check-color:  #e8f4ff;
  --gc-next-bg:      #2563a8;
  --gc-next-hover:   #3b82c4;
  --gc-next-disabled:#434a57;
  --gc-next-text:    #e8f4ff;
  --gc-hint-color:   var(--bs-secondary-color, #a0a8b2);
  --gc-back-bg:      transparent;
  --gc-back-border:  var(--bs-border-color, #576071);
  --gc-back-color:   var(--bs-secondary-color, #a0a8b2);
  --gc-label-bg:     rgba(46,134,193,0.12);
  --gc-label-color:  #7eb8e8;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-bs-theme="light"]) {
    --gc-bg:           #2b3038;
    --gc-border:       #576071;
    --gc-border-hover: #5ba3d4;
    --gc-border-active:#5ba3d4;
    --gc-shadow:       0 2px 12px rgba(0,0,0,0.25);
    --gc-shadow-hover: 0 6px 24px rgba(0,0,0,0.35);
    --gc-shadow-active:0 0 0 3px rgba(91,163,212,0.22);
    --gc-icon-bg:      rgba(46,134,193,0.15);
    --gc-icon-color:   #7eb8e8;
    --gc-title:        #f6f9fc;
    --gc-text:         #a0a8b2;
    --gc-count-bg:     rgba(46,134,193,0.12);
    --gc-count-text:   #7eb8e8;
    --gc-check-bg:     #2563a8;
    --gc-check-color:  #e8f4ff;
    --gc-next-bg:      #2563a8;
    --gc-next-hover:   #3b82c4;
    --gc-next-disabled:#434a57;
    --gc-next-text:    #e8f4ff;
    --gc-hint-color:   #a0a8b2;
    --gc-back-bg:      transparent;
    --gc-back-border:  #576071;
    --gc-back-color:   #a0a8b2;
    --gc-label-bg:     rgba(46,134,193,0.12);
    --gc-label-color:  #7eb8e8;
  }
}

/* --- Cards row --- */
.idx-group-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

/* --- Single card --- */
.idx-group-card {
  background: var(--gc-bg);
  border: 2px solid var(--gc-border);
  border-radius: 12px;
  padding: 24px 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  cursor: pointer;
  position: relative;
  box-shadow: var(--gc-shadow);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  user-select: none;
}

.idx-group-card:hover {
  border-color: var(--gc-border-hover);
  box-shadow: var(--gc-shadow-hover);
  transform: translateY(-2px);
}

.idx-group-card.active {
  border-color: var(--gc-border-active);
  box-shadow: var(--gc-shadow-active);
}

/* Icon */
.idx-group-card .gc-icon {
  font-size: 36px;
  width: 56px;
  height: 56px;
  background: var(--gc-icon-bg);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.3s;
}

/* Body */
.idx-group-card .gc-body { flex: 1; }

.idx-group-card .gc-body h5 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gc-title);
  margin: 0 0 5px 0;
}

.idx-group-card .gc-body p {
  font-size: 13px;
  color: var(--gc-text);
  margin: 0 0 10px 0;
  line-height: 1.5;
}

.idx-group-card .gc-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gc-count-bg);
  color: var(--gc-count-text);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  transition: background 0.3s;
}

/* Checkmark (active үед харагдана) */
.idx-group-card .gc-check {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 24px;
  height: 24px;
  background: var(--gc-check-bg);
  color: var(--gc-check-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s, transform 0.2s;
}

.idx-group-card.active .gc-check {
  opacity: 1;
  transform: scale(1);
}

/* --- Next button row --- */
.idx-group-next {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.idx-next-btn {
  background: var(--gc-next-bg);
  color: var(--gc-next-text);
  border: none;
  border-radius: 7px;
  padding: 10px 28px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s, transform 0.1s;
  letter-spacing: 0.02em;
}

.idx-next-btn:not(:disabled):hover {
  background: var(--gc-next-hover);
  transform: translateX(2px);
}

.idx-next-btn:disabled {
  background: var(--gc-next-disabled);
  cursor: not-allowed;
  opacity: 0.7;
}

.idx-next-hint {
  font-size: 13px;
  color: var(--gc-hint-color);
}

/* --- Form group header (back button + label) --- */
.idx-form-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--lf-body-border);
}

.idx-back-btn {
  background: var(--gc-back-bg);
  border: 1px solid var(--gc-back-border);
  color: var(--gc-back-color);
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.idx-back-btn:hover {
  border-color: var(--lf-input-focus);
  color: var(--lf-input-focus);
}

.idx-form-group-label {
  font-size: 14px;
  font-weight: 700;
  background: var(--gc-label-bg);
  color: var(--gc-label-color);
  border-radius: 20px;
  padding: 4px 14px;
}

/* --- Sub-tabs flex --- */
.idx-sub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  margin-bottom: 16px;
}

/* --- Mobile --- */
@media (max-width: 576px) {
  .idx-group-cards { grid-template-columns: 1fr; }
  .idx-group-card  { padding: 18px 14px; }
  .idx-group-card .gc-icon { width: 44px; height: 44px; font-size: 26px; }
  .idx-next-btn    { width: 100%; text-align: center; }
}
