/* ================================================================
   components.css — Shared UI components
   Navbar · Buttons · Inputs · Modal · Card · Tile · Sections · FAQ
   ================================================================ */


/* ================================================================
   NAVBAR
   ================================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 78px;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 10px;
  background: var(--navbar-bg, var(--bg));
  box-shadow: var(--navbar-shadow, none);
  backdrop-filter: blur(var(--blur-md));
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-base), border-color var(--transition-base);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-left::-webkit-scrollbar { display: none; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-weight: 900;
  font-size: 30px;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: color var(--transition-fast), background var(--transition-fast);
}
.brand:hover {
  color: var(--color-accent);
  background: var(--hover);
}

.brand-home {
  gap: 10px;
}

.brand-logo-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
}

.brand-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

.brand-logo-light {
  display: none;
}

html[data-theme="light"] .brand-logo-light {
  display: block;
}

html[data-theme="light"] .brand-logo-dark {
  display: none;
}

html[data-theme="dark"] .brand-logo-light {
  display: none;
}

.nav-links { display: flex; gap: 6px; }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 14px;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.nav-link:hover { background: var(--hover); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.user-chip {
  text-align: right;
  display: none;
}
.user-chip-name  { font-size: 15px; font-weight: 700; line-height: 1.1; }
.user-chip-role  { font-size: 11px; color: var(--muted); }

@media (min-width: 520px) { .user-chip { display: block; } }

.theme-btn,
.user-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  transition: background var(--transition-base), border-color var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
}
.theme-btn:hover,
.user-btn:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #fff;
}

/* Language switcher */
.lang-form { margin: 0; }
.lang-form-dropdown {
  margin: 0;
  position: relative;
}

.lang-form-desktop-custom {
  display: block;
}

.lang-form-mobile {
  display: none;
}

.lang-switch {
  appearance: none;
  height: 38px;
  padding: 0 34px 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--purple-border);
  background: linear-gradient(180deg, var(--purple-2), var(--purple));
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 20px var(--purple-glow);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}
.lang-switch:hover  { filter: brightness(1.08); }
.lang-switch option { background: #0c0c12; color: #fff; }

.lang-mobile-toggle {
  height: 38px;
  min-width: 66px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--purple-border);
  background: linear-gradient(180deg, var(--purple-2), var(--purple));
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 8px 20px var(--purple-glow);
}

.lang-mobile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 100%;
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow-md);
  z-index: 100001;
}

.lang-form-dropdown.is-open .lang-mobile-menu {
  display: flex;
}

.lang-mobile-option {
  height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.lang-mobile-option:hover {
  background: var(--hover);
  border-color: var(--border);
}

.lang-mobile-option.is-active {
  background: linear-gradient(180deg, var(--purple-2), var(--purple));
  border-color: var(--purple-border);
  color: #fff;
}


/* ================================================================
   CARD
   ================================================================ */
.card {
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
}
.card::before, .card::after { pointer-events: none; }


/* ================================================================
   TILE  (service/category cards used in catalog / kp)
   ================================================================ */
.tile {
  display: block;
  text-decoration: none;
  color: var(--text);
  background: var(--tile-bg);
  border: 1px solid var(--tile-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition-base), box-shadow var(--transition-base),
              border-color var(--transition-base);
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--focus-border);
}
.tile:active { transform: scale(0.99); }
.tile--static { cursor: default; }

.tile-media {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--tile-media-bg);
  overflow: hidden;
}
.tile-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}
.tile:hover .tile-media img { transform: scale(1.05); }

.tile-badge {
  position: absolute;
  top: 8px; left: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(255,255,255,0.80);
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
  color: var(--text);
}
html[data-theme="dark"] .tile-badge {
  background: rgba(0,0,0,0.40);
  border-color: rgba(255,255,255,0.14);
}

