/* HUG Reinigungsprotokoll – Brand colors from huglueftungsanlagen.de */
/* Primary teal: #2DD4C0  |  Dark navy: #1B2A3B  |  Light teal: #E8FAF8 */

/* ── Launch Button ── */
.hug-launch-wrap { padding: 8px 0; }
.hug-launch-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 28px;
  background: #2DD4C0; color: #1B2A3B;
  border: none; border-radius: 10px;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  box-shadow: 0 4px 16px rgba(45,212,192,0.35);
}
.hug-launch-btn:hover { background: #25bfad; transform: translateY(-1px); }
.hug-launch-btn:active { transform: scale(0.98); }
.hug-launch-icon { font-size: 20px; }

/* ── Modal Overlay ── */
.hug-modal-overlay {
  display: none;
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,0.55);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0;
}
.hug-modal-overlay.open { display: flex; align-items: flex-start; justify-content: center; }

.hug-modal-inner {
  background: #f4f6f8;
  width: 100%; max-width: 560px;
  min-height: 100vh;
  display: flex; flex-direction: column;
  position: relative;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* ── Modal Header ── */
.hug-modal-header {
  background: #1B2A3B;
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
  flex-shrink: 0;
}
.hug-modal-title { display: flex; flex-direction: column; gap: 2px; }
.hug-modal-title span { font-size: 16px; font-weight: 600; color: #fff; }
.hug-modal-title small { font-size: 11px; color: #2DD4C0; letter-spacing: 0.08em; text-transform: uppercase; }
.hug-modal-close {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,0.12); border: none;
  color: #fff; font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
}
.hug-modal-close:hover { background: rgba(255,255,255,0.22); }

/* ── App Container ── */
#hug-protokoll-app {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f4f6f8;
  color: #1B2A3B;
  flex: 1;
  display: flex; flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Global box-sizing inside app */
#hug-protokoll-app *, #hug-modal-overlay * {
  box-sizing: border-box;
}

/* Steps */
.hug-steps {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #e5e9ee;
  overflow-x: auto;
  scrollbar-width: none;
}
.hug-steps::-webkit-scrollbar { display: none; }
.hug-step {
  flex: 1; min-width: 52px;
  display: flex; flex-direction: column; align-items: center;
  padding: 10px 4px 8px;
  gap: 4px;
  font-size: 9px; font-weight: 600; letter-spacing: 0.05em;
  text-transform: uppercase; color: #9aa5b4;
  position: relative;
  cursor: default;
  transition: color 0.15s;
}
.hug-step.active { color: #2DD4C0; }
.hug-step.done { color: #1B2A3B; }
.hug-step.active::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: #2DD4C0;
}
.hug-step-dot {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  transition: all 0.15s;
}
.hug-step.active .hug-step-dot { background: #2DD4C0; border-color: #2DD4C0; color: #fff; }
.hug-step.done .hug-step-dot { background: #1B2A3B; border-color: #1B2A3B; color: #fff; }

/* Pages */
.hug-pages { overflow: hidden; }
.hug-page { display: none; padding: 20px 20px 8px; flex-direction: column; gap: 12px; }
.hug-page.active { display: flex; }

/* Section label */
.hug-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.10em;
  text-transform: uppercase; color: #2DD4C0;
  padding-bottom: 6px;
  border-bottom: 1px solid #e8faf8;
}

/* Fields */
.hug-field { display: flex; flex-direction: column; gap: 5px; }
.hug-field label { font-size: 12px; font-weight: 500; color: #4a5568; }
.hug-field input,
.hug-field textarea,
.hug-field select {
  padding: 10px 12px; font-size: 16px;
  border: 1px solid #dde2e8;
  border-radius: 8px;
  background: #fff;
  color: #1B2A3B;
  outline: none;
  width: 100%;
  max-width: 100%;
  -webkit-appearance: none;
  -webkit-text-size-adjust: 100%;
  transition: border-color 0.15s;
}
.hug-field input:focus,
.hug-field textarea:focus,
.hug-field select:focus { border-color: #2DD4C0; box-shadow: 0 0 0 3px rgba(45,212,192,0.12); }
.hug-field textarea { min-height: 76px; resize: none; line-height: 1.5; }
.hug-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Checkboxes */
.hug-checks { display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; border: 1px solid #dde2e8; }
.hug-check {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: #fff;
  cursor: pointer;
  transition: background 0.1s;
}
.hug-check + .hug-check { border-top: 1px solid #f0f2f5; }
.hug-check:active { background: #f4f6f8; }
.hug-check-box {
  width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 6px;
  border: 1.5px solid #b0bac6;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; transition: all 0.12s;
}
.hug-check.checked .hug-check-box {
  background: #2DD4C0; border-color: #2DD4C0; color: #fff;
}
.hug-check.checked .hug-check-box::after { content: '✓'; color: #fff; font-weight: 700; font-size: 13px; }
.hug-check span { font-size: 14px; color: #1B2A3B; }

/* Toggle */
.hug-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border: 1px solid #dde2e8;
  border-radius: 10px; padding: 13px 16px;
  font-size: 14px; color: #1B2A3B;
}
.hug-toggle {
  width: 46px; height: 26px; border-radius: 13px;
  background: #ccc; border: none; cursor: pointer;
  position: relative; flex-shrink: 0;
  transition: background 0.2s;
}
.hug-toggle.on { background: #2DD4C0; }
.hug-toggle::after {
  content: ''; position: absolute;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.hug-toggle.on::after { transform: translateX(20px); }

/* Photo upload */
.hug-hint { font-size: 13px; color: #6b7280; line-height: 1.5; margin: 0; }

.hug-upload-area {
  background: #fff;
  border: 2px dashed #b0e8e2;
  border-radius: 12px;
  padding: 28px 20px;
  text-align: center;
  transition: border-color 0.15s;
}
.hug-upload-area.dragover { border-color: #2DD4C0; background: #e8faf8; }
.hug-upload-icon { font-size: 40px; margin-bottom: 8px; }
.hug-upload-title { font-size: 16px; font-weight: 600; color: #1B2A3B; }
.hug-upload-sub { font-size: 13px; color: #6b7280; margin-top: 4px; margin-bottom: 16px; }
.hug-upload-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.hug-btn-upload {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 8px;
  background: #2DD4C0; color: #1B2A3B;
  font-size: 14px; font-weight: 600;
  cursor: pointer; border: none;
  transition: background 0.15s;
}
.hug-btn-upload:hover { background: #25bfad; }
.hug-btn-upload-sec { background: #f0f2f5; color: #1B2A3B; }
.hug-btn-upload-sec:hover { background: #e5e9ee; }

.hug-foto-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-top: 12px;
}
.hug-foto-thumb {
  position: relative; border-radius: 8px; overflow: hidden;
  aspect-ratio: 1; background: #e5e9ee;
}
.hug-foto-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hug-foto-remove {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(27,42,59,0.75); color: #fff;
  border: none; cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.hug-foto-uploading { opacity: 0.5; }
.hug-foto-overlay {
  position: absolute; inset: 0;
  background: rgba(45,212,192,0.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; font-weight: 600;
}

.hug-upload-status { font-size: 13px; color: #6b7280; min-height: 18px; margin-top: 4px; }
.hug-upload-status.error { color: #e53e3e; }

/* Signature */
.hug-sig-wrap {
  border: 1px solid #dde2e8; border-radius: 10px; overflow: hidden; background: #fff;
}
.hug-sig-top {
  padding: 8px 12px;
  border-bottom: 1px solid #f0f2f5;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: #6b7280;
}
.hug-sig-clear { background: none; border: none; cursor: pointer; font-size: 12px; color: #2DD4C0; font-weight: 600; }
#hugSigCanvas { display: block; width: 100%; height: 130px; cursor: crosshair; touch-action: none; }

/* Summary */
.hug-summary {
  background: #fff; border: 1px solid #dde2e8; border-radius: 10px; overflow: hidden;
}
.hug-sum-section { padding: 10px 14px; border-bottom: 1px solid #f0f2f5; }
.hug-sum-section:last-child { border-bottom: none; }
.hug-sum-section h4 { font-size: 10px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: #2DD4C0; margin: 0 0 6px; }
.hug-sum-row { display: flex; justify-content: space-between; font-size: 13px; padding: 2px 0; gap: 8px; }
.hug-sum-row .k { color: #6b7280; flex-shrink: 0; }
.hug-sum-row .v { color: #1B2A3B; font-weight: 500; text-align: right; }

/* Info box */
.hug-info-box {
  padding: 12px 14px;
  background: #e8faf8; border: 1px solid #b0e8e2;
  border-radius: 8px; font-size: 13px; color: #0d6a60; line-height: 1.5;
}

/* Navigation */
.hug-nav {
  display: flex; gap: 10px;
  padding: 14px 20px;
  background: #fff;
  border-top: 1px solid #e5e9ee;
  position: sticky; bottom: 0;
}
.hug-btn-back {
  padding: 12px 16px; border-radius: 8px;
  border: 1px solid #dde2e8;
  background: #f4f6f8; color: #4a5568;
  font-size: 14px; cursor: pointer;
  display: none;
}
.hug-btn-next {
  flex: 1; padding: 13px;
  border-radius: 8px; border: none;
  background: #2DD4C0; color: #1B2A3B;
  font-size: 15px; font-weight: 700;
  cursor: pointer; transition: background 0.15s;
}
.hug-btn-next:hover { background: #25bfad; }
.hug-btn-next:disabled { opacity: 0.6; }

/* Done screen */
.hug-done {
  text-align: center; padding: 52px 24px;
  background: #fff;
}
.hug-done-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: #e8faf8; border: 2px solid #2DD4C0;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #2DD4C0;
  margin: 0 auto 16px;
}
.hug-done h3 { font-size: 20px; font-weight: 700; color: #1B2A3B; margin: 0 0 8px; }
.hug-done p { font-size: 14px; color: #6b7280; line-height: 1.6; margin: 0 0 24px; }
.hug-btn-new {
  padding: 13px 32px; background: #2DD4C0; color: #1B2A3B;
  border: none; border-radius: 8px;
  font-size: 15px; font-weight: 700; cursor: pointer;
}

/* Error state */
.hug-field input.hug-error { border-color: #e53e3e; }

@media (max-width: 480px) {
  #hug-protokoll-app { border-radius: 0; box-shadow: none; }
  .hug-pages .hug-page { padding: 16px 16px 8px; }
  .hug-nav { padding: 12px 16px; }
}
