/* Contact CTA modal styles - follows existing modal patterns */

/* Modal overlay with semi-transparent background (matches chat/services modals) */
.contact-modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: flex-start;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9999;
  padding: 3rem 2rem;
  overflow-y: auto;
}

/* Success notification overlay */
.contact-success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Success notification popup */
.contact-success-notification {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem 2.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  font-size: 1.15em;
  color: var(--ink);
  text-align: center;
  max-width: 400px;
  animation: slideInFade 0.3s ease-out;
}

@keyframes slideInFade {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.contact-success-notification::before {
  content: '✓';
  display: block;
  font-size: 2.5em;
  color: var(--accent);
  margin-bottom: 0.5rem;
  line-height: 1;
}

.contact-success-title {
  font-size: 1.4em;
  font-weight: 600;
  color: var(--secondary);
  margin: 0 0 0.5rem;
}

.contact-success-message {
  margin: 0;
  line-height: 1.6;
}

.contact-modal-overlay.is-open {
  display: flex;
}

/* Modal dialog container */
.contact-modal {
  background: var(--surface);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  position: relative;
  font-size: 1.35em;
  line-height: 1.6;
  padding: 3rem 3rem 2rem;
}

/* Modern Mac-style scrollbar for modal */
.contact-modal::-webkit-scrollbar {
  width: 8px;
}

.contact-modal::-webkit-scrollbar-track {
  background: transparent;
}

.contact-modal::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.contact-modal::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
  background-clip: padding-box;
}

body.dark-mode .contact-modal::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  background-clip: padding-box;
}

body.dark-mode .contact-modal::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
  background-clip: padding-box;
}

/* Header */
.contact-header {
  padding: 0 0 24px 0;
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.contact-header-image {
  flex-shrink: 0;
  width: 120px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-header-image svg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
}

.contact-header-text {
  flex: 1;
  min-width: 0;
}

.contact-title {
  font-size: 2em;
  font-weight: 600;
  color: var(--primary);
  margin: 0 0 8px;
}

.contact-subtitle {
  color: var(--ink-muted);
  font-size: 1em;
  margin: 0;
}

.contact-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 400;
  transition: all 0.2s ease;
}

.contact-close:hover {
  background: var(--accent);
  color: var(--bg);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

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

/* Body */
.contact-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Section Labels */
.contact-section-label {
  color: var(--ink);
  font-size: 1em;
  font-weight: 600;
  margin-bottom: 12px;
  margin-top: 24px;
}

/* First section label (chips) shouldn't have top margin */
.contact-section-label:first-child {
  margin-top: 0;
}

/* Services Section (collapsible wrapper) */
.contact-services-section {
  position: relative;
}

/* Services labels - show desktop, hide mobile by default */
.contact-services-label-desktop {
  display: block;
}

.contact-services-label-mobile {
  display: none;
}

/* Services Toggle Button (hidden on desktop, shown on mobile) */
.contact-services-toggle {
  display: none;
}

/* Service Chips */
.contact-chip-container {
  display: flex;
  gap: 0.6em;
  flex-wrap: wrap;
}

.contact-service-chip {
  padding: 0.5em 1em;
  border-radius: 1em;
  border: 1px solid var(--secondary);
  background: transparent;
  color: var(--secondary);
  cursor: pointer;
  font-size: 1em;
  white-space: nowrap;
  transition: all 0.2s;
  font-family: inherit;
  position: relative;
  z-index: 1;
}

.contact-service-chip:hover {
  background: var(--secondary);
  color: white;
  transform: translateY(-1px);
  z-index: 10000;
}

.contact-service-chip.selected {
  background: var(--secondary);
  color: white;
}

.contact-service-chip:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

.contact-service-chip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.85em;
  white-space: normal;
  width: 200px;
  z-index: 10001;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  animation: tooltip-fade-in 0.2s ease 0.5s forwards;
  opacity: 0;
}

@keyframes tooltip-fade-in {
  to {
    opacity: 1;
  }
}

/* Form Fields */
.contact-field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.contact-field-label {
  color: var(--ink);
  font-size: 0.95em;
  font-weight: 600;
}

.contact-field-required::after {
  content: "*";
  color: var(--accent);
  margin-left: 4px;
}

