/* =========================================
   RedSharc — components.css
   Utility classes, shared components,
   print styles, accessibility
   ========================================= */

/* === FOCUS VISIBLE === */
:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* === SKIP LINK === */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--red);
  color: var(--white);
  padding: .5rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  z-index: 10000;
  transition: top .2s;
}
.skip-link:focus { top: 1rem; }

/* === VISUALLY HIDDEN === */
.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;
}

/* === NOTIFICATION TOAST === */
.toast {
  position: fixed;
  bottom: 5rem;
  right: 1.5rem;
  background: var(--black);
  color: var(--white);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  font-size: .9375rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 9000;
  transform: translateY(100px);
  opacity: 0;
  transition: all .35s var(--transition);
  max-width: 320px;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast--success { border-left: 4px solid #22c55e; }
.toast--error { border-left: 4px solid var(--red); }

/* === PAGE SECTION DIVIDERS === */
.section + .section { position: relative; }

/* === SELECTION COLOR === */
::selection {
  background: rgba(224,30,44,.15);
  color: var(--black);
}

/* === SCROLLBAR STYLING === */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--red); }

/* === PRINT STYLES === */
@media print {
  header, footer, .hero-visual, #preloader, .whatsapp-fab,
  #page-progress, .btn, .nav-toggle { display: none !important; }
  body { font-size: 12pt; color: #000; }
  h1, h2, h3 { color: #000; }
  a { color: #000; text-decoration: underline; }
  .section { padding: 2rem 0; }
}

/* === LOADING STATES === */
.btn.loading {
  pointer-events: none;
  opacity: .75;
  position: relative;
}
.btn.loading::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.35);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  right: 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* === FORM VALIDATION STATES === */
input.error, textarea.error, select.error {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(224,30,44,.1);
}
input.success, textarea.success {
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.1);
}
.field-error {
  font-size: .8125rem;
  color: var(--red);
  margin-top: .25rem;
}

/* === CASE STUDIES GRID (results section) === */
#results .container { /* if added later */ }

/* === UTILITY === */
.text-red { color: var(--red); }
.text-center { text-align: center; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }

/* === BACK TO TOP === */
.back-to-top {
  position: fixed;
  bottom: 5.5rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  box-shadow: var(--shadow-md);
  z-index: 40;
  opacity: 0;
  transform: translateY(12px);
  transition: all .3s var(--transition);
  pointer-events: none;
}
.back-to-top.visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.back-to-top:hover {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
  transform: translateY(-3px);
}

/* =====================================================
   UTILITY CLASSES — replaces all inline style overrides
   ===================================================== */
.mt-cta    { margin-top: 1.25rem; }
.mt-cta-lg { margin-top: 1.5rem; }
.mb-subtitle { margin-bottom: 2rem; }
.max-w-article { max-width: 820px; }
