/* Multi-step invoice claim form */
.cre-ms-form {
  --ms-green: #0c4133;
  --ms-mint: #29c4a9;
  --ms-cream: #fffaed;
  --ms-gray: #ebebeb;
  --ms-border: #d6e5df;
  font-family: "PT Sans", "Segoe UI", sans-serif;
  color: var(--ms-green);
  background: #fff;
  border: 1px solid var(--ms-border);
  border-radius: 12px;
  padding: 28px 24px 32px;
  max-width: 720px;
  margin: 0 auto;
}

.cre-ms-form__title {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
}

.cre-ms-form__sub {
  margin: 0 0 22px;
  font-size: 15px;
  opacity: 0.85;
}

.cre-ms-steps {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0;
  margin: 0 0 28px;
  padding: 0 4px;
  list-style: none;
  position: relative;
}

.cre-ms-steps::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 12%;
  right: 12%;
  height: 2px;
  background: var(--ms-gray);
  z-index: 0;
}

.cre-ms-steps li {
  flex: 1;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: #6b8a80;
  padding: 0;
  border: none;
}

.cre-ms-steps__num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px solid var(--ms-gray);
  color: #6b8a80;
  font-size: 13px;
  line-height: 1;
}

.cre-ms-steps__label {
  display: block;
  max-width: 5.5rem;
  line-height: 1.2;
}

@media (min-width: 640px) {
  .cre-ms-steps__label {
    max-width: none;
    white-space: nowrap;
  }
}

.cre-ms-steps li.is-active {
  color: var(--ms-green);
  border: none;
}

.cre-ms-steps li.is-active .cre-ms-steps__num {
  border-color: var(--ms-mint);
  background: var(--ms-mint);
  color: #fff;
}

.cre-ms-steps li.is-done {
  color: var(--ms-mint);
  border: none;
}

.cre-ms-steps li.is-done .cre-ms-steps__num {
  border-color: var(--ms-mint);
  background: #e8f8f4;
  color: var(--ms-green);
}

.cre-ms-panel {
  display: none;
}

.cre-ms-panel.is-active {
  display: block;
}

.cre-ms-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.cre-ms-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cre-ms-field--full {
  grid-column: 1 / -1;
}

.cre-ms-field label {
  font-size: 14px;
  font-weight: 700;
}

.cre-ms-field label .req {
  color: #c0392b;
}

.cre-ms-field input,
.cre-ms-field select,
.cre-ms-field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--ms-border);
  border-radius: 8px;
  font: inherit;
  color: var(--ms-green);
  background: #fff;
}

.cre-ms-field input:focus,
.cre-ms-field select:focus,
.cre-ms-field textarea:focus {
  outline: 2px solid rgba(41, 196, 169, 0.35);
  border-color: var(--ms-mint);
}

.cre-ms-field .hint {
  font-size: 12px;
  opacity: 0.75;
}

.cre-ms-upload {
  border: 2px dashed var(--ms-border);
  border-radius: 10px;
  padding: 28px 16px;
  text-align: center;
  background: #f8fcfb;
  cursor: pointer;
}

.cre-ms-upload.is-dragover {
  border-color: var(--ms-mint);
  background: #eefaf7;
}

.cre-ms-upload input {
  display: none;
}

.cre-ms-upload strong {
  display: block;
  margin-bottom: 4px;
}

.cre-ms-summary {
  background: var(--ms-cream);
  border-radius: 10px;
  padding: 16px 18px;
}

.cre-ms-summary dl {
  margin: 0;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px 12px;
  font-size: 14px;
}

.cre-ms-summary dt {
  font-weight: 700;
}

.cre-ms-summary dd {
  margin: 0;
}

.cre-ms-label {
  font-size: 14px;
  font-weight: 700;
}

.cre-ms-radio-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.cre-ms-radio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.cre-ms-radio input {
  width: auto;
  margin: 0;
}

.cre-ms-file-preview {
  display: none;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--ms-border);
  border-radius: 8px;
  background: #f8fcfb;
}

.cre-ms-file-preview:not([hidden]) {
  display: block;
}

.cre-ms-file-preview__title {
  display: none;
}

