/*
 * Unlock the full case: hero trigger, code dialog and the confidential parts
 * once unlocked. Shared by every case with a protected part
 * (js/nda-unlock.js, PASSWORT-BEREICH.md). Load after case-base.css; uses
 * its tokens. The trigger takes the page's own button classes. Prefix nda-.
 */

.nda-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Trigger in the hero ---------- */

.nda-open__icon {
  flex: none;
  width: 18px;
  height: 18px;
}

[data-nda-open] {
  cursor: pointer;
}

.nda-status {
  max-width: 520px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font: 500 14px/1.5 var(--case-font);
}

.nda-status[hidden] {
  display: none;
}

/* ---------- Places for the confidential parts ---------- */

/* Empty and invisible until unlocked; the public page reads as complete. */
.nda-slot:not(.is-unlocked) {
  display: none;
}

.nda-slot {
  margin: clamp(48px, 6vw, 80px) 0 0;
  padding-top: 18px;
  border-top: 2px solid var(--portfolio-blue);
  font-family: var(--case-font);
}

.nda-slot__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 28px;
  color: var(--portfolio-blue);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nda-slot__label::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.nda-slot--enter {
  opacity: 0;
  transform: translateY(12px);
}

@media (prefers-reduced-motion: no-preference) {
  .nda-slot {
    transition: opacity 0.45s ease, transform 0.45s ease;
  }
}

/* ---------- Code dialog ---------- */

.nda-dialog {
  box-sizing: border-box;
  width: min(100% - 32px, 520px);
  max-width: none;
  max-height: calc(100% - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 20px;
  background: #fff;
  color: var(--case-ink);
  box-shadow: 0 24px 80px rgba(16, 18, 21, 0.35);
  font-family: var(--case-font);
}

.nda-dialog::backdrop {
  background: rgba(16, 18, 21, 0.62);
}

.nda-dialog__form {
  position: relative;
  margin: 0;
  padding: 36px 36px 30px;
}

.nda-dialog__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--case-muted);
  cursor: pointer;
}

.nda-dialog__close svg {
  width: 20px;
  height: 20px;
}

.nda-dialog__close:hover {
  background: #f1f1f3;
  color: var(--case-ink);
}

.nda-dialog__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0 0 20px;
  border: 1.5px solid var(--portfolio-blue);
  border-radius: 50%;
  color: var(--portfolio-blue);
}

.nda-dialog__icon .nda-open__icon {
  width: 20px;
  height: 20px;
}

.nda-dialog__title {
  margin: 0;
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.nda-dialog__text {
  margin: 12px 0 0;
  color: var(--case-muted);
  font-size: 16px;
  line-height: 1.6;
}

.nda-dialog__label {
  display: block;
  margin: 26px 0 8px;
  font-size: 14px;
  font-weight: 600;
}

.nda-dialog__row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.nda-dialog__input {
  flex: 1 1 240px;
  min-width: 0;
  min-height: 52px;
  padding: 10px 16px;
  border: 1.5px solid #8d9196;
  border-radius: 12px;
  background: #fff;
  color: var(--case-ink);
  font: 600 18px/1.3 var(--case-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nda-dialog__input::placeholder {
  color: #9a9ea3;
}

.nda-dialog__input:focus-visible {
  border-color: var(--portfolio-blue);
}

.nda-dialog__input[aria-invalid='true'] {
  border-color: #c4262e;
}

.nda-dialog__submit {
  min-height: 52px;
  padding: 12px 28px;
  border: 0;
  border-radius: 999px;
  background: var(--portfolio-blue);
  color: #fff;
  font: 600 16px/1.3 var(--case-font);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.nda-dialog__submit:hover {
  background: #2c33c9;
}

.nda-dialog__submit:disabled {
  background: #6e74ea;
  cursor: progress;
}

.nda-dialog__hint {
  margin: 10px 0 0;
  color: var(--case-muted);
  font-size: 13px;
  line-height: 1.5;
}

.nda-dialog__error {
  margin: 8px 0 0;
  color: #b0222a;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.nda-dialog__error:empty {
  margin: 0;
}

.nda-dialog__ask {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--case-line);
  color: var(--case-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* !important: the global link rule in custom.css sets colour and underline
   with a much higher specificity. */
.nda-dialog__ask a {
  color: var(--portfolio-blue) !important;
  font-weight: 600;
  text-decoration: underline !important;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

@media (max-width: 479px) {
  .nda-dialog__form {
    padding: 28px 20px 22px;
  }

  .nda-dialog__submit {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nda-dialog__submit {
    transition: none;
  }
}
