/**
 * CoCLinks - Contact Us Page Styles
 * Scope: #contact
 * Modern, minimalist, and responsive feedback form
 */

#contact {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

/* Centered Header */
#contact .contact-header {
  text-align: center;
  max-width: 620px;
  margin: 0 auto 24px;
}

#contact .contact-subtitle {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
}

/* Form Card */
#contact .contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}

#contact .contact-form {
  display: flex;
  flex-direction: column;
  position: relative;
  padding: 26px 30px 22px;
}

#contact .contact-hp {
  position: absolute !important;
  left: -9999px !important;
  opacity: 0 !important;
  width: 1px !important;
  height: 1px !important;
  pointer-events: none !important;
}

/* Alert Notices */
#contact .contact-alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 24px;
  animation: fadeInContactAlert 0.25s ease-out;
}

@keyframes fadeInContactAlert {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#contact .contact-alert-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
}

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

html.dark #contact .contact-alert-success {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

html.dark #contact .contact-alert-error {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

/* Form Fields */
#contact .form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
}

#contact .form-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

#contact .required-star {
  color: #ef4444;
  margin-left: 2px;
}

#contact .label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

#contact .char-counter {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

#contact .char-counter.limit-exceeded {
  color: #ef4444;
  font-weight: 600;
}

#contact .input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

#contact .input-icon {
  position: absolute;
  left: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  pointer-events: none;
  transition: color 0.15s ease;
}

#contact .form-input {
  width: 100%;
  height: 46px;
  padding: 0 16px 0 44px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition-apple);
  outline: none;
  box-sizing: border-box;
}

#contact .form-textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition-apple);
  outline: none;
  box-sizing: border-box;
  resize: vertical;
  min-height: 110px;
  line-height: 1.5;
}

#contact .form-input:focus,
#contact .form-textarea:focus {
  border-color: var(--brand-blue);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px var(--brand-badge-bg);
}

#contact .input-wrapper:focus-within .input-icon {
  color: var(--brand-blue);
}

#contact .form-input.input-invalid,
#contact .form-textarea.input-invalid {
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.04) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

#contact .field-error {
  color: #ef4444;
  font-size: 0.8rem;
  margin-top: 6px;
  line-height: 1.3;
}

/* Submit Button */
#contact .form-actions {
  margin-top: 10px;
  display: flex;
  width: 100%;
}

#contact .btn-contact-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  padding: 0 24px;
  background: var(--brand-blue);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.25);
  position: relative;
}

#contact .btn-contact-submit:hover:not(:disabled) {
  background: var(--brand-blue-hover);
  box-shadow: 0 4px 14px rgba(0, 102, 204, 0.35);
}

#contact .btn-contact-submit:active:not(:disabled) {
  opacity: 0.92;
}

#contact .btn-contact-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

#contact .btn-spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spinSubmitBtn 0.7s linear infinite;
}

#contact .btn-contact-submit.loading .btn-icon {
  display: none;
}

#contact .btn-contact-submit.loading .btn-spinner {
  display: inline-block;
}

@keyframes spinSubmitBtn {
  to {
    transform: rotate(360deg);
  }
}

#contact .contact-card-footer {
  background: var(--bg-subtle);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  text-align: center;
}

#contact .contact-privacy-note {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-secondary);
  text-wrap: balance;
}

#contact .contact-privacy-note a {
  color: var(--brand-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s ease;
}

#contact .contact-privacy-note a:hover {
  color: var(--brand-blue-hover);
}

#contact .contact-direct-links {
  margin-top: 48px;
  display: flex;
  justify-content: center;
}

#contact .author-links {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

#contact .author-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 15px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary) !important;
  border-radius: var(--radius-pill);
  text-decoration: none !important;
  transition: background 0.15s ease, border-color 0.15s ease;
}

#contact .author-chip svg {
  flex-shrink: 0;
}

/* Personal Website Chip */
#contact .author-chip-site {
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(139, 92, 246, 0.22);
}

#contact .author-chip-site svg {
  color: #8b5cf6;
}

#contact .author-chip-site:hover {
  background: rgba(139, 92, 246, 0.14);
  border-color: #8b5cf6;
  color: #7c3aed !important;
}

/* Email Chip */
#contact .author-chip-email {
  background: rgba(0, 102, 204, 0.06);
  border: 1px solid rgba(0, 102, 204, 0.22);
}

#contact .author-chip-email svg {
  color: #0066cc;
}

#contact .author-chip-email:hover {
  background: rgba(0, 102, 204, 0.12);
  border-color: #0066cc;
  color: #0066cc !important;
}

/* WhatsApp Chip */
#contact .author-chip-wa {
  background: rgba(37, 211, 102, 0.08);
  border: 1px solid rgba(37, 211, 102, 0.28);
}

#contact .author-chip-wa svg {
  color: #25d366;
}

#contact .author-chip-wa:hover {
  background: rgba(37, 211, 102, 0.16);
  border-color: #25d366;
  color: #128c7e !important;
}

/* Facebook Chip */
#contact .author-chip-fb {
  background: rgba(24, 119, 242, 0.06);
  border: 1px solid rgba(24, 119, 242, 0.22);
}

#contact .author-chip-fb svg {
  color: #1877f2;
}

#contact .author-chip-fb:hover {
  background: rgba(24, 119, 242, 0.14);
  border-color: #1877f2;
  color: #1877f2 !important;
}

/* Dark Mode Overrides for Chips */
html.dark #contact .author-chip-site {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.28);
}

html.dark #contact .author-chip-site svg {
  color: #c084fc;
}

html.dark #contact .author-chip-site:hover {
  background: rgba(168, 85, 247, 0.18);
  border-color: #c084fc;
  color: #c084fc !important;
}

html.dark #contact .author-chip-email {
  background: rgba(41, 151, 255, 0.1);
  border-color: rgba(41, 151, 255, 0.28);
}

html.dark #contact .author-chip-email svg {
  color: #47a3ff;
}

html.dark #contact .author-chip-email:hover {
  background: rgba(41, 151, 255, 0.18);
  border-color: #47a3ff;
  color: #47a3ff !important;
}

html.dark #contact .author-chip-wa {
  background: rgba(37, 211, 102, 0.12);
  border-color: rgba(37, 211, 102, 0.32);
}

html.dark #contact .author-chip-wa svg {
  color: #25d366;
}

html.dark #contact .author-chip-wa:hover {
  background: rgba(37, 211, 102, 0.2);
  border-color: #25d366;
  color: #25d366 !important;
}

html.dark #contact .author-chip-fb {
  background: rgba(24, 119, 242, 0.1);
  border-color: rgba(24, 119, 242, 0.28);
}

html.dark #contact .author-chip-fb svg {
  color: #3b82f6;
}

html.dark #contact .author-chip-fb:hover {
  background: rgba(24, 119, 242, 0.18);
  border-color: #3b82f6;
  color: #3b82f6 !important;
}

/* Responsive Breakpoints */
@media (max-width: 640px) {
  #contact .contact-form {
    padding: 22px 18px;
  }

  #contact .contact-card-footer {
    padding: 10px 16px;
  }

  #contact .btn-contact-submit {
    width: 100%;
  }

  #contact .author-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  #contact .author-chip {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
  }
}