html {
  height: 100%;
}

a {
  text-decoration: none;
  transition: all 0.3s ease-in-out;

  &:hover {
    text-decoration: none;
    outline: none;
    color: $brand_color;
  }
}

body {
  line-height: 1.7;
  font-size: 16px;
  height: 100%;
  font-family: var(--main_font);
  font-weight: 400;
  color: var(--p_color);
}

.body_wrapper {
  background: var(--gradient-bg);
  position: relative;
  z-index: 1;

  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-mesh);
    z-index: -1;
    pointer-events: none;
  }

  &.no-bg {
    background: inherit;

    &::before {
      display: none;
    }
  }
}

:focus {
  outline: none;
}

a {
  color: $brand_color;
}

h1,
h2,
h3,
h4,
h5,
h6,
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  font-weight: 700;
  font-family: $main_font;
  color: $h_title;
  margin-bottom: 15px;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

h1,
.h1 {
  font-size: var(--font-size-5xl);
}

h2,
.h2 {
  font-size: var(--font-size-4xl);
}

h3,
.h3 {
  font-size: var(--font-size-3xl);
}

h4,
.h4 {
  font-size: var(--font-size-2xl);
  font-weight: 600;
}

h5,
.h5 {
  font-size: var(--font-size-xl);
  font-weight: 600;
}

h6,
.h6 {
  font-size: var(--font-size-lg);
  font-weight: 600;
}

h1 a,
h2 a,
h3>a,
h4 a,
h5 a,
h6 a {
  color: $h_title;
}

p {
  font-weight: 400;
  font-size: 16px;
  line-height: 1.8;
  margin-bottom: 30px;
}

div p:last-child {
  margin-bottom: 0;
}

figure {
  padding-top: 5px;
  padding-bottom: 5px;
  clear: both;
  border: none;
}

figure figcaption {
  color: rgba(0, 0, 0, 0.54);
  line-height: 20px;
  font-size: 14px;
  margin-top: 10px;
  text-align: center;
  max-width: 728px;
  margin-right: auto;
}

video {
  max-width: 100%;
}

table tr td p:last-child {
  margin-bottom: 0;
}

pre[class*="language-"]>code {
  border-left: 5px solid brand_color_rgba(0.8);
}

.form-check {
  position: relative;
  display: block;
}

/** === Scrollbar === **/
::-webkit-scrollbar {
  width: 10px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--black_25);
}

::-webkit-scrollbar-thumb {
  background: var(--black_300);
  border-radius: 30px;
  transition: background var(--transition-fast);

  &:hover {
    background: var(--black_400);
  }
}

/** === Predefined Global Classes === **/

.bold {
  font-weight: 700;
}

.medium {
  font-weight: 500;
}

.regular {
  font-weight: 400;
}

.media {
  display: -ms-flexbox;
  display: flex;
  -ms-flex-align: start;
  align-items: flex-start;
}

.media-body {
  -ms-flex: 1;
  flex: 1;
}

button:focus {
  outline: none;
}

.container,
.container-fluid,
.container-lg,
.container-md,
.container-sm,
.container-xl,
.container-xxl {
  width: 100%;
  padding-right: 12px;
  padding-left: 12px;
  margin-right: auto;
  margin-left: auto;
}

.row {
  --bs-gutter-x: 24px;
}

/** === List style === **/
ul.list-style {
  margin-bottom: 2rem;
}

ul.list-style li {
  margin-bottom: 0.5rem;
  list-style-type: circle;
}

ul.list-style li:last-child {
  margin-bottom: 0;
}

.section-title {
  margin-bottom: 65px;

  .subtitle {
    color: $brand_color;
    font-size: 16px;
    font-weight: 600;
    line-height: 15px;
    display: inline-block;
    margin-bottom: 14px;
  }

  p {
    font-size: 16px;
    color: $black_700;
    margin-bottom: 0;
  }
}

.section-title-two {
  text-align: center;

  h2 {
    font-size: 48px;
    line-height: 56px;
    color: $black_800;
    font-weight: 700;
    margin-top: -12px;
    margin-bottom: -8px;

    span {
      color: $brand_color;
    }
  }

  p {
    font-size: 16px;
    color: $black_700;
    margin-bottom: 0;
    margin-top: 30px;
  }
}

.border-rounded {
  border-radius: 8px;
}

.bg-light {
  background-color: #f9f9f9 !important;
}

.sec-padding {
  padding-top: 120px;
  padding-bottom: 130px;
}

.sec-padding-two {
  padding-top: 120px;
  padding-bottom: 120px;
}

.modal {
  z-index: 1055;
}

.modal-backdrop {
  // Use a slight dark tint, or transparent if only blur is desired.
  // Standard bootstrap backdrop is black with 0.5 opacity.
  // We'll keep it subtle to highlight the blur.
  background-color: rgba(0, 0, 0, 0.2);
  z-index: 1040; // Must be higher than body_wrapper z-index (1)
  backdrop-filter: none; // We blur the wrapper instead

  &.show {
    opacity: 1;
  }
}

// Blur the page content when modal is open
body.modal-open .body_wrapper {
  filter: blur(8px); // Strong blur for focus
  transition: filter 0.3s ease;
}

.form-check-input {
  border-color: $black_600;
  cursor: pointer;

  &:focus {
    box-shadow: none;
    border-color: $black_600;
  }

  &:checked[type="checkbox"] {
    background-color: transparent;
    border-color: $black_600;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23535A60' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10l3 3l6-6'/%3e%3c/svg%3e");
  }
}

.form-check-label {
  cursor: pointer;
}

.form-switch .form-check-input {
  cursor: pointer;
  width: 40px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 9 8'%3e%3ccircle r='3' fill='%236A737C'/%3e%3c/svg%3e");
  border: 3px solid $black_500;
  transition: background-position 0.15s ease-in-out;
  box-shadow: none;

  &:checked {
    background-color: $brand_color;
    border-color: $brand_color;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-5 -4 9 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
  }
}

.form-check {
  display: flex;
  gap: 10px;
}

/*----------------------------------------*/
/*   Back To Top Button CSS
/*----------------------------------------*/
#back-to-top {
  display: inline-block;
  background-color: rgba(220, 220, 220, 0.8);
  width: 50px;
  height: 50px;
  text-align: center;
  border-radius: 4px;
  position: fixed;
  bottom: 30px;
  right: 30px;
  transition: background-color 0.3s, opacity 0.5s, visibility 0.5s;
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
}

#back-to-top::after {
  content: "\32";
  font-family: eleganticons, sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 2em;
  line-height: 50px;
  color: #000;
}

#back-to-top:hover {
  cursor: pointer;
  background-color: #333;
}

#back-to-top:hover::after {
  color: $brand_color;
}

#back-to-top:active {
  background-color: #555;
}

#back-to-top.show {
  opacity: 1;
  visibility: visible;
}

/* Accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: var(--brand_color);
  color: white;
  padding: var(--spacing-sm) var(--spacing-md);
  text-decoration: none;
  z-index: var(--z-tooltip);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);

  &:focus {
    top: 6px;
    outline: 2px solid var(--brand_color);
    outline-offset: 2px;
  }
}

/* Focus visible styles for better accessibility */
*:focus-visible {
  outline: 2px solid var(--brand_color);
  outline-offset: 2px;
}

/* Smooth scroll behavior */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}