/* ================================================================
   DRC-P — Digitaler Reifegrad-Check Pflege
   NursIT Institute GmbH · www.nursit.de
   ================================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --teal:       #01696F;
  --dark-teal:  #0C4E54;
  --mid-teal:   #187B82;
  --light-teal: #E8F4F5;
  --pale-teal:  #f0fafb;
  --orange:     #C06000;
  --red:        #A12C2C;
  --green:      #437A22;
  --text:       #1A1A1A;
  --muted:      #555;
  --faint:      #888;
  --border:     #D4E9EB;
  --bg:         #F7F9F9;
  --white:      #FFFFFF;
  --radius:     10px;
  --shadow:     0 2px 16px rgba(1,105,111,.10);
  --transition: 0.22s cubic-bezier(.4,0,.2,1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Layout ──────────────────────────────────────────────────── */
.drc-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 16px 60px;
}

/* ── Header ──────────────────────────────────────────────────── */
.drc-header {
  background: linear-gradient(135deg, var(--dark-teal) 0%, var(--mid-teal) 100%);
  color: var(--white);
  padding: 36px 40px 32px;
  border-radius: 0 0 var(--radius) var(--radius);
  margin-bottom: 36px;
  position: relative;
  overflow: hidden;
}
.drc-header::before {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.05);
}
.drc-header .brand {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,.6);
  margin-bottom: 8px;
}
.drc-header h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--white);
  margin-bottom: 6px;
}
.drc-header .subtitle {
  font-size: 14px;
  color: rgba(255,255,255,.75);
}
.tenant-logo {
  display: block;
  width: auto;
  max-width: 180px;
  height: 36px;
  object-fit: contain;
  object-position: left center;
  margin: 0 0 12px;
}
.tenant-intro { margin-top: 8px; }

/* ── Fortschrittsleiste ──────────────────────────────────────── */
.drc-progress {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}
.drc-progress-bar {
  flex: 1;
  background: var(--light-teal);
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}
.drc-progress-fill {
  background: var(--teal);
  height: 100%;
  border-radius: 99px;
  transition: width .5s ease;
}
.drc-progress-label {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}
.drc-progress-step {
  font-size: 13px;
  font-weight: 600;
  color: var(--teal);
  white-space: nowrap;
}

/* ── Karte ───────────────────────────────────────────────────── */
.drc-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
  overflow: hidden;
  animation: fadeUp .3s ease both;
}
@keyframes fadeUp {
  from { opacity:0; transform:translateY(12px); }
  to   { opacity:1; transform:translateY(0); }
}
.drc-card-header {
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.drc-card-header .dim-icon {
  width: 38px; height: 38px;
  background: var(--light-teal);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.drc-card-header .dim-icon svg {
  width: 20px; height: 20px;
  stroke: var(--teal);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.drc-card-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark-teal);
  line-height: 1.2;
}
.drc-card-header p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.drc-card-body { padding: 20px 24px; }

/* ── Stammdatenformular ──────────────────────────────────────── */
.drc-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 540px) {
  .drc-grid-2 { grid-template-columns: 1fr; }
}
.drc-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.drc-field.full { grid-column: 1 / -1; }
.drc-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.drc-field .req { color: var(--teal); }
.drc-field input,
.drc-field select {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
}
.drc-field input:focus,
.drc-field select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(1,105,111,.12);
}
.drc-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

/* ── Fragen-Items ────────────────────────────────────────────── */
.drc-question {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.drc-question:last-child { border-bottom: none; padding-bottom: 0; }
.drc-question p {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.5;
}
.drc-scale {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 128px;
  gap: 8px;
  align-items: stretch;
}
.drc-scale label {
  display: flex;
  min-width: 0;
  cursor: pointer;
}
.drc-scale input[type=radio] { display: none; }
.drc-scale .sval {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  transition: all var(--transition);
  background: var(--white);
  line-height: 1.3;
}
.drc-scale .choice-number {
  display: block;
  margin-bottom: 7px;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}
.drc-scale .choice-label { display: block; }
.drc-scale input[type=radio]:checked + .sval {
  background: var(--teal);
  border-color: var(--teal);
  color: var(--white);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(1,105,111,.25);
}
.drc-scale label:hover .sval {
  border-color: var(--mid-teal);
  color: var(--dark-teal);
  background: var(--pale-teal);
}
.scale-legend {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--faint);
  margin-top: 4px;
  padding: 0 2px;
}
@media (max-width: 540px) {
  .drc-scale { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 150px; gap: 8px; }
  .drc-scale .sval { font-size: 11px; }
}

