:root {
  --contact-radius: 16px;
}

.contact-card {
  --text: var(--block-text, #151624);
  --muted: var(--block-muted, #565a6d);
  --muted2: rgba(21, 22, 36, 0.65);
  --accent: var(--accent-strong, #f0c857);
  --accent-rgb: 240, 200, 87;
  --line: var(--block-line, rgba(13, 15, 30, 0.06));
  --radius: var(--contact-radius, 16px);
  background: var(--block-surface, #ffffff);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--block-shadow, 0 24px 50px rgba(15, 17, 34, 0.08));
  padding: 2.5rem;
  color: var(--text);
}

.contact-card p {
  color: var(--muted);
}

.contactForm {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.contactMatrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .contactMatrix { grid-template-columns: 1fr; }
}

.formPanel {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--block-surface, #ffffff);
  padding: 1.8rem;
  box-shadow: 0 4px 12px rgba(15, 17, 34, 0.04);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 280px;
  transition: all 0.3s ease;
}

.formPanel:hover {
  box-shadow: 0 8px 24px rgba(15, 17, 34, 0.08);
  transform: translateY(-2px);
}

.formPanel h3 { margin: 0; font-size: 1.1rem; }

.kicker {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.contactPanel .kicker { margin-bottom: 0; }
.projectPanel .kicker,
.uploadPanel .kicker,
.mapPanel .kicker { margin-bottom: 0; }
.contactPanel { min-height: 300px; }
.projectPanel { min-height: 300px; }
.projectPanel textarea { min-height: 160px; flex: 1; }
.uploadPanel { min-height: 300px; }
.uploadPanel .dropZone { min-height: 180px; justify-content: center; }

.contactForm label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
  display: block;
  margin-bottom: 0.5rem;
}

.requiredStar { color: var(--accent); margin-left: 2px; }
.inputNote { font-size: 0.82rem; color: var(--muted); margin-top: 0.5rem; line-height: 1.5; }

.uploadField { display: flex; flex-direction: column; gap: 0.8rem; }
.fileInput {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}

.dropZone {
  position: relative;
  border: 2px dashed rgba(21, 22, 36, 0.15);
  border-radius: var(--radius);
  background: rgba(245, 245, 247, 0.5);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.dropZone:hover {
  border-color: rgba(21, 22, 36, 0.25);
  background: rgba(245, 245, 247, 0.8);
  transform: translateY(-1px);
}

.dropZone.is-dragover {
  border-color: var(--accent);
  background: rgba(240, 200, 87, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(240, 200, 87, 0.2);
}

.dropZone strong { font-size: 0.95rem; letter-spacing: -0.01em; color: var(--text); }
.dropHint {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.fileButton {
  padding: 0.75rem 1.8rem;
  border-radius: 12px;
  border: 2px solid var(--text);
  background: var(--text);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(21, 22, 36, 0.15);
  transition: all 0.25s ease;
}

.fileButton:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 6px 18px rgba(21, 22, 36, 0.25);
  background: #1f2030;
}

.fileButton:active {
  transform: translateY(0);
}

.fileButton:focus-visible { 
  outline: 3px solid var(--accent); 
  outline-offset: 2px; 
}

.fileList {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(245, 245, 247, 0.5);
}

.fileList li {
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--line);
}

.fileList li:last-child { border-bottom: none; }

.mapField {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(245, 245, 247, 0.5);
  padding: 1.2rem;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.mapControls { display: flex; gap: 0.8rem; flex-wrap: wrap; align-items: center; }

.mapSearchWrap {
  position: relative;
  flex: 1;
  min-width: 240px;
  z-index: 4000;
}

.mapControls input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
}

.mapSuggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  list-style: none;
  margin: 0;
  padding: 0.5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--block-shadow);
  max-height: 220px;
  overflow: auto;
  z-index: 4001;
}

.mapSuggestions[hidden] { display: none; }

.mapSuggestion {
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.mapSuggestion:hover,
.mapSuggestion.is-active {
  background: rgba(240, 200, 87, 0.12);
  color: var(--text);
}

.mapControls button {
  border: none;
  border-radius: 10px;
  background: var(--text);
  color: #fff;
  font-weight: 600;
  padding: 0.75rem 1.4rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(21, 22, 36, 0.15);
  font-size: 0.9rem;
  transition: all 0.25s ease;
}

.mapControls button:hover {
  background: #1f2030;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(21, 22, 36, 0.2);
}

.mapHint { font-size: 0.82rem; color: var(--muted); margin: 0; line-height: 1.5; }

.mapCanvas {
  width: 100%;
  min-height: 280px;
  height: 300px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(245, 245, 247, 0.5);
  overflow: hidden;
  position: relative;
}

.mapCanvas.is-drawing { cursor: crosshair; }

.mapCanvas.is-drawing::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, rgba(21, 22, 36, 0.05), rgba(21, 22, 36, 0.05) 8px, transparent 8px, transparent 16px);
  pointer-events: none;
  animation: mapStripe 1.2s linear infinite;
}

@keyframes mapStripe { from { background-position: 0 0; } to { background-position: 16px 16px; } }

@media (max-width: 640px) {
  .mapCanvas { height: 260px; }
}

.mapModeControls { display: none; gap: 0.8rem; margin-top: 0.8rem; flex-wrap: wrap; }
.mapModeControls.is-visible { display: flex; }

.mapModeButton {
  flex: 1;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  padding: 0.7rem 1.2rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.mapModeButton.is-active {
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(240, 200, 87, 0.25);
  background: rgba(240, 200, 87, 0.08);
}

.mapModeButton:disabled { opacity: 0.5; cursor: not-allowed; }

.mapStatus { font-size: 0.82rem; font-weight: 600; color: var(--muted); min-height: 18px; }

.contactForm input,
.contactForm textarea {
  width: 100%;
  border-radius: 10px;
  border: 2px solid transparent;
  background: rgba(245, 245, 247, 0.6);
  padding: 0.9rem 1.1rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  transition: all 0.25s ease;
  font-weight: 500;
}

.contactForm input:hover,
.contactForm textarea:hover {
  background: rgba(245, 245, 247, 0.9);
}

.contactForm input:focus,
.contactForm textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(240, 200, 87, 0.12), 0 4px 12px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

.contactForm textarea { min-height: 120px; resize: vertical; }

.submitRow { display: flex; justify-content: center; margin-top: 1rem; }

.submitButton {
  border: none;
  background: linear-gradient(135deg, #f0c857 0%, #e1a93d 100%);
  color: #151624;
  padding: 1.1rem 3rem;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(240, 200, 87, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.submitButton::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.submitButton:hover::before {
  left: 100%;
}

.submitButton:hover { 
  transform: translateY(-3px) scale(1.02); 
  box-shadow: 0 12px 32px rgba(240, 200, 87, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4); 
}

.submitButton:active {
  transform: translateY(-1px) scale(0.98);
}

.formStatus {
  margin-top: 1.2rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  min-height: 24px;
  text-align: center;
}

.formStatus.success {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(240, 200, 87, 0.12);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  box-shadow: var(--block-shadow);
}

.optionalHeader { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

.toggleSwitch { position: relative; display: inline-flex; align-items: center; width: 52px; height: 28px; cursor: pointer; }
.toggleSwitch input { opacity: 0; width: 0; height: 0; }
.toggleTrack {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(21, 22, 36, 0.12);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid rgba(21, 22, 36, 0.08);
}

.toggleTrack::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(21, 22, 36, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggleSwitch:hover .toggleTrack::after {
  box-shadow: 0 3px 10px rgba(21, 22, 36, 0.3);
}

.toggleSwitch input:checked + .toggleTrack { 
  background: var(--accent); 
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 200, 87, 0.15);
}

.toggleSwitch input:checked + .toggleTrack::after { 
  transform: translateX(22px); 
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.optionalBody { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.8rem; flex: 1; width: 100%; }
.optionalCard.is-disabled .optionalBody { opacity: 0.4; filter: grayscale(0.2); pointer-events: none; }
.optionalCard.is-disabled .optionalHint { color: var(--muted); }
.dropZone.is-disabled { opacity: 0.4; pointer-events: none; }

.contact-intro { margin: 0 0 1rem; font-size: 0.9rem; color: var(--muted); }
