:root {
  --cad-mint: #b8d8d8;
  --cad-blue: #0f6cc8;
  --cad-blue-dark: #0a4d8c;
  --cad-bg: #f5f8f9;
  --cad-border: #dbe4e6;
  --cad-error: #c0392b;
  --cad-success: #2e8b57;
  --cad-warning: #b88400;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 3px 8px rgba(0, 0, 0, 0.12);
  --shadow-focus: 0 0 0 3px rgba(15, 108, 200, 0.25);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--cad-bg);
  color: #1f2d35;
}

.cad-header {
  text-align: center;
  padding: 32px 16px 12px;
}

.cad-logo {
  /* Increased to double the previous size to make partner logos more prominent */
  width: 280px;
  max-width: 40vw; /* responsive cap for small screens */
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .15));
}

.cad-title {
  margin: 12px 0 4px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  color: var(--cad-blue-dark);
}

.cad-subtitle {
  margin: 0;
  font-size: 0.95rem;
  color: #375267;
}

.app-root {
  width: 100%;
  max-width: 880px;
  margin: 0 auto 64px;
  padding: 0 20px 40px;
}

.step-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 24px;
}

.progress-step {
  flex: 1 1 110px;
  background: #fff;
  border: 1px solid var(--cad-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.75rem;
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.progress-step.active {
  border-color: var(--cad-blue);
  background: linear-gradient(135deg, #ffffff, #e9f4ff);
}

.progress-step.completed {
  background: linear-gradient(135deg, #e8f7f7, #ffffff);
  border-color: var(--cad-mint);
}

.progress-step .step-index {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 600;
  background: var(--cad-blue);
  color: #fff;
  font-size: 0.7rem;
}

.progress-step.completed .step-index {
  background: var(--cad-mint);
  color: #063642;
}

.progress-step.active .step-index {
  background: var(--cad-blue-dark);
}

form {
  background: #fff;
  border: 1px solid var(--cad-border);
  border-radius: var(--radius-md);
  padding: 32px 32px 28px;
  box-shadow: var(--shadow-md);
}

.form-step {
  animation: stepFade .35s ease;
}

@keyframes stepFade {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.field-row {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
}

.field-row:last-child {
  margin-bottom: 0;
}

.field-row label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-bottom: 6px;
  color: #375267;
}

.field-row input[type=text],
.field-row input[type=email],
.field-row input[type=tel],
.field-row input[type=date],
.field-row textarea,
.field-row select {
  border: 1px solid var(--cad-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 1rem;
  background: #fcfeff;
  font-family: inherit;
  resize: vertical;
  min-height: 46px;
}

.field-row textarea {
  min-height: 110px;
  line-height: 1.4;
}

.field-row input:focus,
.field-row textarea:focus,
.field-row select:focus {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-color: var(--cad-blue);
}

.inline-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.inline-group .field-row {
  flex: 1 1 240px;
}

.help-text {
  font-size: 0.75rem;
  color: #506576;
  margin-top: 4px;
  line-height: 1.3;
}

.required-indicator {
  color: var(--cad-error);
  margin-left: 4px;
}

.photo-block,
.video-block {
  background: #f9fcfd;
  border: 1px dashed var(--cad-border);
  padding: 20px 18px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  position: relative;
}

.photo-block.required {
  border-style: solid;
}

.photo-title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--cad-blue-dark);
}

.photo-desc {
  margin: 0 0 12px;
  font-size: 0.8rem;
  color: #375267;
  line-height: 1.35;
}

.photo-example {
  margin-bottom: 12px;
  display: flex;
  justify-content: flex-start;
}

.photo-example img {
  width: 120px;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--cad-border);
  background: #fff;
}

/* Photo drop zone */
.photo-drop-zone {
  border: 2px dashed var(--cad-border);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  background: #ffffff;
  transition: all 0.3s ease;
  cursor: pointer;
  margin-bottom: 12px;
}

.photo-drop-zone:hover {
  border-color: var(--cad-blue);
  background: #f0f7fd;
}

.photo-drop-zone.dragover {
  border-color: var(--cad-blue);
  background: #e3f2fd;
  transform: scale(1.02);
}

.drop-zone-content p {
  margin: 6px 0;
  color: #506576;
  font-size: 0.9rem;
}

.drop-zone-content p:first-child {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--cad-blue-dark);
}

.btn-select-photo {
  background: var(--cad-blue);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.btn-select-photo:hover {
  background: var(--cad-blue-dark);
}

.photo-input input[type=file] {
  display: none;
}

.preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.preview .thumb {
  width: 90px;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--cad-border);
  box-shadow: var(--shadow-sm);
  position: relative;
}

.preview .thumb button {
  position: absolute;
  top: 3px;
  right: 3px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  width: 20px;
  height: 20px;
  font-size: 0.7rem;
  border-radius: 50%;
  cursor: pointer;
}

.preview .thumb button:hover {
  background: rgba(0, 0, 0, 0.75);
}

.video-block input[type=file] {
  margin-top: 8px;
}

.video-preview video {
  max-width: 240px;
  margin-top: 10px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.optional .photo-title::after {
  content: "(Optional)";
  font-weight: 400;
  font-size: 0.75rem;
  margin-left: 6px;
  color: #506576;
}

.required .photo-title::after {
  content: "*";
  color: var(--cad-error);
  margin-left: 4px;
}

.nav-controls {
  margin-top: 28px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.nav-btn {
  border: 1px solid var(--cad-border);
  background: #fff;
  color: #083652;
  padding: 14px 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: .4px;
  box-shadow: var(--shadow-sm);
  transition: .25s background, .25s color, .25s box-shadow;
}

.nav-btn[disabled] {
  opacity: .45;
  cursor: not-allowed;
}

.nav-btn:hover:not([disabled]) {
  background: #f0f7fa;
}

.nav-btn.primary {
  background: var(--cad-blue);
  color: #fff;
  border-color: var(--cad-blue);
}

.nav-btn.primary:hover {
  background: var(--cad-blue-dark);
}

.finish-dialog {
  border: none;
  width: min(640px, 90%);
  padding: 0;
  border-radius: var(--radius-md);
}

.finish-dialog::backdrop {
  background: rgba(16, 32, 48, 0.55);
  backdrop-filter: blur(3px);
}

.dialog-content {
  background: #fff;
  padding: 40px 34px 34px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.dialog-content h2 {
  margin-top: 0;
  color: var(--cad-blue-dark);
}

.cad-footer {
  text-align: center;
  padding: 32px 0 48px;
  font-size: 0.7rem;
  color: #5b6c78;
}

.progress-bar {
  height: 8px;
  background: #d2e8ef;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 10px 0 24px;
}

.progress-bar .bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cad-blue), var(--cad-mint));
  transition: width .4s ease;
}

.alert {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.3;
  margin: 0 0 18px;
}

.alert.info {
  background: #e8f3ff;
  border: 1px solid #b6d9ff;
  color: #084674;
}

.alert.warning {
  background: #fff6e1;
  border: 1px solid #f1d089;
  color: #6a4b00;
}

.alert.success {
  background: #e5f8ef;
  border: 1px solid #b7e9d2;
  color: #0f5132;
}

.alert.error {
  background: #fdecea;
  border: 1px solid #f5b5af;
  color: #8f1d13;
}

.inline-hint {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
  color: #6d8897;
  margin-top: 2px;
}

.step-footer-note {
  font-size: 0.65rem;
  color: #5d6d79;
  margin-top: 24px;
  text-align: center;
}

/* Upload overlay */
#uploadOverlay.upload-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 27, 42, 0.65);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* Ensure hidden attribute always wins regardless of other display rules */
#uploadOverlay[hidden] {
  display: none !important;
}

