/*
 * H&S Music Artist Panel – Release Wizard: Rechte & Lizenzen
 *
 * Fachbereichsbezogene Darstellung für Rechte, Plattform-Eignung,
 * Copyright-Lines und Lizenznachweise. Keine eigene Save-Logik:
 * bestehende Wizard-Handler in app.js bleiben unverändert.
 */

.wizard-rights-stack {
  width: 100%;
  display: grid;
}

.wizard-rights-section {
  width: 100%;
  min-width: 0;
  padding: 0 0 32px;
  margin: 0 0 32px;
  border: 0;
  border-bottom: 1px solid var(--hs-line-subtle);
  border-radius: 0;
  background: transparent;
}

.wizard-rights-section:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.wizard-rights-section-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 18px;
}

.wizard-rights-section h3,
.wizard-rights-section h4,
.wizard-rights-section h5,
.wizard-track-license-pro-head strong {
  margin: 0;
  color: var(--hs-text);
}

.wizard-rights-section h3 {
  font-size: var(--hs-text-xl);
  line-height: 1.25;
  font-weight: var(--hs-weight-bold);
}

.wizard-rights-section h4 {
  font-size: var(--hs-text-lg);
  line-height: 1.3;
  font-weight: var(--hs-weight-semibold);
}

.wizard-rights-section .small-muted {
  margin: 0;
  color: var(--hs-text-muted);
}

#wizardRightsForm,
#wizardRightsInstagramForm,
#wizardRightsLinesForm,
.wizardTrackLicenseUploadForm,
.wizardTrackLicenseLinksForm {
  width: 100%;
  max-width: none;
  margin: 0;
}

.wizard-rights-choice-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.wizard-rights-choice {
  position: relative;
  min-width: 0;
  min-height: 94px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--hs-line);
  border-radius: var(--hs-radius-md);
  background: transparent;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition:
    border-color var(--hs-duration-fast) var(--hs-ease-standard),
    background-color var(--hs-duration-fast) var(--hs-ease-standard);
}

.wizard-rights-choice:hover {
  border-color: var(--hs-line-strong);
  background: rgba(255, 255, 255, 0.02);
}

.wizard-rights-choice:has(input:checked) {
  border-color: var(--hs-brand-line);
  background: var(--hs-brand-soft);
}

.wizard-rights-choice:focus-within {
  outline: 2px solid var(--hs-brand-500);
  outline-offset: 2px;
}

.wizard-rights-choice input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--hs-brand-500);
  cursor: pointer;
}

.wizard-rights-choice > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.wizard-rights-choice strong {
  display: block;
  color: var(--hs-text);
  font-size: 15px;
  line-height: 1.35;
  font-weight: var(--hs-weight-semibold);
}

.wizard-rights-choice span,
.wizard-rights-choice small {
  display: block;
  margin: 0;
  color: var(--hs-text-muted);
  font-size: 12px;
  line-height: 1.5;
  font-weight: var(--hs-weight-regular);
}

.wizard-rights-license-inline {
  width: 100%;
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--hs-line-subtle);
}

.wizard-rights-license-inline > .small-muted {
  margin-top: 6px;
}

.wizard-track-license-panel {
  width: 100%;
  min-width: 0;
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid var(--hs-line-subtle);
}

.wizard-track-license-pro-head {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.wizard-track-license-pro-head strong {
  font-size: 15px;
  line-height: 1.35;
  font-weight: var(--hs-weight-semibold);
}

.wizard-track-license-pro-head span {
  color: var(--hs-text-muted);
  font-size: 12px;
  line-height: 1.45;
}

.r9-license-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.r9-license-card {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.r9-license-card input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.r9-license-main {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--hs-line);
  border-radius: var(--hs-radius-md);
  background: transparent;
}

.r9-license-file-main {
  position: relative;
  cursor: pointer;
}

.r9-license-file-main:hover {
  border-color: var(--hs-brand-line);
}

.r9-license-icon {
  color: var(--hs-brand-400);
  font-size: 18px;
  line-height: 1;
}

.r9-license-main strong {
  color: var(--hs-text);
  font-size: 14px;
  line-height: 1.35;
  font-weight: var(--hs-weight-semibold);
}

.r9-license-main small {
  color: var(--hs-text-muted);
  font-size: 11px;
  line-height: 1.45;
  font-weight: var(--hs-weight-regular);
}

.r9-license-link-main {
  gap: 8px;
}

.r9-license-link-input {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 5px;
  border: 1px solid var(--hs-line);
  border-radius: var(--hs-radius-sm);
  background: var(--hs-surface-2);
}

.r9-license-link-input input {
  min-width: 0;
  height: 38px;
  margin: 0;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--hs-text);
  box-shadow: none;
}

