/* Base styles: variables, reset, typography, utilities (desktop-first) */

/* ------------------------------
   CSS Custom Properties
------------------------------ */
:root {
  /* brand colors */
  --color-primary: #592e83; /* primary */
  --color-accent-1: #caa8f5;
  --color-accent-2: #9984d4;
  --color-surface: #faf9fc;
  --color-bg: #230c33;
  --color-ink: #0e0a14;
  --color-white: #ffffff;
  --color-heading-2: #eef8eb;
  --color-old-way: #dedede;
  --color-error: #eb4f45;
  --color-blue-grey: #e7eaf4;

  /* semantic tokens */
  --bg: var(--color-bg);
  --surface: var(--color-surface);
  --text: var(--color-primary);
  --ink: var(--color-surface);
  --link: var(--color-accent-1);
  --muted-ink: #e6e0ef;

  /* typography */
  --font-sans: "Poppins", system-ui, -apple-system, Segoe UI, Arial, sans-serif;

  /* spacing */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* layout */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.18);
  --easing-standard: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ------------------------------
   Font Face (local only)
------------------------------ */
/* Poppins Font Family */
@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins/poppins-light-webfont.woff2") format("woff2"),
    url("../fonts/Poppins/poppins-light-webfont.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins/poppins-regular-webfont.woff2") format("woff2"),
    url("../fonts/Poppins/poppins-regular-webfont.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Poppins";
  src: url("../fonts/Poppins/poppins-bold-webfont.woff2") format("woff2"),
    url("../fonts/Poppins/poppins-bold-webfont.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ------------------------------
   Modern Reset
------------------------------ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html:focus-within {
  scroll-behavior: smooth;
}
html,
body {
  scroll-behavior: smooth;
}
body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.4;
  /* font-weight: 300; */
  color: var(--text);
  /* left-to-right gradient with surface dominating the middle */
  background-color: var(--color-surface);
  background: linear-gradient(
    to right,
    color-mix(in srgb, var(--color-primary) 25%, transparent),
    var(--color-surface) 30%,
    var(--color-surface) 70%,
    color-mix(in srgb, var(--color-primary) 25%, transparent)
  );
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}
input,
button,
textarea,
select {
  font: inherit;
}

/* ------------------------------
   Base Elements
------------------------------ */

ul {
  list-style: none;
}
a {
  color: var(--color-primary);
  text-decoration: none;
}
a:hover {
  text-decoration: none;
}

.btn {
  color: var(--color-surface);
  background-color: var(--color-primary);
  padding: 0.75rem 1.25rem;
  border-radius: 50px;
  border: 0;
  transition: transform 160ms var(--easing-standard),
    background-color 160ms var(--easing-standard);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  white-space: nowrap;
  vertical-align: middle;
}

.btn-primary,
.btn-secondary {
  padding: 1rem 2.5rem;
}

.btn-secondary {
  color: var(--color-primary);
  background-color: var(--color-surface);
}

.btn-tertiary {
  color: var(--color-surface);
  background-color: var(--color-accent-2);
  font-size: 0.75rem;
  padding: 0.5rem 1rem;
}

.btn-black {
  color: var(--color-surface);
  background-color: var(--color-ink);
  font-size: 0.75rem;
  padding: 0.5rem 1rem;
}

.btn-service {
  background: var(--color-accent-1);
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 700;
  display: inline-block;
  transition: all 0.3s ease;
}

.btn-service:hover {
  background: var(--color-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

h1 {
  font-size: 4.35rem;
  line-height: 1.06;
}
h2 {
  font-size: 3.1875rem;
  color: var(--color-heading-2);
}
h3 {
  font-size: 1.625rem;
}
h1,
h2,
h3 {
  font-weight: 400;
}

.strong {
  font-weight: 700;
}

/* margin helpers */
.mt-1 {
  margin-top: 0.5rem;
}
.mt-2 {
  margin-top: 1rem;
}
.mt-3 {
  margin-top: 1.5rem;
}
.mb-1 {
  margin-bottom: 0.5rem;
}
.mb-2 {
  margin-bottom: 1rem;
}
.mb-3 {
  margin-bottom: 1.5rem;
}

/* layout helpers */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 7rem 6rem;
}

/* motion preferences */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------
   Header
------------------------------ */

.header {
  background-color: #e8e0f0;
  border-radius: 15px;
  padding: 0.5rem 1rem;
  max-width: 640px;
  margin: 1rem auto;
  position: sticky;
  top: 2rem;
  z-index: 100;

  a {
    line-height: 1.1;
  }

  .header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .logo {
    display: flex;
    align-items: center;
    gap: var(--space-2xs);
    font-size: 1rem;
    color: var(--color-primary);
    height: 40px;

    img {
      margin-top: -6px;
    }

    span {
      padding-top: 3px;
      line-height: 1.4;
      font-weight: 700;
    }
  }

  .nav-list {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
  }

  .nav-list a {
    border-bottom: 2px solid transparent;
    transition: border-color 160ms var(--easing-standard);
  }

  .nav-list a:not([class*="btn"]) {
    padding: 0.5rem 0;
  }

  .nav-list a:hover,
  .nav-list a:focus,
  .nav-list a:active {
    border-color: var(--color-primary);
  }

  .nav-list [class*="btn"] {
    border-bottom: 0;
  }

  .nav-list {
    /* Dropdown styles */
    .dropdown {
      position: relative;
      cursor: unset;
    }

    .dropdown-toggle {
      background: none;
      border: none;
      color: inherit;
      font-family: inherit;
      font-size: inherit;
      cursor: pointer;
      padding: 4px 0 5px;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      border-bottom: 2px solid transparent;
      transition: border-color 160ms var(--easing-standard);
      margin-top: 3px;
    }

    .dropdown-toggle:hover,
    .dropdown-toggle:focus,
    .dropdown-toggle:active {
      border-color: var(--color-primary);
    }

    .dropdown-arrow {
      transition: transform 0.2s ease;
      margin-top: 2px;
    }

    .dropdown.active .dropdown-arrow {
      transform: rotate(180deg);
    }

    .dropdown-menu {
      position: absolute;
      top: 100%;
      left: 0;
      background: var(--color-surface);
      border: 1px solid var(--color-accent-1);
      border-radius: var(--radius-sm);
      box-shadow: var(--shadow-md);
      min-width: 200px;
      opacity: 0;
      visibility: hidden;
      transform: translateY(-10px);
      transition: all 0.2s ease;
      z-index: 1000;
      margin-top: 0.5rem;
    }

    .dropdown.active .dropdown-menu {
      opacity: 1;
      visibility: visible;
      transform: translateY(0);
    }

    .dropdown-menu li {
      list-style: none;
    }

    .dropdown-menu a {
      display: block;
      padding: 0.75rem 1rem;
      color: var(--color-primary);
      text-decoration: none;
      transition: background-color 0.2s ease;
      border-bottom: none;
    }

    .dropdown-menu li:first-child a:hover {
      border-top-right-radius: var(--radius-sm);
      border-top-left-radius: var(--radius-sm);
      border-bottom-right-radius: 0;
      border-bottom-left-radius: 0;
    }

    .dropdown-menu li:last-child a:hover {
      border-bottom-right-radius: var(--radius-sm);
      border-bottom-left-radius: var(--radius-sm);
      border-top-right-radius: 0;
      border-top-left-radius: 0;
    }
    .dropdown-menu a:hover,
    .dropdown-menu a:focus {
      background-color: var(--color-accent-1);
      color: var(--color-primary);
      border-bottom: none;
    }
  }

  .hamburger-menu,
  .close-menu {
    display: none;
  }
}

/* ------------------------------
   Footer Styles
------------------------------ */
.footer {
  background-color: var(--color-primary);
  color: var(--color-surface);
  margin-top: 0;
  border-top: 1px solid var(--color-accent-1);

  .container {
    padding: 3rem 1rem 1.5rem;
  }

  .footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 3rem;
    align-items: start;
    margin-bottom: 2rem;
  }

  .footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .footer-brand .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-surface);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.25rem;
    height: 40px;

    img {
      margin-top: -10px;
    }
  }

  .footer-brand .logo:hover {
    opacity: 0.9;
  }

  .footer-tagline {
    font-size: 1rem;
    line-height: 1.4;
    color: var(--color-accent-1);
    margin: 0;
  }

  .footer-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
  }

  .footer-nav-section h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-surface);
  }

  .footer-nav-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .footer-nav-section li {
    margin-bottom: 0.5rem;
  }

  .footer-nav-section a {
    color: var(--color-accent-1);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
  }

  .footer-nav-section a:hover {
    color: var(--color-surface);
  }

  .footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
  }

  .footer-bottom p {
    font-size: 0.85rem;
    color: var(--color-accent-1);
    margin: 0;
  }
}

