/* Basis */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: #fff;
  color: #000;
  font: 16px/1.3 Arial, sans-serif;
}

/* Variablen */
:root {
  --cards-offset: 32px;
  --hero-h-desktop: 520px;
  --hero-h-mobile: 380px;
}

/* Header */
.site-header {
  background: #fff;
  padding: 48px 16px 8px;
  text-align: center;
  position: relative;
  z-index: 5;
}

/* Logo */
.perlitech-logo {
  width: 78vw;
  max-width: 56rem;
  margin: 0 auto;
  position: relative;
  z-index: 5;
}

.perlitech-logo a {
  display: block;
  width: 100%;
  text-decoration: none;
}

.perlitech-logo .logo {
  aspect-ratio: 150/40;
  width: 100%;
  display: block;
  -webkit-mask: url("PerliTech.svg") no-repeat center/120% auto;
  mask: url("PerliTech.svg") no-repeat center/120% auto;
  background-image: url("bg-perlitech.jpg");
  background-repeat: no-repeat;
  background-size: 200%;
  background-position: 50% 0%;
  animation: logoMove 130s linear infinite alternate;
}

/* Spiegelung */
.perlitech-logo .reflection {
  opacity: .25;
  margin-top: -5%;
  aspect-ratio: 150/15;
  overflow: hidden;
  width: 100%;
}

.perlitech-logo .reflection .logo {
  transform: scaleY(-1);
  -webkit-mask: url("PerliTech.svg") no-repeat center/120% auto;
  mask: url("PerliTech.svg") no-repeat center/120% auto;
  background-image: url("bg-perlitech.jpg");
  background-repeat: no-repeat;
  background-size: 200%;
  background-position: 50% 0%;
  animation: logoMove 130s linear infinite alternate;
}

.perlitech-logo .reflection::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #fff 10%, rgba(255, 255, 255, .25));
  backdrop-filter: blur(.5rem);
}

/* Logo-Animation */
@keyframes logoMove {
  0% {
    background-position: 0% 0%;
  }

  25% {
    background-position: 50% 50%;
  }

  50% {
    background-position: 100% 100%;
  }

  75% {
    background-position: 75% 50%;
  }

  100% {
    background-position: 0% 0%;
  }
}

/* Brand – Startseite */
.brand {
  position: relative;
  min-height: 40em;
  padding: 0 0 32px 0;
  background: linear-gradient(43deg, #9e2896, #440c41);
  overflow: hidden;
}

.brand::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("bg-perlitech.jpg");
  background-position: top center;
  background-repeat: no-repeat;
  background-size: cover;
  transform: scaleX(-1);
  background-color: rgba(0, 0, 0, 0.35);
  background-blend-mode: overlay;
  pointer-events: none;
}

/* Karten */
.menu-resources {
  position: relative;
  list-style: none;
  padding: 0;
  margin: var(--cards-offset) auto 0;
  max-width: 50rem;
  height: 18em;
  text-align: center;
  z-index: 1;
}

.menu-resources .placeholder {
  display: none;
}

.menu-resources li {
  position: absolute;
  display: inline-block;
  margin: 0;
  padding: 0;
  width: 10.5em;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(0.25rem);
  border-radius: 0.5em;
  box-shadow: 0.25em 0.5em 0.5em rgba(0, 0, 0, 0.25);
  color: #000;
  transform-origin: center;
}

.menu-resources li a {
  display: block;
  padding: 1.1em 1em 1.6em;
  color: inherit;
  text-decoration: none;
}

.menu-resources li .title {
  display: block;
  font-weight: 700;
  font-size: 1.1rem;
}

.menu-resources li .description {
  display: block;
  font-size: .82rem;
  margin-top: .4rem;
}

/* Positionen Desktop */
.menu-resources li:nth-child(2) {
  z-index: 5;
  background-color: rgba(0, 164, 253, 0.75);
  color: #fff;
  right: calc(50% + 4em);
  top: 4%;
  transform: rotate(5deg);
}