.upload-panel {
  width: min(640px, 92%);
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 22px 20px;
  border: 1px solid var(--cad-border);
}

.upload-panel h3 {
  margin: 0 0 8px;
  color: var(--cad-blue-dark);
}

.upload-panel p {
  margin: 0 0 12px;
  color: #375267;
  font-size: 0.92rem;
}

.progressbar {
  height: 10px;
  background: #e5eef3;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .06);
}

.progressbar .bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cad-blue), var(--cad-mint));
  transition: width .2s ease;
}

.upload-panel .stats {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #375267;
}

@media (max-width:720px) {
  form {
    padding: 26px 22px 24px;
  }

  .progress-step {
    flex: 1 1 46%;
  }

  .inline-group {
    flex-direction: column;
  }

  .photo-example img {
    width: 90px;
  }

  .nav-btn {
    flex: 1;
  }

  .nav-controls {
    flex-direction: column;
  }
}

/* Security Banner */
.security-banner {
  max-width: 880px;
  margin: 16px auto 24px;
  padding: 0 20px;
}

.security-content {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 2px solid #0ea5e9;
  border-radius: var(--radius-md);
  padding: 20px 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.security-content h3 {
  margin: 0 0 12px;
  color: #0c4a6e;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.security-content p {
  margin: 0 0 10px;
  color: #164e63;
  font-size: 0.95rem;
  line-height: 1.5;
}

.security-content ul {
  margin: 8px 0 12px 0;
  padding-left: 20px;
  color: #164e63;
}

.security-content li {
  margin-bottom: 6px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.security-content li strong {
  color: #0c4a6e;
}

.security-note {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #bae6fd;
  font-size: 0.85rem !important;
  color: #075985 !important;
}

/* Drag & Drop File Upload */
.file-drop-zone {
  border: 2px dashed var(--cad-border);
  border-radius: var(--radius-sm);
  padding: 32px 20px;
  text-align: center;
  background: #f8fbfc;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 16px;
}

.file-drop-zone:hover {
  border-color: var(--cad-blue);
  background: #f0f7fb;
}

.file-drop-zone.dragover {
  border-color: var(--cad-blue);
  background: #e6f3f9;
  border-style: solid;
}

.file-drop-zone p {
  margin: 8px 0;
  color: #375267;
  font-size: 0.95rem;
}

.file-drop-zone .drop-icon {
  font-size: 2.5rem;
  color: var(--cad-blue);
  margin-bottom: 8px;
}

.file-drop-zone .file-types {
  font-size: 0.75rem;
  color: #6d8897;
  margin-top: 12px;
}

/* File List */
.file-list {
  margin-top: 16px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--cad-border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.file-item.valid {
  border-left: 3px solid var(--cad-success);
}

.file-item.invalid {
  border-left: 3px solid var(--cad-error);
  background: #fff5f5;
}

.file-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-weight: 600;
  color: #1f2d35;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 0.75rem;
  color: #6d8897;
}

.file-status {
  font-size: 0.75rem;
  font-weight: 600;
}

.file-status.valid {
  color: var(--cad-success);
}

.file-status.invalid {
  color: var(--cad-error);
}

.file-remove {
  background: #fee;
  border: 1px solid #fcc;
  color: #c00;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  font-weight: 600;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.file-remove:hover {
  background: #fcc;
  border-color: #faa;
}

.total-size {
  text-align: right;
  font-size: 0.8rem;
  color: #375267;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--cad-border);
}

/* Cloud Link Input */
.cloud-link-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid var(--cad-border);
}

.cloud-link-helper {
  background: #f0f7fb;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-top: 8px;
  font-size: 0.85rem;
  color: #164e63;
}

.cloud-link-helper strong {
  display: block;
  margin-bottom: 6px;
  color: #0c4a6e;
}

.cloud-link-helper ul {
  margin: 8px 0 0 0;
  padding-left: 20px;
}

.cloud-link-helper li {
  margin-bottom: 4px;
  font-size: 0.8rem;
}

/* Review Summary */
.review-summary {
  background: #fff;
  border: 1px solid var(--cad-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 16px 0;
}

.summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.summary-list li {
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.95rem;
}

.summary-list li:last-child {
  border-bottom: none;
}

.summary-list li.ok {
  color: var(--cad-success);
}

.summary-list li.missing {
  color: var(--cad-error);
}

.summary-list li.optional {
  color: #6b7280;
  font-style: italic;
}