/* Components · Button + LayerPopup (modal) + Toast */

/* ── Button ───────────────────────────────────────────────────────── */
.gl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}
.gl-btn:active { transform: scale(0.97); }

/* Sizes */
.gl-btn--sm { height: 36px; padding: 0 14px; font-size: 14px; gap: 6px; border-radius: var(--radius-sm); }
.gl-btn--md { height: 44px; padding: 0 18px; font-size: 15px; gap: 8px; border-radius: var(--radius-md); }
.gl-btn--lg { height: 52px; padding: 0 24px; font-size: 16px; gap: 8px; border-radius: var(--radius-lg); }

/* Variants */
.gl-btn--primary   { background: var(--blue-500); color: var(--gray-0); }
.gl-btn--primary:hover   { background: var(--blue-600); }

.gl-btn--secondary { background: var(--gray-100); color: var(--gray-900); }
.gl-btn--secondary:hover { background: var(--gray-200); }

.gl-btn--ghost     { background: transparent; color: var(--gray-700); }
.gl-btn--ghost:hover     { background: var(--gray-100); }

.gl-btn--outline   {
  background: var(--gray-0);
  color: var(--gray-900);
  border-color: var(--gray-300);
  /* White → black is a strong inversion · use --duration-base (200ms)
   * instead of the base 120ms so the swap feels intentional, not abrupt. */
  transition: background var(--duration-base) var(--ease-out),
              color var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out),
              transform var(--duration-fast) var(--ease-out);
}
.gl-btn--outline:hover   {
  background: var(--gray-900);
  color: var(--gray-0);
  border-color: var(--gray-900);
}

.gl-btn--dark      { background: var(--gray-900); color: var(--gray-0); }
.gl-btn--dark:hover      { background: var(--gray-800); }

.gl-btn--onDark    { background: rgba(255, 255, 255, 0.10); color: var(--gray-0); border-color: rgba(255, 255, 255, 0.18); }
.gl-btn--onDark:hover    { background: rgba(255, 255, 255, 0.16); }

.gl-btn--full      { width: 100%; }

/* Icon inside the button */
.gl-btn__icon-sm { width: 16px; height: 16px; }
.gl-btn__icon-md { width: 17px; height: 17px; }
.gl-btn__icon-lg { width: 18px; height: 18px; }

/* ── LayerPopup (modal) ───────────────────────────────────────────── */
.gl-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  animation: fadeIn 200ms var(--ease-out);
}
.gl-modal {
  width: 100%;
  max-width: 920px;
  height: auto;
  max-height: 85vh;
  background: var(--gray-0);
  border-radius: var(--radius-2xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18), 0 8px 16px rgba(15, 23, 42, 0.10);
  animation: modalPop 260ms var(--ease-out);
  transform-origin: center center;
}
@keyframes modalPop {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .gl-modal { animation: fadeIn 200ms var(--ease-out); }
}
.gl-modal__header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gl-modal__title {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.015em;
}
.gl-modal__close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 0;
  background: var(--gray-100);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-700);
  font-size: 18px;
  font-weight: 500;
  font-family: inherit;
  transition: background var(--duration-fast) var(--ease-out);
}
.gl-modal__close:hover { background: var(--gray-200); }
.gl-modal__iframe {
  flex: 1 1 auto;
  border: 0;
  width: 100%;
  /* iframes have no intrinsic content height — set a min so the modal renders
   * a usable viewport when parent is height:auto. Modal still capped at 85vh. */
  min-height: 60vh;
  background: var(--gray-0);
}

/* ── ContactLayer · v17 contact modal (content-sized, not iframe) ── */
.gl-modal--contact {
  max-width: 560px;
  height: auto;
  max-height: min(85vh, 640px);
}
.gl-contact__body {
  padding: 28px 32px 32px;
  overflow: auto;
}
.gl-contact__email {
  display: inline-block;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ds-primary-500);
  text-decoration: none;
  margin-bottom: 24px;
  word-break: break-all;
}
.gl-contact__email:hover { color: var(--ds-primary-600); }
.gl-contact__help-title {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ds-text-secondary, var(--gray-700));
  letter-spacing: -0.005em;
}
.gl-contact__help-list {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ds-text-secondary, var(--gray-700));
}
.gl-contact__help-list li { margin: 4px 0; }
@media (max-width: 694px) {
  .gl-modal--contact { max-width: 100%; }
  .gl-contact__email { font-size: 22px; }
  .gl-contact__body { padding: 22px 22px 26px; }
}

/* ── Toast ────────────────────────────────────────────────────────── */
.gl-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: var(--gray-0);
  padding: 14px 22px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2), 0 4px 8px rgba(15, 23, 42, 0.1);
  z-index: 300;
  animation: slideUp 200ms var(--ease-out);
}
