/* Grundlayout */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  background: radial-gradient(circle at top, #e9f7ff 0, #ffffff 55%, #f3f7fa);
  color: #05324a;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 169, 238, 0.15);
}

.header-left,
.header-center,
.header-right {
  display: flex;
  align-items: center;
}

.header-right {
  position: relative;
}

.header-center {
  flex: 1;
  justify-content: center;
}

#app-title {
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #05324a;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.logo-image {
  max-height: 40px;
  width: auto;
}

.logo-watermark {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.25rem;
  width: 150px;
  height: 70px;
  background-image: url("platten-wasserzeichen.jpg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.18;
  filter: grayscale(40%);
  pointer-events: none;
  z-index: 4;
}

.language-select {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.language-dropdown {
  position: relative;
}

.language-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 169, 238, 0.6);
  background: #ffffff;
  color: #05324a;
  font-size: 0.85rem;
  cursor: pointer;
}

.language-dropdown-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 169, 238, 0.25);
}

.language-dropdown-menu {
  position: absolute;
  top: 115%;
  left: 0;
  min-width: 150px;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid rgba(0, 169, 238, 0.25);
  box-shadow: 0 12px 24px rgba(5, 50, 74, 0.18);
  z-index: 30;
}

.language-option {
  width: 100%;
  border: none;
  background: transparent;
  padding: 0.35rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: #05324a;
  cursor: pointer;
  text-align: left;
}

.language-option:hover {
  background: #f0f7fb;
}

.language-flag {
  width: 18px;
  height: 12px;
  border-radius: 2px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.language-label {
  white-space: nowrap;
}

.flag-de {
  background-image: url("https://flagcdn.com/w20/de.png");
}

.flag-en {
  background-image: url("https://flagcdn.com/w20/gb.png");
}

.flag-fr {
  background-image: url("https://flagcdn.com/w20/fr.png");
}

.flag-es {
  background-image: url("https://flagcdn.com/w20/es.png");
}

.flag-it {
  background-image: url("https://flagcdn.com/w20/it.png");
}

.flag-zh {
  background-image: url("https://flagcdn.com/w20/cn.png");
}

.app-main {
  max-width: 1100px;
  margin: 1.5rem auto 3.5rem;
  padding: 0 1rem;
}

.card {
  background: #ffffff;
  border-radius: 18px;
  padding: 1.5rem 1.5rem 1.25rem;
  box-shadow: 0 18px 45px rgba(5, 50, 74, 0.12);
  position: relative;
}

.wizard-card {
  overflow: hidden;
}

.progress-section {
  margin-bottom: 1rem;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
  color: #4c6f85;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 169, 238, 0.12);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #00a9ee, #36d4ff);
  box-shadow: 0 0 12px rgba(0, 169, 238, 0.7);
  transition: width 0.35s ease-out;
}

.step {
  display: none;
  animation: fadeIn 0.25s ease-out;
}

.step.active {
  display: block;
}

.step-description {
  margin-top: 0.25rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: #4c6f85;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.5rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-grid .full-width {
  grid-column: 1 / -1;
}

.form-field label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #05324a;
}

.required {
  color: #d7263d;
  margin-left: 0.15rem;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="url"],
select,
textarea {
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(5, 50, 74, 0.18);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease,
    background-color 0.15s ease;
}

input::placeholder {
  color: #9caeb8;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #00a9ee;
  box-shadow: 0 0 0 2px rgba(0, 169, 238, 0.16);
}

.input-with-icon {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.info-icon {
  border: none;
  border-radius: 999px;
  width: 24px;
  height: 24px;
  font-size: 0.8rem;
  cursor: pointer;
  background: #00a9ee;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 169, 238, 0.4);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
}

.info-icon:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 169, 238, 0.5);
  background: #0090cc;
}

.error-message {
  min-height: 1rem;
  font-size: 0.8rem;
  color: #d7263d;
}

