/* ═══════════════════════════════════════════════════════════
   Contact Form Page — contact.css
   Extends the shared design system from style.css
   ══════════════════════════════════════════════════════════ */

/* ── Navbar: force visible — no load sequence on this page ── */
body.contact-page #navbar {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* ── Section layout ──────────────────────────────────────── */
.cf-section {
  position: relative;
  min-height: 100vh;
  padding: calc(var(--section-pad) + 5rem) clamp(1.5rem, 6vw, 5rem) var(--section-pad);
}

.cf-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: 0 5rem;
  align-items: start;
}

/* ── Left sidebar ────────────────────────────────────────── */
.cf-left {
  position: sticky;
  top: calc(60px + 3rem);
}

.cf-num {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  color: var(--color-dim);
  margin-bottom: 1rem;
}

.cf-heading {
  font-family: var(--font-display);
  font-size: clamp(2.8rem, 5vw, 5rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 0.88;
  color: var(--color-text);
  margin-bottom: 1.6rem;
}

.cf-sub {
  font-family: var(--font-body);
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--color-dim);
  max-width: 32ch;
  margin-bottom: 2.5rem;
}

/* Meta info list */
.cf-meta-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--color-border);
}

.cf-meta-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--color-border);
}

.cf-meta-label {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-dim);
}

.cf-meta-value {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  color: rgba(254, 254, 254, 0.75);
  text-decoration: none;
  transition: color 0.2s ease;
}

a.cf-meta-value:hover { color: var(--color-orange); }

.cf-meta-value--open {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(100, 220, 120, 0.85);
}

.cf-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  animation: status-pulse 2.4s ease-in-out infinite;
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

/* ── Capsule: single bordered container for tabs + form ─── */
.cf-capsule {
  border: 1px solid var(--color-border-mid);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.3s ease;
}

/* When hire-me tab is active, capsule border shifts to maroon tone */
.cf-capsule.mode-hiring {
  border-color: rgba(218, 69, 69, 0.25);
}

/* ── Tab header row ──────────────────────────────────────── */
.cf-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--color-border-mid);
  margin-bottom: 0;      /* NO gap — tabs sit flush on capsule edge */
}

.cf-tab {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.4rem 1.6rem;
  background: var(--color-surface);
  border: none;          /* No individual border — capsule owns the border */
  border-right: 1px solid var(--color-border-mid);
  border-radius: 0;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
  min-height: 80px;
  position: relative;
}

/* Remove right border from last tab */
.cf-tab:last-child {
  border-right: none;
}

/* Bottom indicator line — clearly shows active tab */
.cf-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
  transition: background 0.25s ease;
}

.cf-tab.is-active::after {
  background: var(--color-maroon-b);
}

.cf-tab.is-active {
  background: rgba(139, 26, 26, 0.12);
}

.cf-tab:hover:not(.is-active) {
  background: rgba(254, 254, 254, 0.03);
}

.cf-tab:focus-visible {
  outline: 2px solid var(--color-orange);
  outline-offset: -2px;
}

.cf-tab-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  color: rgba(254, 254, 254, 0.25);
  transition: color 0.2s ease;
}

.cf-tab.is-active .cf-tab-icon { color: var(--color-maroon-b); }
.cf-tab:hover:not(.is-active) .cf-tab-icon { color: rgba(254,254,254,0.45); }

.cf-tab-icon svg { width: 100%; height: 100%; }

.cf-tab-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cf-tab-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(254, 254, 254, 0.45);
  transition: color 0.2s ease;
}

.cf-tab.is-active .cf-tab-title  { color: rgba(254, 254, 254, 0.95); }
.cf-tab:hover:not(.is-active) .cf-tab-title { color: rgba(254, 254, 254, 0.7); }

.cf-tab-sub {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: var(--color-dim);
  line-height: 1.3;
}

/* ── Panel container — inside the capsule body ───────────── */
.cf-panels {
  padding: 2rem 2rem 2.2rem;
}

.cf-panel {
  display: none;
}

.cf-panel.is-active {
  display: block;
  animation: cf-slide-in 0.28s ease forwards;
}

@keyframes cf-slide-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Form layout helpers ─────────────────────────────────── */
.cf-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cf-row {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 0;
}

.cf-row--2 {
  grid-template-columns: 1fr 1fr;
}

/* ── Form fields ─────────────────────────────────────────── */
.cf-field {
  position: relative;
  margin-bottom: 1.75rem;
}

