/* Contact Popup – standalone widget, no framework dependencies */

.kcp-overlay {
  position: fixed;
  z-index: 10000;

  display: flex;
  justify-content: center;
  align-items: center;

  opacity: 0;
  background: rgba(0, 0, 0, 0.35);

  transition: opacity 0.2s ease;
  inset: 0;
}

.kcp-overlay.kcp-visible {
  opacity: 1;
}

.kcp-dialog {
  position: relative;

  overflow-y: auto;

  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  margin: 1rem;
  padding: 2rem;

  font-family: var(--font-family-base, "EB Garamond", serif);

  color: #282a3a;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);

  transition: transform 0.2s ease;
  transform: translateY(12px);
}

.kcp-overlay.kcp-visible .kcp-dialog {
  transform: translateY(0);
}

/* Header */
.kcp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;

  margin-bottom: 1.5rem;
}

.kcp-title {
  margin: 0;

  font-family: var(--font-family-heading, "Crimson Pro", serif);
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.3;
}

.kcp-close {
  display: flex;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;

  width: 28px;
  height: 28px;
  margin: -4px -4px 0 8px;
  padding: 0;

  cursor: pointer;

  color: #62636c;
  border: none;
  border-radius: 4px;
  background: none;

  transition: color 0.15s, background 0.15s;
}

.kcp-close:hover {
  color: #282a3a;
  background: rgba(0, 0, 0, 0.06);
}

.kcp-close svg {
  width: 16px;
  height: 16px;
}

/* Loading overlay */
.kcp-loading {
  position: absolute;
  z-index: 1;

  display: flex;
  justify-content: center;
  align-items: center;

  opacity: 1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.85);

  transition: opacity 0.2s ease;
  inset: 0;
}

.kcp-loading.kcp-loading-hidden {
  pointer-events: none;

  opacity: 0;
}

.kcp-spinner {
  width: 28px;
  height: 28px;

  border: 2.5px solid #d8d9e0;
  border-top-color: #282a3a;
  border-radius: 50%;

  animation: kcp-spin 0.6s linear infinite;
}

@keyframes kcp-spin {
  to { transform: rotate(360deg); }
}

/* Form layout */
.kcp-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.kcp-row {
  display: flex;
  gap: 1rem;
}

.kcp-row > .kcp-field {
  flex: 1;

  min-width: 0;
}

.kcp-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.kcp-label {
  font-size: 0.9rem;
  font-weight: 600;

  color: #282a3a;
}

.kcp-required {
  color: #c0392b;
}

/* Inputs */
.kcp-input,
.kcp-textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;

  font-family: var(--font-family-base, "EB Garamond", serif);
  font-size: 0.95rem;
  line-height: 1.4;

  color: #282a3a;
  border: 1px solid #d8d9e0;
  border-radius: 6px;
  outline: none;
  background: #fff;

  transition: border-color 0.15s, box-shadow 0.15s;
}

.kcp-input:focus,
.kcp-textarea:focus {
  border-color: rgba(16, 24, 40, 0.5);
  box-shadow: 0 0 0 2px rgba(16, 24, 40, 0.08);
}

.kcp-input::placeholder,
.kcp-textarea::placeholder {
  color: #a0a1a8;
}

.kcp-input:disabled {
  cursor: not-allowed;

  color: #62636c;
  background: #f3f3f1;
}

.kcp-textarea {
  min-height: 100px;

  resize: vertical;
}

/* File upload */
.kcp-file-zone {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kcp-droparea {
  display: flex;
  justify-content: center;
  align-items: center;

  padding: 0.6rem;

  font-size: 0.88rem;
  cursor: pointer;
  user-select: none;

  color: #62636c;
  border: 1.5px dashed #d8d9e0;
  border-radius: 6px;

  transition: border-color 0.15s, background 0.15s;
  gap: 0.4rem;
}

.kcp-droparea:hover {
  border-color: #a0a1a8;
  background: #fafaf9;
}

.kcp-droparea.kcp-dragover {
  border-color: #282a3a;
  background: #f5f5f3;
}

.kcp-droparea svg {
  flex-shrink: 0;

  width: 16px;
  height: 16px;
}

.kcp-file-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.kcp-file-chip {
  display: inline-flex;
  align-items: center;

  max-width: 100%;
  padding: 0.2rem 0.5rem;

  font-size: 0.8rem;
  line-height: 1.3;

  color: #282a3a;
  border: 1px solid #e5e5e3;
  border-radius: 4px;
  background: #f3f3f1;
  gap: 0.3rem;
}

.kcp-file-name {
  overflow: hidden;

  white-space: nowrap;
  text-overflow: ellipsis;
}

.kcp-file-size {
  white-space: nowrap;

  color: #62636c;
}

.kcp-file-remove {
  display: flex;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;

  width: 16px;
  height: 16px;
  margin-left: 0.1rem;
  padding: 0;

  cursor: pointer;

  color: #62636c;
  border: none;
  border-radius: 3px;
  background: none;

  transition: color 0.15s, background 0.15s;
}

.kcp-file-remove:hover {
  color: #991b1b;
  background: rgba(0, 0, 0, 0.06);
}

.kcp-file-remove svg {
  width: 10px;
  height: 10px;
}

.kcp-file-meta {
  font-size: 0.78rem;

  color: #a0a1a8;
}

/* Footer */
.kcp-footer {
  display: flex;
  justify-content: flex-end;

  margin-top: 0.5rem;
}

.kcp-btn {
  padding: 0.5rem 1.5rem;

  font-family: var(--font-family-base, "EB Garamond", serif);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;

  color: #fff;
  border: none;
  border-radius: 6px;
  background: #282a3a;

  transition: background 0.15s, opacity 0.15s;
}

.kcp-btn:hover:not(:disabled) {
  background: #1a1c28;
}

.kcp-btn:disabled {
  cursor: not-allowed;

  opacity: 0.45;
}

/* Banners */
.kcp-banner {
  padding: 0.6rem 0.8rem;

  font-size: 0.88rem;
  line-height: 1.4;

  border-radius: 6px;
}

.kcp-banner-error {
  color: #991b1b;
  border: 1px solid #fecaca;
  background: #fef2f2;
}

.kcp-banner-success {
  color: #166534;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
}

/* Mobile */
@media (max-width: 520px) {
  .kcp-dialog {
    max-width: 100%;
    max-height: 100vh;
    margin: 0;
    padding: 1.5rem;

    border-radius: 0;
  }

  .kcp-row {
    flex-direction: column;
  }
}