/* ------------------------------
   Desktop-first breakpoints (downscaling)
------------------------------ */
@media (max-width: 1440px) {
}
@media (max-width: 1200px) {
}
@media (max-width: 992px) {
  .footer {
    .footer-content {
      grid-template-columns: 1fr;
      gap: 2rem;
    }

    .footer-nav {
      grid-template-columns: repeat(2, 1fr);
      gap: 1.5rem;
    }
  }
}
@media (max-width: 768px) {
  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }
  h3 {
    font-size: 1.25rem;
  }

  .btn {
    font-size: 0.9rem;
  }

  .container {
    padding: 5rem 2rem;
  }

  .header {
    top: 1rem;
    max-width: 90%;

    .header-inner {
      justify-content: space-between;
      align-items: center;
    }

    .nav {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100vh;
      background-color: var(--color-surface);
      z-index: 1000;
      transform: translateX(-100%);
      transition: transform 0.3s ease-in-out;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
    }

    .nav.active {
      transform: translateX(0);
    }

    .nav-list {
      flex-direction: column;
      gap: 2rem;
      text-align: center;
      width: 100%;
    }

    .nav-list a {
      font-size: 1.5rem;
      padding: 1rem 2rem;
    }

    .nav-list li,
    .nav-list a {
      width: 100%;
    }

    .nav-list a:not([class*="btn"]) {
      background-color: var(--color-accent-2);
      display: inline-block;
    }

    .nav-list a.dropdown-toggle {
      display: inline-flex;
    }

    .nav-list [class*="btn"] {
      width: 100%;
      max-width: 300px;
    }

    /* Mobile navigation - show all items directly */
    .nav-list {
      .dropdown {
        width: 100%;
        background-color: var(--color-accent-2);
      }

      .dropdown-toggle {
        width: 100%;
        max-width: none;
        justify-content: center;
        background-color: var(--color-accent-2);
        padding: 0.5rem 0;
        font-size: 1.5rem;
        border-bottom: none;
        border-radius: 0;
        margin-top: 0;
      }

      .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        margin: 0;
        max-height: none;
        overflow: visible;
        width: 100%;
        max-width: none;
        min-width: auto;
        display: block;
      }

      .dropdown-menu li {
        width: 100%;
      }

      .dropdown-menu a {
        background-color: var(--color-accent-2);
        margin: 0.25rem 0;
        font-size: 1.25rem;
        padding: 0.75rem 2rem;
        width: 100%;
        display: block;
        text-align: center;
      }

      .dropdown-menu li:last-child a {
        border-top: 2px solid var(--color-primary);
      }

      .dropdown-menu a:hover,
      .dropdown-menu a:focus {
        background-color: var(--color-primary);
        color: var(--color-surface);
      }
    }

    .hamburger-menu {
      display: block;
      background: none;
      border: none;
      cursor: pointer;
      padding: 0.5rem;
      z-index: 1001;
    }

    .close-menu {
      position: absolute;
      top: 2rem;
      right: 2rem;
      background: none;
      border: none;
      cursor: pointer;
      padding: 0.5rem;
      z-index: 1001;
    }

    .hamburger-menu {
      display: block;
    }

    .close-menu {
      display: none;
    }

    .nav.active {
      transform: translateX(0);
    }

    .hamburger-menu img,
    .close-menu img {
      width: 24px;
      height: 24px;
    }
  }
}
@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }
  h3 {
    font-size: 1.15rem;
  }

  body {
    font-size: 0.9rem;
  }

  .btn {
    font-size: 0.8rem;
  }
  .container {
    padding: 5rem 1rem;
  }
}

