/* ========== Base ========== */
*,
*::before,
*::after { box-sizing: border-box; }

:root {
  --gp-blue-500: #167efc;
  --gp-blue-600: #0f6ae1;
  --gp-border:   #e6ecf6;
  --gp-input:    #d7dbe7;
  --gp-text-2:   #4a5568;
}

html {
  scroll-behavior: smooth;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* Simple fade (valgfrit – bruges af dine sections) */
.fade-in { opacity: 0; animation: fadeIn .8s ease forwards; }
@keyframes fadeIn { to { opacity: 1; } }

/* ========== Cards (lab + kontakt) ========== */
.card {
  width: min(900px, 92%);
  margin: 2rem auto;                 /* centrér selve kortet */
  padding: 1.25rem 1.5rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.06);
  display: block;
  text-align: center;                /* centrér kun headings i kortet */
}

.card-title {
  margin: 0 0 .25rem;
  font-size: 1.2rem;
  font-weight: 600;
}

.card-subtitle {
  margin: 0 0 1rem;
  color: var(--gp-text-2);
  font-size: .98rem;
}

/* Formular-blokke inde i kort: venstrejuster indholdet,
   men centrer hele formen som en kolonne */
.lookup-form,
.contact-form {
  max-width: 700px;
  margin: 0 auto;                    /* centrér selve formularen i kortet */
  text-align: left;                  /* felter/labels venstrejusteres */
  width: 100%;
}

/* Lookup-form layout */
.lookup-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .75rem;
  align-items: center;
  margin-bottom: .5rem;
}

/* Inputs */
.lookup-form input,
.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 1px solid var(--gp-input);
  border-radius: 10px;
  padding: .85rem .95rem;
  font-size: 1rem;
  background: #f9fbff;
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease, background .15s ease;
}

.lookup-form input:focus,
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--gp-blue-500);
  box-shadow: 0 0 0 3px rgba(22,126,252,.15);
  background: #fff;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
  gap: 1rem;
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

/* Knapper */
.btn {
  display: inline-block;
  border: 0;
  border-radius: 10px;
  padding: .9rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(90deg,var(--gp-blue-500),var(--gp-blue-600));
  color: #fff;
  transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
}

.btn:hover:not([disabled]) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(22,126,252,.25);
}

.btn:active { transform: translateY(1px); }

.btn:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(22,126,252,.2);
}

.btn[disabled] { opacity: .6; cursor: not-allowed; }

/* Result-messages */
.lookup-result { margin-top: .25rem; font-size: .98rem; }
.lookup-result .ok {
  padding: .75rem .9rem; border-radius: 10px;
  background: #f0f7ff; border: 1px solid #cfe6ff;
}
.lookup-result .err {
  padding: .75rem .9rem; border-radius: 10px;
  background: #fff5f5; border: 1px solid #ffd1d1; color: #a33;
}

/* ========== Product grid + cards ========== */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px,1fr));
  gap: 1.5rem;
  width: min(1100px, 95%);
  margin: 2rem auto 0;              /* centrer hele gitteret */
}

.product-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--gp-border);
  box-shadow: 0 4px 18px rgba(0,0,0,0.06);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .22s ease, border-color .22s ease;
}

.product-card h3 { margin: 0 0 .5rem; font-size: 1.1rem; }
.product-card p  { margin: 0; font-size: .95rem; color: #555; }

.product-card img {
  display: block;
  margin: 0 auto .75rem;
  width: auto;
  max-width: 100%;
  border-radius: 8px;
  box-shadow: none;
  transform: translateY(0) scale(1);
  transition: transform .28s ease;
  will-change: transform;
}

/* Hover-finesse (kun hvor hover giver mening) */
@media (hover:hover) and (pointer:fine) {
  .product-card::after {
    content: "";
    position: absolute; inset: 0;
    border-radius: 12px;
    pointer-events: none;
    box-shadow: 0 0 0 0 rgba(22,126,252,0);
    transition: box-shadow .25s ease;
  }
  .product-card:hover,
  .product-card:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 18px 42px rgba(0,0,0,.10);
    border-color: #d9e6ff;
  }
  .product-card:hover::after,
  .product-card:focus-within::after {
    box-shadow: 0 0 0 6px rgba(22,126,252,.10);
  }
  .product-card:hover img,
  .product-card:focus-within img {
    transform: translateY(-3px) scale(1.02);
  }
}