.cre-ms-file-preview__row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cre-ms-file-preview__thumb {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: #eef4f1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cre-ms-file-preview__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cre-ms-file-preview__badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ms-green);
}

.cre-ms-file-preview__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: #3d5c52;
}

.cre-ms-file-preview__meta strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: var(--ms-green);
}

.cre-ms-file-preview__clear {
  flex-shrink: 0;
  min-width: auto !important;
  padding: 6px 10px;
  font-size: 12px;
}

.cre-ms-pin-wrap {
  position: relative;
  display: block;
}

.cre-ms-pin-wrap input {
  padding-right: 40px;
  width: 100%;
}

.cre-ms-pin-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  color: #6b8a80;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.cre-ms-pin-toggle svg,
.cre-ms-pin-toggle .cre-ms-pin-toggle__show,
.cre-ms-pin-toggle .cre-ms-pin-toggle__hide {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  display: block;
  flex: 0 0 16px;
}

.cre-ms-pin-toggle svg[hidden] {
  display: none !important;
}

.cre-ms-pin-toggle:hover {
  color: var(--ms-green);
}

.cre-ms-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
}

.cre-ms-check input {
  margin-top: 3px;
}

.cre-ms-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.cre-ms-actions .cre-btn {
  min-width: 120px;
}

.cre-ms-error {
  color: #c0392b;
  font-size: 13px;
  margin-top: 4px;
}

.cre-ms-alert {
  display: none;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
}

.cre-ms-alert.is-error {
  display: block;
  background: #fdecea;
  color: #c0392b;
}

.cre-ms-alert.is-success {
  display: block;
  background: #e8f8f4;
  color: var(--ms-green);
}

@media (max-width: 640px) {
  .cre-invoice-form-wrap,
  .cre-ms-form {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 20px 14px 24px;
    border-radius: 10px;
  }

  .cre-ms-form__title {
    font-size: 22px;
  }

  .cre-ms-steps {
    padding: 0;
    margin-bottom: 22px;
  }

  .cre-ms-steps__label {
    font-size: 11px;
  }

  .cre-ms-grid {
    grid-template-columns: 1fr;
  }

  .cre-ms-summary dl {
    grid-template-columns: 1fr;
  }

  .cre-ms-actions {
    flex-wrap: wrap;
  }

  .cre-ms-actions .cre-btn {
    flex: 1 1 auto;
    min-width: 0;
  }
}

/* Success panel with credentials */
.cre-success-panel {
  text-align: center;
}

.cre-credentials-box {
  background: var(--ms-cream);
  border-radius: 12px;
  padding: 24px;
  margin: 24px 0;
  text-align: left;
}

.cre-credential {
  margin-bottom: 20px;
}

.cre-credential:last-child {
  margin-bottom: 0;
}

.cre-credential label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #666;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cre-credential__value {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cre-credential__value code {
  flex: 1;
  font-size: 22px;
  font-weight: 700;
  color: var(--ms-green);
  letter-spacing: 2px;
  background: #fff;
  padding: 14px 16px;
  border-radius: 8px;
  text-align: center;
  font-family: "Consolas", "Monaco", monospace;
}

.cre-copy-btn {
  background: var(--ms-mint);
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  color: #fff;
  transition: all 0.2s;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
}

.cre-copy-btn svg {
  width: 16px !important;
  height: 16px !important;
  display: block;
  flex: 0 0 16px;
}

.cre-copy-btn:hover {
  opacity: 0.85;
}

.cre-copy-btn.is-copied {
  background: var(--ms-green);
}

.cre-copy-btn__label {
  line-height: 1;
}

.cre-credentials-warning {
  background: #fff3cd;
  border-radius: 8px;
  padding: 14px 18px;
  font-size: 14px;
  color: #856404;
  margin: 20px 0;
  text-align: left;
}

.cre-credentials-warning strong {
  color: #664d03;
}

/* Stable height to prevent multi-step form jumping */
.cre-invoice-form-wrap,
.cre-ms-form {
  min-height: 520px;
}

.cre-ms-panel.is-active {
  min-height: 380px;
}
