/* ==========================================================================
   Work With Me | Brandon Galang
   Scoped styling adhering to DESIGN.md and craft-floor guidelines.
   Accessible dark blue tokens, single column, 44px min touch targets.
   ========================================================================== */

:root {
  --work-interactive: var(--c-interactive-hover, #0056b3);
  --work-interactive-hover: #004085;
  --work-text: var(--c-text);
  --work-subtext: var(--c-tag-text); /* 5.4:1 contrast on #ffffff */
  --work-placeholder: #595959; /* 5.0:1 contrast on #ffffff */
  --work-border: #767676;
  --work-border-focus: #0056b3;
  --work-error-bg: #fef2f2;
  --work-error-border: #fca5a5;
  --work-error-text: #991b1b; /* 7.6:1 contrast on #fef2f2 */
  --work-surface: #f8f9fa;
  --work-radius: 4px;
}

/* Browser surfaces styling */
::selection {
  background-color: #dbeafe;
  color: #0f172a;
}

/* Accessible link styling with hover state and underline offset */
a {
  color: var(--work-interactive);
  text-decoration: none;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--work-interactive-hover);
  text-decoration: underline;
}

/* Focus rings */
:focus-visible {
  outline: 2px solid var(--work-interactive);
  outline-offset: 2px;
}

/* Intro Section */
.work-intro {
  margin-bottom: 2rem;
  max-width: 68ch;
}

.work-heading {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 1rem;
  color: var(--work-text);
}

.work-lead {
  font-size: 1.05rem;
  line-height: 1.75;
  margin-bottom: 1rem;
  color: var(--work-text);
}

.work-direct-contact {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--work-text);
  margin-top: 1rem;
}

.work-noscript-card {
  background-color: var(--work-surface);
  border: 1px solid var(--work-border);
  border-radius: var(--work-radius);
  padding: 14px 18px;
  margin-bottom: 1.5rem;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--work-text);
}

/* Single-Column Form Container */
.work-form-container {
  max-width: 600px;
  margin-bottom: 3rem;
}

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

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--work-text);
  margin-bottom: 6px;
  line-height: 1.4;
}

.required-indicator {
  color: #b42318;
  font-weight: 700;
  margin-left: 2px;
}

.optional-label {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--work-subtext);
  margin-left: 4px;
}

.form-helper {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--work-subtext);
  margin-top: 0;
  margin-bottom: 8px;
}

/* Form Controls - min-height 44px, font-size 16px */
.form-control {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  color: var(--work-text);
  background-color: #ffffff;
  border: 1px solid var(--work-border);
  border-radius: var(--work-radius);
  caret-color: var(--work-interactive);
  transition: border-color 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.form-control::placeholder {
  color: var(--work-placeholder);
  opacity: 1;
}

.form-control:focus {
  outline: 2px solid var(--work-interactive);
  outline-offset: 2px;
  border-color: var(--work-interactive);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

/* Privacy Note */
.form-privacy {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--work-subtext);
  margin-bottom: 0;
}

/* Live Status Messages */
.form-status {
  padding: 12px 16px;
  border-radius: var(--work-radius);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

.form-status[hidden] {
  display: none !important;
}

.status-error {
  background-color: var(--work-error-bg);
  border: 1px solid var(--work-error-border);
  color: var(--work-error-text);
}

.status-info {
  background-color: var(--work-surface);
  border: 1px solid var(--work-border);
  color: var(--work-text);
}

/* Actions & Button */
.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.work-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 24px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #ffffff;
  background-color: var(--work-interactive);
  border: 1px solid var(--work-interactive);
  border-radius: var(--work-radius);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.work-submit-btn:hover {
  background-color: var(--work-interactive-hover);
  border-color: var(--work-interactive-hover);
}

.work-submit-btn:active {
  transform: translateY(1px);
}

.work-submit-btn:disabled {
  background-color: #cbd5e1;
  border-color: #cbd5e1;
  color: #64748b;
  cursor: not-allowed;
  opacity: 0.8;
  transform: none;
}

.form-fallback {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--work-subtext);
  margin-top: 1rem;
}

/* Honeypot: outside keyboard, tab, and screen reader path */
.form-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

/* Success Card */
.work-success-card {
  background: #ffffff;
  border: 1px solid var(--c-border);
  border-radius: var(--work-radius);
  padding: 24px 20px;
  margin: 1.5rem 0;
}

.work-success-heading {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--work-text);
  margin-bottom: 0.75rem;
}

.work-success-heading:focus {
  outline: 2px solid var(--work-interactive);
  outline-offset: 4px;
}

.work-success-body {
  font-family: var(--font-serif);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--work-text);
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .work-form-container {
    max-width: 100%;
  }

  .work-submit-btn {
    width: 100%;
  }
}

.work-form-container[hidden] { display: none; }
.work-direct-contact a, .form-fallback a, .work-success-body a { overflow-wrap: anywhere; text-decoration: underline; }
.work-intro p a { text-decoration: underline; }
.work-form .form-status:focus { outline: 2px solid var(--work-interactive); outline-offset: 3px; }
