/**
 * Icarus Rigging — Rigging-Auftrag Widget Stylesheet
 * Scoped unter .rgw-frame, kollidiert nicht mit Tenant-Webseite-CSS.
 * Tenant-Akzentfarbe wird via CSS-Variable --rgw-accent injiziert.
 *
 * Phase 2 Icarus Rigging — 15.05.2026.
 */

#rigging-root {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1a1f2e;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#rigging-root.rgw-loading {
  padding: 32px;
  text-align: center;
  color: #6b7280;
  font-style: italic;
}

.rgw-fatal {
  padding: 20px;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #991b1b;
  font-size: 14px;
}

/* ─── Layout ─── */
.rgw-frame {
  max-width: 980px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #e3dfd4;
  border-radius: 12px;
  box-shadow: 0 6px 24px -8px rgba(25, 52, 89, 0.18);
  overflow: hidden;
  --rgw-accent: #193459;
}

/* ─── Header ─── */
.rgw-head {
  padding: 18px 28px;
  border-bottom: 1px solid #e3dfd4;
  background: #fafaf7;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.rgw-brand { display: flex; align-items: center; gap: 12px; }
.rgw-logo { width: 36px; height: 36px; object-fit: contain; border-radius: 6px; }
.rgw-brand-name { font-weight: 600; font-size: 17px; color: var(--rgw-accent); }
.rgw-brand-sub { font-size: 12px; color: #8a96a9; letter-spacing: 0.04em; }
.rgw-tag {
  font-size: 12px; color: #8a96a9;
  padding: 4px 10px; background: #f0ede5; border-radius: 999px;
  font-style: italic;
}

/* ─── Body: Sidebar + Content ─── */
.rgw-body {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 600px;
}
.rgw-nav {
  background: #fafaf7;
  border-right: 1px solid #e3dfd4;
  padding: 20px 16px;
}
.rgw-step {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  cursor: default;
  margin-bottom: 4px;
  transition: background 0.12s;
}
.rgw-step.done { cursor: pointer; }
.rgw-step.done:hover { background: #f0ede5; }
.rgw-step-num {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #f0ede5;
  border: 1px solid #cfc9b8;
  display: grid; place-items: center;
  font-weight: 600; font-size: 13px;
  color: #8a96a9;
}
.rgw-step.done .rgw-step-num {
  background: #dcefdf; border-color: #2f7a4e; color: #2f7a4e;
}
.rgw-step.active .rgw-step-num {
  background: var(--rgw-accent); border-color: var(--rgw-accent); color: #fff;
}
.rgw-step-label { font-weight: 600; font-size: 14px; color: #1a1f2e; }
.rgw-step-desc { font-size: 12px; color: #8a96a9; margin-top: 2px; }

/* ─── Content ─── */
.rgw-content { padding: 32px 36px; overflow-y: auto; }
.rgw-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 600;
  color: var(--rgw-accent);
  letter-spacing: -0.01em;
}
.rgw-subtitle {
  margin: 0 0 24px;
  font-size: 14px;
  color: #8a96a9;
  line-height: 1.5;
}
.rgw-section { margin-bottom: 24px; }
.rgw-section-h {
  font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  color: #4a5b76;
  margin: 0 0 12px;
}

/* ─── Form-Atoms ─── */
.rgw-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.rgw-lbl {
  display: block;
  font-size: 12px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: #4a5b76;
  margin-bottom: 6px;
}
.rgw-req::after { content: ' *'; color: #c8703a; }
.rgw-inp, .rgw-sel, .rgw-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #e3dfd4;
  border-radius: 8px;
  background: #ffffff;
  color: #1a1f2e;
  font: inherit; font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}
.rgw-inp:focus, .rgw-sel:focus, .rgw-textarea:focus {
  outline: none;
  border-color: var(--rgw-accent);
  box-shadow: 0 0 0 3px rgba(25, 52, 89, 0.12);
}
.rgw-textarea { resize: vertical; min-height: 80px; font-family: inherit; }
.rgw-sel:disabled, .rgw-inp:disabled { background: #f5f3ee; color: #8a96a9; cursor: not-allowed; }

.rgw-check {
  display: flex; align-items: flex-start; gap: 8px;
  margin-top: 8px;
  font-size: 14px;
  color: #4a5b76;
  cursor: pointer;
  line-height: 1.4;
}
.rgw-check input { margin-top: 2px; accent-color: var(--rgw-accent); }
.rgw-hint { font-size: 12px; color: #8a96a9; margin: 4px 0 0; line-height: 1.4; }

.rgw-warn {
  margin-top: 8px;
  padding: 10px 12px;
  border-left: 3px solid #b8731f;
  background: #fef3e2;
  border-radius: 4px;
  font-size: 13px;
  color: #7c4a0f;
  line-height: 1.4;
}

/* ─── Rig (Schritt 2) ─── */
.rgw-rig {
  border: 1px solid #e3dfd4;
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}
.rgw-rig-head {
  padding: 14px 20px;
  background: #fafaf7;
  border-bottom: 1px solid #e3dfd4;
  display: flex; align-items: center; gap: 12px;
}
.rgw-rig-name { flex: 1; display: flex; align-items: center; gap: 10px; }
.rgw-rig-prefix {
  font-weight: 600; color: var(--rgw-accent);
  white-space: nowrap;
}
.rgw-rig-input {
  flex: 1;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: #1a1f2e;
  padding: 4px 0;
  border-bottom: 1px dashed transparent;
}
.rgw-rig-input:focus {
  outline: none;
  border-bottom-color: var(--rgw-accent);
}
.rgw-rig-rm {
  border: none;
  background: transparent;
  font-size: 18px;
  width: 28px; height: 28px;
  border-radius: 50%;
  color: #8a96a9;
  cursor: pointer;
}
.rgw-rig-rm:hover { background: #fee2e2; color: #991b1b; }
.rgw-rig-body { padding: 20px; display: grid; gap: 16px; }

/* ─── Komponente ─── */
.rgw-comp {
  border: 1px solid #e3dfd4;
  border-radius: 8px;
  padding: 16px 18px;
  background: #fafaf7;
}
.rgw-comp-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.rgw-comp-icon {
  width: 22px; height: 22px;
  color: var(--rgw-accent);
  display: inline-flex;
}
.rgw-comp-icon svg { width: 100%; height: 100%; }
.rgw-comp-title {
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--rgw-accent);
  flex: 1;
}
.rgw-comp-req { color: #c8703a; }
.rgw-comp-opt { font-size: 10px; font-weight: 500; color: #8a96a9; text-transform: none; letter-spacing: 0; }
.rgw-comp-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  color: #4a5b76;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}
.rgw-comp-toggle input { accent-color: var(--rgw-accent); }

.rgw-custom {
  margin: 8px 0;
  padding: 12px;
  background: #fef3e2;
  border-radius: 6px;
  border-left: 3px solid #b8731f;
}

/* ─── Auftrag (Schritt 3) ─── */
.rgw-order {
  border: 1px solid #e3dfd4;
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 16px;
  background: #ffffff;
}
.rgw-order-title {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
  color: var(--rgw-accent);
}

/* ─── Bestätigung (Schritt 4) ─── */
.rgw-summary { display: grid; gap: 12px; }
.rgw-summary-block {
  padding: 16px 20px;
  background: #fafaf7;
  border: 1px solid #e3dfd4;
  border-radius: 8px;
}
.rgw-summary-block h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #4a5b76;
}
.rgw-summary-block > div { font-size: 14px; line-height: 1.6; }
.rgw-pill {
  display: inline-block;
  margin: 4px 4px 0 0;
  padding: 4px 10px;
  background: #f0ede5;
  border-radius: 6px;
  font-size: 12px;
  color: #4a5b76;
}
.rgw-pill-lg {
  font-size: 16px;
  padding: 8px 16px;
  font-weight: 600;
  color: var(--rgw-accent);
  background: rgba(25, 52, 89, 0.08);
}
.rgw-datenschutz { background: #fef3e2; border-color: #f5e6da; }

/* ─── Footer (Actions) ─── */
.rgw-actions {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 28px;
  border-top: 1px solid #e3dfd4;
  background: #fafaf7;
}
.rgw-btn {
  font: inherit;
  font-weight: 600; font-size: 14px;
  padding: 11px 22px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.rgw-btn-primary {
  background: var(--rgw-accent);
  color: #fff;
}
.rgw-btn-primary:hover:not(:disabled) {
  filter: brightness(0.92);
}
.rgw-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.rgw-btn-ghost {
  background: transparent;
  color: #4a5b76;
  border-color: #cfc9b8;
}
.rgw-btn-ghost:hover:not(:disabled) { background: #f0ede5; }
.rgw-btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; }
.rgw-btn-warm {
  background: #fef3e2;
  color: #b8731f;
  border: 1px dashed #b8731f;
}
.rgw-btn-warm:hover { background: #f5e6da; }
.rgw-error {
  flex: 1;
  font-size: 13px;
  color: #991b1b;
  font-weight: 500;
}

/* ─── Erfolg ─── */
.rgw-success {
  padding: 64px 32px;
  text-align: center;
}
.rgw-success-icon {
  width: 64px; height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: #dcefdf;
  color: #2f7a4e;
  display: grid; place-items: center;
  font-size: 32px;
  font-weight: 700;
}
.rgw-success h2 {
  margin: 0 0 8px;
  color: var(--rgw-accent);
}
.rgw-order-numbers {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center;
  margin: 12px 0;
}

/* ─── Responsive ─── */
@media (max-width: 760px) {
  .rgw-body { grid-template-columns: 1fr; }
  .rgw-nav {
    border-right: none;
    border-bottom: 1px solid #e3dfd4;
    padding: 12px;
    display: flex;
    overflow-x: auto;
    gap: 8px;
  }
  .rgw-step { flex-shrink: 0; padding: 8px 12px; }
  .rgw-step-desc { display: none; }
  .rgw-content { padding: 24px 20px; }
  .rgw-row { grid-template-columns: 1fr !important; }
  .rgw-head { padding: 14px 20px; }
  .rgw-actions { padding: 14px 20px; flex-wrap: wrap; }
  .rgw-error { flex-basis: 100%; order: 3; }
}