/* ── Buttons ─────────────────────────────────────────────────── */
.drc-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.btn {
  padding: 12px 28px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-primary {
  background: var(--teal);
  color: var(--white);
}
.btn-primary:hover { background: var(--dark-teal); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(1,105,111,.3); }
.btn-secondary {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
}
.btn-secondary:hover { border-color: var(--teal); color: var(--teal); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Datenschutz-Checkbox ────────────────────────────────────── */
.drc-dsgvo {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--pale-teal);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 8px;
}
.drc-dsgvo input[type=checkbox] {
  width: 18px; height: 18px;
  accent-color: var(--teal);
  flex-shrink: 0;
  margin-top: 2px;
}
.drc-dsgvo label {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.drc-dsgvo a { color: var(--teal); text-decoration: underline; }

/* ── Ergebnisseite ───────────────────────────────────────────── */
.result-hero {
  text-align: center;
  padding: 32px 24px 24px;
}
.result-score-ring {
  width: 130px; height: 130px;
  border-radius: 50%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  margin: 0 auto 16px;
  position: relative;
}
.result-score-ring .score-num {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}
.result-score-ring .score-pct {
  font-size: 16px;
  font-weight: 400;
}
.result-level-badge {
  display: inline-block;
  padding: 5px 18px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 12px;
}
.result-level-text {
  font-size: 14px;
  color: var(--muted);
  max-width: 500px;
  margin: 0 auto;
}

/* Dimension-Balken im Ergebnis */
.dim-bar-row {
  display: grid;
  grid-template-columns: 180px 1fr 55px 120px;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.dim-bar-row:last-child { border-bottom: none; }
.dim-bar-name { font-size: 13px; color: var(--text); }
.dim-bar-track {
  background: var(--light-teal);
  border-radius: 99px;
  height: 10px;
  overflow: hidden;
}
.dim-bar-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 1s ease;
}
.dim-bar-pct {
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}
.dimension-status {
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--status-color);
  box-shadow: 0 0 0 4px rgba(1, 105, 111, .12);
  justify-self: start;
}
@media (max-width: 580px) {
  .dim-bar-row { grid-template-columns: 1fr 55px; }
  .dim-bar-track { grid-column: 1 / -1; }
  .dimension-status { justify-self: end; }
}

/* Empfehlung */
.empf-item {
  border-left: 3px solid var(--teal);
  background: var(--pale-teal);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin-bottom: 10px;
}
.empf-item strong { display: block; font-size: 13px; color: var(--dark-teal); margin-bottom: 4px; }
.empf-item p { font-size: 13px; color: var(--muted); }

.allgemein-box {
  background: var(--light-teal);
  border-radius: 8px;
  padding: 16px 20px;
  margin-top: 8px;
}
.allgemein-box p { font-size: 14px; color: var(--dark-teal); }

/* ── Alerts ──────────────────────────────────────────────────── */
.drc-alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}
.drc-alert-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
}
.drc-alert-success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
}

/* ── Datenschutz-Seite ───────────────────────────────────────── */
.drc-datenschutz h2 { font-size: 18px; color: var(--dark-teal); margin: 24px 0 8px; }
.drc-datenschutz h3 { font-size: 15px; color: var(--teal); margin: 16px 0 6px; }
.drc-datenschutz p, .drc-datenschutz li { font-size: 14px; color: var(--muted); margin-bottom: 8px; line-height: 1.7; }
.drc-datenschutz ul { padding-left: 20px; }
.drc-datenschutz a { color: var(--teal); }

/* ── Footer ──────────────────────────────────────────────────── */
.drc-footer {
  text-align: center;
  padding: 24px 0 0;
  font-size: 12px;
  color: var(--faint);
}
.drc-footer a { color: var(--teal); text-decoration: none; }
.drc-footer a:hover { text-decoration: underline; }

/* ── Anbieterbereich ─────────────────────────────────────────── */
.drcp-admin { max-width: 1040px; }
.drc-admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.drc-admin-bar form { margin: 0; }
.drc-link-field {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  background: var(--pale-teal);
  color: var(--dark-teal);
  font-size: 14px;
}
.drcp-table-wrap { overflow-x: auto; }

.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;
}
.drc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.drc-table th, .drc-table td { padding: 11px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.drc-table th { color: var(--dark-teal); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.drc-table .dimension-status { display: inline-block; margin: 0; }
@media (max-width: 540px) {
  .drc-admin-bar { align-items: flex-start; flex-direction: column; }
  .drc-admin-bar .btn { width: 100%; justify-content: center; }
}

/* ── Spinner ──────────────────────────────────────────────────── */
.drc-spinner {
  display: none;
  width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,.4);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn.loading .drc-spinner { display: inline-block; }
.btn.loading .btn-text { opacity: .7; }