.menu-resources li:nth-child(3) {
  z-index: 17;
  background-color: rgba(102, 102, 255, 0.75);
  color: #fff;
  left: calc(50% + 4.5em);
  top: 15%;
  transform: rotate(-5deg);
}

.menu-resources li:nth-child(4) {
  z-index: 18;
  background-color: rgba(177, 46, 169, 0.85);
  color: #fff;
  left: calc(50% - 4.5em);
  top: 36%;
}

/* Hover */
.menu-resources li:hover {
  box-shadow: 0.35em 0.8em 1em rgba(0, 0, 0, 0.3);
  transform: translateY(-2px) rotate(var(--r, 0deg));
}

/* Marker aus */
.menu-resources {
  list-style-type: none;
}

.menu-resources li::marker {
  content: "";
}

/* Bewegungsreduktion */
@media (prefers-reduced-motion: reduce) {

  .perlitech-logo .logo,
  .perlitech-logo .reflection .logo {
    animation: none;
  }

  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Altes PNG-Logo */
.perlitech-oldlogo {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  margin: 100px auto 0;
}

.perlitech-oldlogo img {
  width: 450px;
  height: auto;
  display: block;
  border-radius: 0.5em;
  box-shadow: 0.25em 0.5em 0.5em rgba(0, 0, 0, 0.25);
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(0.25rem);
}

/* Abschnitt "Was wir tun" */
.content-section {
  display: block;
  width: 100%;
}

.content-container {
  max-width: 50rem;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding: 0 1rem;
  text-align: left;
}

/* Content-Seiten (Impressum/Datenschutz) */
.brand.content-page {
  min-height: 100vh;
  padding: 2rem 0 2.5rem;
  position: relative;
  overflow: hidden;
  /* Durchgehender sanfter Gradient von dunklem Lila zu Schwarz */
  background: linear-gradient(to bottom,
      #1a0520 0%,
      #2d0a35 20%,
      #1a0520 50%,
      #0d0310 80%,
      #000 100%);
}

.brand.content-page::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--hero-h-desktop);
  z-index: 0;
  background-image: url(bg-perlitech.jpg);
  background-position: top center;
  background-repeat: no-repeat;
  background-size: cover;
  transform: scaleX(-1);
  background-color: rgba(0, 0, 0, 0.6);
  background-blend-mode: overlay;
  /* Sehr sanfter, langer Fade-Out des Bildes */
  -webkit-mask-image: linear-gradient(to bottom,
      rgba(0, 0, 0, 1) 0%,
      rgba(0, 0, 0, 0.9) 40%,
      rgba(0, 0, 0, 0.6) 60%,
      rgba(0, 0, 0, 0.3) 80%,
      rgba(0, 0, 0, 0) 100%);
  mask-image: linear-gradient(to bottom,
      rgba(0, 0, 0, 1) 0%,
      rgba(0, 0, 0, 0.9) 40%,
      rgba(0, 0, 0, 0.6) 60%,
      rgba(0, 0, 0, 0.3) 80%,
      rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
}

@media (max-width: 768px) {
  .brand.content-page::before {
    height: var(--hero-h-mobile);
  }
}

.brand.content-page>.content-page {
  position: relative;
  z-index: 1;
  max-width: 50rem;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.25rem;
  text-align: left;
  line-height: 1.6;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  background: none;
  box-shadow: none;
}

.brand.content-page>.content-page h1,
.brand.content-page>.content-page h2,
.brand.content-page>.content-page p,
.brand.content-page>.content-page address,
.brand.content-page>.content-page nav {
  margin: 0 0 1.2rem;
}

.brand.content-page>.content-page h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.brand.content-page>.content-page h2 {
  font-size: 1.3rem;
  margin-top: 1.5rem;
}

.brand.content-page>.content-page a {
  color: #fff;
  text-decoration: underline;
}

.brand.content-page>.content-page a:hover {
  text-decoration: none;
}

/* Skip-Link (einmalig) */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  z-index: 1000;
  padding: .5rem .75rem;
  background: #000;
  color: #fff;
  outline: 2px solid #fff;
  border-radius: 4px;
}

