/* ============================================================
   Contact Form — Styles
   Prefix: cf — every selector is scoped under .cf so this file is
   safe to drop into any existing site without leaking styles onto
   other elements.
   ============================================================ */

/* ------------------------------------------------------------
   EASY COLOR CUSTOMIZATION
   ------------------------------------------------------------
   Every color used below is a CSS custom property defined here on
   .cf. To retheme the form for a different site, you only need to
   change values in THIS block — nothing else in the file.

   Two ways to do it:
     1. Edit the values directly below, or
     2. Leave this file untouched and override the variables from
        your site's own stylesheet (loaded AFTER this one), e.g.:
          .cf { --cf-button-bg: #0b5; --cf-button-bg-hover: #094; }
        This lets you re-skin the form per-site without ever
        touching this vendor file.
   ------------------------------------------------------------ */
.cf {
  /* Base surface + text */
  --cf-text:              #1a1a1a;
  --cf-text-muted:        #3d4550;
  --cf-surface:           #ffffff;
  --cf-border:            #c8cdd3;

  /* Inputs */
  --cf-input-border:        #6b7280;
  --cf-input-border-hover:  #374151;
  --cf-input-text:          #1a1a1a;
  --cf-input-bg:            #ffffff;
  --cf-placeholder:         #555555;

  /* Focus ring (shared by inputs + button, keep it consistent site-wide) */
  --cf-focus-ring:           #2563eb;

  /* Required / error */
  --cf-required-mark:        #b91c1c;
  --cf-error-text:            #b91c1c;
  --cf-error-border:          #b91c1c;

  /* Success / status banners */
  --cf-success-bg:            #f0fdf4;
  --cf-success-border:        #16a34a;
  --cf-success-text:          #14532d;
  --cf-error-bg:               #fef2f2;
  --cf-error-banner-border:    #b91c1c;
  --cf-error-banner-text:      #7f1d1d;

  /* Submit button — neutral dark, easy to swap for a brand color */
  --cf-button-bg:              #222222;
  --cf-button-bg-hover:        #3a3a3a;
  --cf-button-bg-active:       #101010;
  --cf-button-text:            #ffffff;
  --cf-button-disabled-bg:     #6b7280;
}

.cf {
  max-width: 600px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  line-height: 1.5;
  color: var(--cf-text);
  background-color: var(--cf-surface);
}

.cf *,
.cf *::before,
.cf *::after {
  box-sizing: border-box;
}

/* Container */
.cf__container {
  background: var(--cf-surface);
  padding: 32px;
  border-radius: 8px;
  border: 1px solid var(--cf-border);
}

/* Heading & description */
.cf__title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--cf-text);
  text-align: center;
}
.cf__description {
  margin: 0 0 28px;
  font-size: 0.9375rem;
  color: var(--cf-text-muted);
  text-align: center;
}

/* Required note */
.cf__required-note {
  font-size: 0.875rem;
  color: var(--cf-text-muted);
  margin-bottom: 24px;
  display: block;
}

/* Form groups */
.cf__group {
  margin-bottom: 22px;
}

/* Labels */
.cf__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--cf-text);
}
.cf__required {
  color: var(--cf-required-mark);
  margin-left: 3px;
  font-weight: 700;
}
.cf__optional {
  color: var(--cf-text-muted);
  margin-left: 5px;
  font-weight: 400;
  font-size: 0.8125rem;
  font-style: italic;
}

/* Inputs & textarea */
.cf__input {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--cf-input-border);
  border-radius: 5px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--cf-input-text);
  background-color: var(--cf-input-bg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
}
.cf__input:hover {
  border-color: var(--cf-input-border-hover);
}
.cf__input:focus {
  outline: 3px solid var(--cf-focus-ring);
  outline-offset: 2px;
  border-color: var(--cf-focus-ring);
  box-shadow: none;
}
.cf__input:invalid {
  border-color: var(--cf-input-border);
  box-shadow: none;
}
.cf__textarea {
  min-height: 120px;
  resize: vertical;
  background-color: var(--cf-input-bg);
  color: var(--cf-input-text);
  display: block;
}

/* Inline error messages */
.cf__error {
  display: none;
  margin-top: 6px;
  font-size: 0.875rem;
  color: var(--cf-error-text);
  font-weight: 600;
}
.cf__error::before {
  content: "⚠ ";
}
.cf__input--error {
  border-color: var(--cf-error-border);
}
.cf__input--error:focus {
  outline-color: var(--cf-error-border);
  border-color: var(--cf-error-border);
}

/* Submit button */
.cf__submit {
  display: block;
  width: 100%;
  padding: 14px 20px;
  background-color: var(--cf-button-bg);
  color: var(--cf-button-text);
  border: 2px solid transparent;
  border-radius: 5px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  margin-top: 10px;
  text-align: center;
}
.cf__submit:hover {
  background-color: var(--cf-button-bg-hover);
}
.cf__submit:focus {
  outline: 3px solid var(--cf-focus-ring);
  outline-offset: 3px;
  background-color: var(--cf-button-bg-hover);
}
.cf__submit:active {
  background-color: var(--cf-button-bg-active);
}
.cf__submit:disabled,
.cf__submit[aria-disabled="true"] {
  background-color: var(--cf-button-disabled-bg);
  cursor: not-allowed;
  pointer-events: none;
}

/* Status / alert region */
.cf__status {
  margin-top: 20px;
  padding: 14px 18px;
  border-radius: 5px;
  font-size: 0.9375rem;
  font-weight: 600;
  border: 2px solid transparent;
  display: none;
}
.cf__status--success {
  background-color: var(--cf-success-bg);
  border-color: var(--cf-success-border);
  color: var(--cf-success-text);
}
.cf__status--error {
  background-color: var(--cf-error-bg);
  border-color: var(--cf-error-banner-border);
  color: var(--cf-error-banner-text);
}

/* Honeypot — off-screen, not display:none so bots still see it */
.cf__honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Screen-reader only utility */
.cf-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive */
@media (max-width: 600px) {
  .cf__container {
    padding: 20px 16px;
  }
  .cf__title {
    font-size: 1.25rem;
  }
}

/* Placeholder text */
.cf__input::placeholder {
  color: var(--cf-placeholder);
  opacity: 1; /* Firefox reduces opacity by default */
}

/* Explicit background on textarea — some scanners need it on the element directly */
#cf-comments {
  background-color: var(--cf-input-bg);
  color: var(--cf-input-text);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .cf__input,
  .cf__submit {
    transition: none;
  }
}