.cf-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(254, 254, 254, 0.7);
  margin-bottom: 0.55rem;
  transition: color 0.2s ease;
}

.cf-field:focus-within .cf-label {
  color: var(--color-orange);
}

.cf-required {
  color: var(--color-maroon-b);
  margin-left: 0.15rem;
}

.cf-optional {
  color: var(--color-dim);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  margin-left: 0.3rem;
  text-transform: none;
  font-family: var(--font-body);
}

/* Full-border inputs — much more visible for accessibility */
.cf-input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: var(--color-surface);
  border: 1px solid var(--color-border-mid);
  border-radius: 2px;
  padding: 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 300;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.cf-input::placeholder {
  color: rgba(254, 254, 254, 0.2);
  font-style: italic;
  font-size: 0.88rem;
}

.cf-input:hover:not(:focus) {
  border-color: rgba(254, 254, 254, 0.2);
}

.cf-input:focus {
  border-color: var(--color-orange);
  background: rgba(217, 105, 58, 0.04);
  /* Visible focus ring — accessibility */
  box-shadow: 0 0 0 3px rgba(217, 105, 58, 0.18);
}

.cf-input.has-error {
  border-color: var(--color-maroon-b);
  box-shadow: 0 0 0 3px rgba(218, 69, 69, 0.14);
}

/* Select specifics */
.cf-select-wrap {
  position: relative;
}

.cf-select {
  cursor: pointer;
  padding-right: 2.5rem;
}

/* Remove default arrow on all browsers */
.cf-select::-ms-expand { display: none; }

.cf-select-arrow {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.75rem;
  color: var(--color-dim);
  pointer-events: none;
  transition: color 0.2s ease;
}

.cf-select-wrap:focus-within .cf-select-arrow {
  color: var(--color-orange);
}

/* Select option styling */
.cf-select option {
  background: #1a1a1a;
  color: rgba(254, 254, 254, 0.9);
}

/* Textarea */
.cf-textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.65;
}

/* Error messages */
.cf-error {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  color: var(--color-maroon-b);
  margin-top: 0.45rem;
  opacity: 0;
  height: 0;
  overflow: hidden;
  transition: opacity 0.2s ease, height 0.2s ease;
}

.cf-error::before {
  content: '! ';
  font-weight: 500;
}

.cf-error.is-visible {
  opacity: 1;
  height: 1.4em;
}

/* ── Submit button ───────────────────────────────────────── */
.cf-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 1rem 2rem;
  margin-top: 0.5rem;
  background: var(--color-text);
  border: none;
  border-radius: 2px;
  color: var(--color-bg);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
  min-height: 52px;  /* accessible height */
  position: relative;
  overflow: hidden;
}

.cf-submit::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-orange);
  transform: translateX(-100%);
  transition: transform 0.4s var(--ease-expo);
}

.cf-submit:hover::after {
  transform: translateX(0);
}

.cf-submit-text,
.cf-submit-icon {
  position: relative;
  z-index: 1;
}

.cf-submit-icon {
  font-size: 1rem;
  transition: transform 0.25s var(--ease-expo);
}

.cf-submit:hover .cf-submit-icon {
  transform: translate(3px, -3px);
}

.cf-submit:active {
  transform: scale(0.98);
}

/* Hire Me variant — orange fill instead of white */
.cf-submit--hire {
  background: var(--color-maroon-b);
}

.cf-submit--hire::after {
  background: var(--color-orange);
}

.cf-submit--hire .cf-submit-text,
.cf-submit--hire .cf-submit-icon {
  color: rgba(254, 254, 254, 0.95);
}

/* ── CTA section ─────────────────────────────────────────── */
.cf-cta-section {
  position: relative;
  overflow: hidden;
  border-top: 1px solid var(--color-border);
}

.cf-cta-section .contact-hero { opacity: 1; }
.cf-cta-section .contact-link { opacity: 1; transform: none; }
.cf-cta-section .contact-sub  { opacity: 1; }

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 960px) {
  .cf-inner {
    grid-template-columns: 1fr;
    gap: 3rem 0;
  }
  .cf-left { position: static; }
  .cf-heading { font-size: clamp(2.4rem, 7vw, 3.5rem); }
}

@media (max-width: 600px) {
  .cf-section {
    padding-top: calc(var(--section-pad) + 4rem);
  }
  .cf-row--2 {
    grid-template-columns: 1fr;
  }
  .cf-tabs {
    grid-template-columns: 1fr;
  }
  .cf-tab {
    min-height: 60px;
  }
}