.r9-license-link-input input:focus {
  outline: 0;
}

.r9-license-link-input:focus-within {
  border-color: var(--hs-brand-line);
  box-shadow: var(--hs-focus-ring);
}

.r9-license-link-input > span {
  padding: 6px 8px;
  color: var(--hs-text-subtle);
  font-size: 11px;
  line-height: 1;
  font-weight: var(--hs-weight-medium);
}

.r9-license-footer {
  min-height: 0;
}

.r9-license-footer .message,
.r9-license-footer .upload-result {
  margin: 0;
}

.r9-license-file-main.is-uploading {
  pointer-events: none;
  opacity: 0.72;
}

.r9-license-file-main.is-uploading::after {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--hs-line);
  border-top-color: var(--hs-brand-400);
  border-radius: var(--hs-radius-round);
  animation: hsRightsLicenseSpin 0.8s linear infinite;
}

@keyframes hsRightsLicenseSpin {
  to {
    transform: rotate(360deg);
  }
}

.wizardTrackLicenseUploadResult:empty,
.wizardTrackLicenseLinksMessage:not(.show) {
  display: none;
}

.wizard-track-license-saved-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.wizard-track-license-saved-box {
  min-width: 0;
}

.wizard-track-license-saved-box h5 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  color: var(--hs-text-muted);
  font-size: 12px;
  line-height: 1.35;
  font-weight: var(--hs-weight-medium);
}

.wizard-license-list-count {
  flex: 0 0 auto;
  color: var(--hs-text-subtle);
  font-size: 11px;
  font-weight: var(--hs-weight-medium);
}

.wizard-license-simple-list {
  display: grid;
}

.wizard-license-simple-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 28px;
  gap: 8px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--hs-line-subtle);
}

.wizard-license-simple-count {
  color: var(--hs-text-subtle);
  font-size: 11px;
  font-weight: var(--hs-weight-medium);
}

.wizard-license-simple-row a,
.wizard-license-simple-row strong {
  min-width: 0;
  overflow: hidden;
  color: var(--hs-text);
  font-size: 12px;
  line-height: 1.4;
  font-weight: var(--hs-weight-medium);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wizard-license-simple-row a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.wizard-license-document-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.wizard-license-document-copy strong {
  display: block;
}

.wizard-asset-scan-state,
.wizard-license-scan-state {
  color: var(--hs-text-subtle);
  font-size: 11px;
  line-height: 1.35;
}

.wizard-asset-scan-state.is-error,
.wizard-license-scan-state.is-error {
  color: var(--hs-danger);
}

.wizard-license-simple-delete,
.wizardDeleteLicenseDocumentButton {
  width: 28px;
  height: 28px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--hs-radius-sm);
  background: transparent;
  color: var(--hs-text-subtle);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.wizard-license-simple-delete:hover,
.wizardDeleteLicenseDocumentButton:hover {
  background: var(--hs-danger-soft);
  color: var(--hs-danger);
}

.wizard-license-empty {
  margin: 0;
  padding: 9px 0;
  color: var(--hs-text-subtle);
  font-size: 12px;
}

#wizardRightsLinesForm {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

#wizardRightsLinesForm label {
  min-width: 0;
  display: grid;
  gap: 8px;
  color: var(--hs-text-muted);
  font-size: 13px;
  font-weight: var(--hs-weight-medium);
}

#wizardRightsLinesForm input {
  width: 100%;
  min-width: 0;
  margin: 0;
}

@media (max-width: 760px) {
  .wizard-rights-section {
    padding-bottom: 24px;
    margin-bottom: 24px;
  }

  .wizard-rights-choice-grid,
  .r9-license-grid,
  .wizard-track-license-saved-grid,
  #wizardRightsLinesForm {
    grid-template-columns: 1fr;
  }

  .wizard-rights-choice {
    min-height: 0;
  }
}

@media (max-width: 620px) {
  .wizard-rights-choice-grid {
    gap: 10px;
  }

  .wizard-rights-choice {
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    padding: 13px 12px;
    border-radius: var(--hs-radius-sm);
  }

  .wizard-rights-choice input[type="radio"] {
    width: 18px;
    height: 18px;
  }

  .wizard-rights-choice > div {
    gap: 2px;
  }

  .wizard-rights-choice strong {
    font-size: 14px;
  }

  .wizard-rights-choice span,
  .wizard-rights-choice small {
    font-size: 12px;
    line-height: 1.4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .r9-license-file-main.is-uploading::after {
    animation: none;
  }
}