/* SR-only */
.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* Fokus-Indikatoren */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #005fcc;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Karten Fokus */
.menu-resources .card a {
  display: block;
  text-decoration: none;
}

.menu-resources .card a:focus-visible {
  box-shadow: 0 0 0 4px rgba(0, 95, 204, .35);
}

/* Globales Smooth-Scroll für Browser, die es respektieren */
html {
  scroll-behavior: smooth;
}

/* Optische Zentrierung "Was wir tun" (Desktop) */
@media (min-width: 992px) {
  .content-container {
    max-width: 46rem;
    margin-left: auto;
    margin-right: auto;
    transform: translateX(12px);
  }
}

@media (min-width: 992px) {
  .content-container.align-with-cards {
    max-width: 50rem;
    transform: translateX(12px);
  }
}

/* MOBILE-KORREKTUR: Karten vollständig sichtbar stapeln */
@media (max-width: 768px) {
  .menu-resources {
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: auto;
    gap: 1rem;
    margin-top: 2rem;
    max-width: 22rem;
    /* verhindert zu breite Karten */
  }

  .menu-resources li {
    position: static;
    width: 100%;
    max-width: 22rem;
    transform: none;
  }

  .menu-resources li:hover {
    transform: none;
    box-shadow: 0.25em 0.5em 0.5em rgba(0, 0, 0, 0.25);
  }

  /* altes PNG etwas kleiner auf Mobile */
  .perlitech-oldlogo img {
    width: 300px;
  }
}

/* ==================== MODAL STYLES ==================== */

/* Modal Overlay */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal.active {
  display: flex;
  opacity: 1;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

/* Modal Container */
.modal-container {
  position: relative;
  z-index: 10000;
  background: linear-gradient(135deg, #1a0a1f 0%, #3d1650 100%);
  border-radius: 1rem;
  padding: 2.5rem;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  color: #fff;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Close Button */
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: all 0.2s ease;
  opacity: 0.7;
}

.modal-close:hover {
  opacity: 1;
  transform: rotate(90deg);
}

/* Modal Title */
.modal-container h2 {
  margin: 0 0 1.5rem;
  font-size: 1.75rem;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Form Styles */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
}

.form-group label {
  margin-bottom: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.form-group .required {
  color: #ff6b9d;
}

.form-group .optional {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
  font-weight: 400;
}

/* Input Fields */
.form-group input,
.form-group textarea {
  padding: 0.75rem 1rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: rgba(177, 46, 169, 0.8);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 3px rgba(177, 46, 169, 0.2);
}

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

/* Checkbox Group */
.checkbox-group {
  margin-top: 0.5rem;
}

.checkbox-group label {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  flex-direction: row;
  margin-bottom: 0;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  margin-right: 0.75rem;
  margin-top: 0.25rem;
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-group a {
  color: #9d7ce8;
  text-decoration: underline;
}

.checkbox-group a:hover {
  color: #b896f5;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: flex-end;
}

/* Buttons */
.btn-submit,
.btn-close {
  padding: 0.875rem 2rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.btn-submit {
  background: linear-gradient(135deg, #b12ea9 0%, #6636cc 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(177, 46, 169, 0.4);
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(177, 46, 169, 0.6);
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-close {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

/* Success Message */
.success-message {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: #fff;
  padding: 1.25rem 2rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 10001;
  opacity: 0;
  transition: all 0.4s ease;
  max-width: 90%;
  text-align: center;
  font-weight: 600;
}

.success-message.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .modal-container {
    padding: 2rem 1.5rem;
    width: 95%;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .btn-submit,
  .btn-close {
    width: 100%;
  }

  .modal-container h2 {
    font-size: 1.5rem;
    margin-right: 2rem;
  }
}