.hint-text {
  font-size: 0.85rem;
  color: #4c6f85;
}

.form-actions-row {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.print-area {
  display: none;
}

@media print {
  #print-area {
    display: block;
    padding: 1rem 1.5rem;
    background: #ffffff;
    width: 100%;
    box-sizing: border-box;
  }

  /* Elemente aus dem normalen Layout ausblenden */
  .app-header,
  .wizard-footer,
  .cube-container,
  .screen-watermark,
  #step-container,
  #info-modal {
    display: none !important;
  }
}

.subform {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(0, 169, 238, 0.25);
}

.subform.hidden {
  display: none;
}

.wizard-footer {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.wizard-footer-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.primary-button,
.secondary-button {
  border-radius: 999px;
  padding: 0.6rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  transition: transform 0.08s ease, box-shadow 0.08s ease,
    background 0.12s ease, color 0.12s ease;
}

.primary-button {
  background: linear-gradient(135deg, #00a9ee, #36d4ff);
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(0, 169, 238, 0.6);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(0, 169, 238, 0.7);
}

.secondary-button {
  background: #f4f8fb;
  color: #05324a;
  border: 1px solid rgba(5, 50, 74, 0.12);
}

.secondary-button:hover {
  background: #e7f1f8;
}

.secondary-button:disabled,
.primary-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Toggle */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
  margin-bottom: 0.75rem;
}

.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cfd9df;
  transition: 0.2s;
  border-radius: 34px;
}

.toggle-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.2s;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.toggle input:checked + .toggle-slider {
  background-color: #00a9ee;
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(18px);
}

.toggle-label {
  font-size: 0.9rem;
  color: #05324a;
}

/* Ergebnisse & Tabellen */
.kc-table {
  margin-top: 0.75rem;
  background: #f7fbff;
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(0, 169, 238, 0.2);
  max-width: 420px;
}

.kc-table.hidden {
  display: none;
}

.kc-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.kc-table th,
.kc-table td {
  padding: 0.2rem 0.35rem;
  text-align: left;
}

.kc-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.6);
}

.results-panel {
  margin-top: 1rem;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  background: linear-gradient(
    135deg,
    rgba(0, 169, 238, 0.06),
    rgba(0, 169, 238, 0.01)
  );
  border: 1px solid rgba(0, 169, 238, 0.25);
}

.results-panel.hidden {
  display: none;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem 1.25rem;
}

.result-label {
  font-size: 0.8rem;
  color: #4c6f85;
}

.result-value {
  font-size: 1.05rem;
  font-weight: 600;
  color: #05324a;
}

.result-value.critical {
  color: #d7263d;
}

.machine-type {
  font-size: 1.2rem;
  font-weight: 600;
  color: #05324a;
}

/* Upload */
.upload-section {
  margin-top: 1rem;
}

.dropzone {
  margin-top: 0.4rem;
  padding: 1.2rem;
  border-radius: 14px;
  border: 1.5px dashed rgba(0, 169, 238, 0.45);
  background: rgba(0, 169, 238, 0.02);
  text-align: center;
  font-size: 0.9rem;
  color: #4c6f85;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease,
    transform 0.08s ease;
}

.dropzone.dragover {
  background: rgba(0, 169, 238, 0.06);
  border-color: #00a9ee;
  transform: translateY(-1px);
}

.upload-list {
  margin-top: 0.75rem;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  color: #05324a;
}

.upload-list li {
  margin-bottom: 0.1rem;
}

.hidden {
  display: none !important;
}

/* Optionen */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1.25rem;
}

.option-item {
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: #f5f9fc;
  border: 1px solid rgba(5, 50, 74, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.option-item label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.summary-panel {
  margin-top: 1rem;
  border-radius: 14px;
  background: #f5f9fc;
  border: 1px solid rgba(5, 50, 74, 0.06);
  padding: 0.9rem 1rem;
  font-size: 0.9rem;
}

.summary-group {
  margin-bottom: 0.8rem;
}

.summary-group-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: #05324a;
}

.summary-list {
  margin: 0;
  padding-left: 1.1rem;
}

.summary-list li {
  margin-bottom: 0.15rem;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 50, 74, 0.45);
}