/* ------------------------------
   Modal Styles
------------------------------ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-overlay.active body {
  overflow: hidden;
}

.modal-container {
  background: var(--color-surface);
  max-width: 90vw;
  max-height: 90vh;
  width: 600px;
  position: relative;
  transform: scale(0.7);
  transition: transform 0.3s ease;
  overflow: auto;
}

.modal-overlay.active .modal-container {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 10001;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.modal-close:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.modal-close img {
  width: 20px;
  height: 20px;
}

.modal-content {
  padding: 2rem;
  text-align: center;
  min-height: 850px;

  .cookie-buttons {
    justify-content: center;

    .btn-secondary {
      border: 1px solid var(--color-primary);
    }
  }
}

.modal-content h2 {
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.modal-iframe-container {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  overflow: auto;
}

.modal-iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Modal loading state */
.modal-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  text-align: center;
  color: var(--color-primary);
  font-size: 1.2rem;
  font-weight: 500;
}

.modal-loading .loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e6e0ef;
  border-top: 3px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Modal responsive styles */
@media (max-width: 768px) {
  .modal-container {
    width: 95vw;
    max-height: 95vh;
  }

  .modal-content {
    padding: 1.5rem;
    min-height: auto;
  }

  .modal-iframe-container {
    height: 60vh;
  }

  .modal-content h2 {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .modal-container {
    width: 98vw;
    max-height: 98vh;
  }

  .modal-content {
    padding: 1rem;
  }

  .modal-iframe-container {
    height: 60vh;
  }

  .modal-content h2 {
    font-size: 1.1rem;
  }
}

/* ------------------------------
   Cookie Consent Banner
------------------------------ */
.cookie-consent {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-primary);
  color: var(--color-surface);
  padding: 1rem;
  z-index: 10002;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.cookie-consent.show {
  transform: translateY(0);
}

.cookie-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-content p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4;
  flex: 1;
}

.cookie-buttons {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cookie-buttons .btn {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

.cookie-buttons .btn-primary {
  border: 1px solid var(--color-surface);
}

/* Iframe placeholder */
.iframe-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  background: var(--color-surface);
  color: var(--color-primary);
  font-size: 1rem;
  border-radius: var(--radius-sm);
  padding: 2rem;
  text-align: center;
}

.iframe-placeholder p {
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
  font-weight: 500;
}

.iframe-placeholder-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.iframe-placeholder-buttons .btn {
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: transform 0.3s ease;
}

.iframe-placeholder-buttons .btn:hover {
  transform: translateY(-2px);
}

.iframe-placeholder.hidden {
  display: none;
}

/* Cookie consent responsive */
@media (max-width: 768px) {
  .cookie-content {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .cookie-buttons {
    width: 100%;
    justify-content: center;
  }

  .cookie-buttons .btn {
    flex: 1;
    max-width: 120px;
  }

  .iframe-placeholder {
    padding: 1rem;
  }

  .iframe-placeholder p {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  .iframe-placeholder-buttons {
    flex-direction: column;
    width: 100%;
  }

  .iframe-placeholder-buttons .btn {
    width: 100%;
    max-width: 200px;
  }
}