.tile-body { padding: 18px; }
.tile-title {
  font-weight: 700;
  font-size: 16px;
  margin: 0 0 6px;
  /* white-space: nowrap;
  overflow: hidden; */
  text-overflow: ellipsis;
}
.tile-desc {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile-placeholder {
  font-size: 15px;
  color: var(--muted);
  padding: 10px;
  text-align: center;
}


/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--radius-full);
  border: 1px solid var(--purple-border);
  background: linear-gradient(180deg, var(--purple-2), var(--purple));
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 26px var(--purple-glow);
  transition: filter var(--transition-base), transform var(--transition-base);
}
.btn:hover {
  filter: saturate(1.10) brightness(1.06);
  transform: translateY(-1px);
}
.btn:active { transform: scale(0.99); }

.btn-compact { height: 40px; padding: 0 16px; font-size: 15px; }

.btn-danger {
  border-color: rgba(239, 68, 68, 0.45);
  background: linear-gradient(180deg, #f87171, #ef4444);
  box-shadow: 0 10px 26px rgba(239, 68, 68, 0.25);
}


/* ================================================================
   INPUTS
   ================================================================ */
.search-input,
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
textarea,
select {
  width: 100%;
  height: 60px;
  padding: 0 16px;
  background: #fff;
  color: black;
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
textarea {
  height: auto;
  min-height: 120px;
  padding: 14px 16px;
  resize: vertical;
}
.search-input::placeholder,
input::placeholder,
textarea::placeholder { color: var(--muted); }

.search-input:focus,
input:focus,
textarea:focus,
select:focus {
  border-color: var(--focus-border);
  box-shadow: 0 0 0 4px var(--focus);
}

/* Search row (used in catalog/kp pages) */
.search-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.search-row .search-input { flex: 1; min-width: 200px; }


/* ================================================================
   MODAL
   ================================================================ */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100000;
}
.modal-backdrop.open { display: flex; }

.modal-backdrop--full {
  padding: 3vh 3vw;
}

.modal {
  width: 100%;
  max-width: 420px;
  background: var(--modal-bg);
  border: 1px solid var(--modal-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--modal-shadow);
}

.modal-fullscreen {
  width: 94vw;
  height: 92vh;
  max-width: none;
  border-radius: 16px;
  padding: 2vh 2.5vw 2.2vh;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}

@media (max-width: 900px) {
  .modal-backdrop--full {
    padding: 2vh 2vw;
  }

  .modal-fullscreen {
    width: 96vw;
    height: 94vh;
    padding: 2vh 3vw;
    border-radius: 12px;
  }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}
.modal-title  { font-weight: 800; font-size: 18px; }
.modal-close {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition-fast);
}
.modal-close:hover { background: var(--hover); }

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: var(--space-lg);
}
.modal-actions > * { flex: 1; }
.modal-actions form { margin: 0; display: flex; }
.modal-actions .btn { width: 100%; }


/* ================================================================
   UTILITY CLASSES
   ================================================================ */
.muted { color: var(--muted); }

.page-head { margin-bottom: 12px; }

.page-title {
  text-align: center;
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}
.page-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.25;
}

/* Page head with left/center/right columns */
.page-head-top {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}
.page-head-left  { justify-self: start;  display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.page-head-center{ justify-self: center; text-align: center; min-width: 0; }
.page-head-right { justify-self: end;    display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.page-head-center .page-title {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ================================================================
   SECTION HEADER  (shared across all pages)
   ================================================================ */
.section-head {
  text-align: center;
  margin-bottom: 24px;
}
.section-title {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.section-subtitle {
  font-size: 15px;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}


/* ================================================================
   FAQ  (used on home and potentially other pages)
   ================================================================ */
.faq-list {
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.faq-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}
.faq-item[open] {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-md);
}

.faq-item summary {
  list-style: none;
  padding: 20px 24px;
  font-weight: 700;
  font-size: 17px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  user-select: none;
  transition: background var(--transition-fast);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { background: var(--hover); }
.faq-item summary::after {
  content: '+';
  font-size: 22px;
  font-weight: 300;
  color: var(--muted);
  flex-shrink: 0;
  transition: transform var(--transition-base), color var(--transition-base);
}
.faq-item[open] summary::after {
  transform: rotate(45deg);
  color: var(--color-accent);
}

.faq-item p {
  padding: 20px 24px 20px;
  font-size: 16px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
}