.modal-content {
  position: relative;
  z-index: 51;
  background: #ffffff;
  border-radius: 16px;
  padding: 1rem 1.25rem 1rem;
  max-width: 460px;
  width: calc(100% - 2rem);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.modal-content h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.modal-content p {
  margin-top: 0;
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
}

.modal-image {
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(5, 50, 74, 0.1);
}

.modal-close {
  position: absolute;
  top: 0.3rem;
  right: 0.45rem;
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: #4c6f85;
}

/* 3D-Modell Produktionsmaschine (Schritt 5) */
.machine-3d-section {
  margin-top: 1.5rem;
  border-top: 1px solid rgba(5, 50, 74, 0.08);
  padding-top: 1.25rem;
}

.machine-3d-title {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  color: #05324a;
}

.machine-3d-scene {
  width: 260px;
  height: 180px;
  margin: 0 auto;
  perspective: 700px;
}

.machine-3d-scene img.machine-image {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 8px;
  background: radial-gradient(circle at top, #f5fbff, #d7ecf8);
  box-shadow: inset 0 0 0 1px rgba(5, 50, 74, 0.06);
}

.machine-3d-hint {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #4c6f85;
  text-align: center;
}

/* 3D-Würfel mit Wasserzeichen */
.cube-container {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 120px;
  height: 120px;
  pointer-events: none;
  z-index: 10;
}

.watermark {
  position: absolute;
  inset: 0;
  background-image: url("csm_thmb_platten_672ed367c5.jpg");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.18;
  filter: grayscale(40%);
}

.cube {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 70px;
  height: 70px;
  transform-style: preserve-3d;
  animation: spin 6s linear infinite;
}

.face {
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 10px;
  background: linear-gradient(135deg, #00a9ee, #36d4ff);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.face-front {
  transform: translateZ(35px);
}

.face-back {
  transform: rotateY(180deg) translateZ(35px);
}

.face-right {
  transform: rotateY(90deg) translateZ(35px);
}

.face-left {
  transform: rotateY(-90deg) translateZ(35px);
}

.face-top {
  transform: rotateX(90deg) translateZ(35px);
}

.face-bottom {
  transform: rotateX(-90deg) translateZ(35px);
}

@keyframes spin {
  0% {
    transform: rotateX(0deg) rotateY(0deg);
  }
  100% {
    transform: rotateX(360deg) rotateY(360deg);
  }
}

/* Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsives Design */
@media (max-width: 768px) {
  .app-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .header-center {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  #app-title {
    font-size: 1rem;
  }

  .logo-image {
    max-height: 34px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .options-grid {
    grid-template-columns: 1fr;
  }

  .cube-container {
    width: 90px;
    height: 90px;
  }

  .cube {
    width: 60px;
    height: 60px;
  }

  .face {
    width: 60px;
    height: 60px;
  }

  .face-front,
  .face-back,
  .face-right,
  .face-left,
  .face-top,
  .face-bottom {
    transform: none;
  }

  .face-front {
    transform: translateZ(30px);
  }

  .face-back {
    transform: rotateY(180deg) translateZ(30px);
  }

  .face-right {
    transform: rotateY(90deg) translateZ(30px);
  }

  .face-left {
    transform: rotateY(-90deg) translateZ(30px);
  }

  .face-top {
    transform: rotateX(90deg) translateZ(30px);
  }

  .face-bottom {
    transform: rotateX(-90deg) translateZ(30px);
  }
}

/* Footer-Leiste unten */
.app-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 32px;
  background: #333333;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  z-index: 6;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-links a {
  color: #ffffff;
  text-decoration: none;
  font-family: inherit;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-separator {
  opacity: 0.6;
}

