/* ==========================================================================
   Modal & Loader Components
   Reusable patterns for dialogs and loading states
   ========================================================================== */

/* --------------------------------------------------------------------------
   Modal Dialog
   -------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  margin: auto;
  max-width: min(90vw, 520px);
  max-height: min(90vh, 440px);
  padding: 2.5rem;
  border: 1px solid var(--color-border, rgba(0,0,0,0.08));
  background: var(--surface, #fff);
  text-align: center;
  z-index: 200;
}

.modal::backdrop {
  background: rgba(26, 26, 26, 0.5);
  backdrop-filter: blur(4px);
}

.modal__icon {
  width: 3rem;
  height: 3rem;
  margin-bottom: 1.5rem;
  color: var(--color-accent-primary);
}

.modal__title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 1rem;
}

.modal__text {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
}

.modal__button {
  font-family: var(--font-body);
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  background: #0c5320;
  border: none;
  cursor: pointer;
  padding: 0.75rem 2rem;
  transition: background-color 0.3s ease;
}

.modal__button:hover {
  background: var(--color-accent-primary);
}

/* --------------------------------------------------------------------------
   Loader Overlay
   -------------------------------------------------------------------------- */
.loader {
  position: fixed;
  inset: 0;
  background: rgba(249, 248, 246, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: var(--z-overlay, 200);
}

.loader__spinner {
  width: 40px;
  height: 40px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-accent-primary);
  border-radius: 50%;
  animation: loader-spin 1s linear infinite;
  margin-bottom: 1rem;
}

.loader__text {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--color-text-secondary);
}

@keyframes loader-spin {
  to {
    transform: rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   Tabs / Switch Component
   -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 2rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 3rem;
}

.tabs__button {
  font-family: var(--font-body);
  font-size: 1rem;
  background: none;
  border: none;
  padding: 0 0 1rem 0;
  cursor: pointer;
  position: relative;
  color: var(--color-text-secondary);
  transition: color 0.3s ease;
}

.tabs__button::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: var(--color-accent-primary);
  transform: scaleX(0);
  transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.tabs__button:hover,
.tabs__button.is-active {
  color: var(--color-text-primary);
}

.tabs__button.is-active::after {
  transform: scaleX(1);
}