.product-card:active {
  transform: translateY(-1px) scale(.995);
  transition: transform .06s ease;
}

.product-card:focus-within {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(22,126,252,.20), 0 18px 42px rgba(0,0,0,.10);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .product-card,
  .product-card::after,
  .product-card img { transition: none; }
  .product-card:hover,
  .product-card:focus-within { transform: none; }
}

/* ========== Responsive tweaks ========== */
@media (max-width: 560px) {
  .lookup-form { grid-template-columns: 1fr; }  /* knap under input */
}

/* === HERO & DOTS === */

.hero {
  /* transparent så vi kun ser body's baggrund */
  background: transparent;
  position: relative;
  padding: 80px 16px 24px;
  text-align: center;
}

/* DOTS bag logoet */
.hero .hero-dots {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1400px;           /* sæt en fast bredde */
  height: auto;
  display: block;

  opacity: .28;            /* gør dem lidt tydeligere */
  pointer-events: none;
  z-index: 0;
  filter: grayscale(1);

  /* fjern evt. hvide haloer */
  mix-blend-mode: multiply;

  /* valgfri fade i kanten – kan kommenteres ud hvis ikke ønsket */
  -webkit-mask-image: radial-gradient(circle at 50% 40%, rgba(0,0,0,1) 45%, rgba(0,0,0,0) 75%);
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-size: cover;
  mask-image: radial-gradient(circle at 50% 40%, rgba(0,0,0,1) 45%, rgba(0,0,0,0) 75%);
  mask-repeat: no-repeat;
  mask-size: cover;
}

/* Logo og tagline oven på dots */
.hero .logo,
.hero .tagline {
  position: relative;
  z-index: 1;
  margin: 0;
}

.hero .logo {
  max-width: 250px;
  margin-bottom: .5rem;
  /* neutraliser globale img regler */
  box-shadow: none !important;
  border-radius: 0 !important;
}

.hero .tagline {
  font-size: 1.2em;
  color: #333;
  margin-top: .5rem;
}

/* Mobiljustering */
@media (max-width: 640px) {
  .hero .hero-dots {
    width: 360px;
    opacity: .16;
  }
}

/* Rød kant ved fejl (har du allerede) */
.input-invalid {
  border-color: #e57373 !important;
  box-shadow: 0 0 0 3px rgba(229, 115, 115, 0.15) !important;
}

/* Grønt “valideret”-look */
.input-valid {
  border-color: #4caf50 !important;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15) !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%234CAF50' stroke-width='3' viewBox='0 0 24 24'%3E%3Cpath d='M5 13l4 4L19 7'/ %3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem auto;
  padding-right: 2rem; /* plads til ikon */
}

/* Spinner-tilstand for knappen */
.btn.is-loading {
  position: relative;
  pointer-events: none;
}

.btn.is-loading::before {
  content: "";
  position: absolute;
  left: 0.85rem;                 /* lille plads fra venstre */
  top: 50%;
  width: 1em;
  height: 1em;
  transform: translateY(-50%);
  border: 2px solid currentColor;
  border-right-color: transparent; /* “hul” så den spinner pænt */
  border-radius: 50%;
  animation: gp-spin 0.8s linear infinite;
}

/* Giv lidt plads så tekst ikke “rammer” spinneren */
.btn.is-loading {
  padding-left: 2.2rem;
}

/* Disabled-look (har du muligvis allerede) */
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Spinner keyframes */
@keyframes gp-spin {
  to { transform: translateY(-50%) rotate(360deg); }
}