.contact-field-input,
.contact-field-select {
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--surface-variant);
  color: var(--ink);
  border-radius: 6px;
  font-size: 1em;
  font-family: inherit;
  transition: all 0.2s;
}

.contact-field-input:focus,
.contact-field-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.1);
}

.contact-field-input::placeholder {
  color: var(--ink-muted);
  opacity: 0.7;
}

.contact-textarea {
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--surface-variant);
  color: var(--ink);
  border-radius: 6px;
  font-size: 1em;
  font-family: inherit;
  min-height: 120px;
  resize: vertical;
  transition: all 0.2s;
}

.contact-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.1);
}

.contact-textarea::placeholder {
  color: var(--ink-muted);
  opacity: 0.7;
}

/* Business Fields Grid */
.contact-business-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

/* Tablet Responsive */
@media (max-width: 1024px) {
  .contact-title {
    font-size: 1.8em;
  }
}

@media (max-width: 767px) {
  .contact-modal-overlay {
    padding: 1rem;
  }

  .contact-modal {
    padding: 2.5rem 1.5rem 1.5rem;
  }

  .contact-header {
    flex-direction: column;
    align-items: center;
    padding: 0 0 20px 0;
  }

  .contact-header-image {
    display: none;
  }

  .contact-title {
    font-size: 1.5em;
    text-align: center;
  }

  .contact-body {
    padding: 0;
    gap: 16px;
  }

  /* Show collapsible toggle button on mobile */
  .contact-services-section {
    margin-bottom: 8px;
  }

  /* Swap labels on mobile */
  .contact-services-label-desktop {
    display: none;
  }

  .contact-services-label-mobile {
    display: block;
  }

  .contact-services-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0 0 8px 0;
    padding: 10px 14px;
    background: var(--surface-variant);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--ink);
    font-size: 0.95em;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
  }

  .contact-services-toggle:hover {
    background: var(--surface);
  }

  .contact-services-toggle-icon {
    transition: transform 0.2s;
    font-size: 0.8em;
  }

  .contact-services-toggle[aria-expanded="true"] .contact-services-toggle-icon {
    transform: rotate(180deg);
  }

  /* Chip container starts collapsed on mobile */
  .contact-chip-container--collapsible {
    max-height: 0;
    overflow: hidden;
    padding: 0;
    background: var(--surface-variant);
    border-radius: 8px;
    transition: max-height 0.3s ease, padding 0.3s ease;
  }

  .contact-chip-container--collapsible.contact-chip-container--expanded {
    max-height: 500px;
    padding: 12px 16px;
  }

  .contact-service-chip {
    font-size: 0.9em;
    padding: 0.4em 0.8em;
  }

  .contact-chip-container {
    gap: 0.5em;
  }

  .contact-business-fields {
    grid-template-columns: 1fr;
  }
}

/* Submit Button */
.contact-submit {
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: var(--bg);
  cursor: pointer;
  font-weight: 700;
  font-size: 1.1em;
  font-family: inherit;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-top: 24px;
}

.contact-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px var(--shadow);
}

.contact-submit:active:not(:disabled) {
  transform: translateY(0);
}

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

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

/* Mailto Section */
.contact-mailto-section {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.contact-mailto-section p {
  color: var(--ink-muted);
  margin: 0 0 8px;
  font-size: 0.95em;
}

.contact-mailto-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 1em;
  transition: all 0.2s;
}

.contact-mailto-link:hover {
  text-decoration: underline;
  color: var(--secondary);
}

.contact-mailto-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Success/Error Messages */
.contact-message {
  padding: 16px;
  border-radius: 8px;
  font-size: 1em;
  line-height: 1.6;
}

.contact-message--success {
  background: rgba(var(--secondary-rgb), 0.1);
  border: 1px solid rgba(var(--secondary-rgb), 0.3);
  color: var(--ink);
}

.contact-message--error {
  background: rgba(245, 166, 35, 0.1);
  border: 1px solid rgba(245, 166, 35, 0.3);
  color: var(--ink);
}

/* Hidden utility */
.contact-hidden {
  display: none !important;
}

/* Anti-spam honeypot (visually hidden) */
.contact-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Mobile Landscape - Override to horizontal layout */
@media (max-width: 767px) and (orientation: landscape) {
  .contact-header {
    flex-direction: row;
    align-items: flex-start;
  }

  .contact-title {
    text-align: left;
  }
}
