/* ============================================
   COMPONENTS — 45black.tech
   Buttons, Cards, Hero, Footer, Forms
   ============================================ */

/* ============================================
   HERO COMPONENT
   ============================================ */

.hero {
  padding: var(--space-3xl) 0 calc(var(--space-3xl) + var(--space-xl)) 0;
  background: linear-gradient(165deg,
    rgba(27, 77, 62, 0.03) 0%,
    rgba(255, 255, 255, 1) 40%,
    rgba(0, 105, 92, 0.02) 100%
  );
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(27, 77, 62, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero h1 {
  font-size: 3.5rem;
  max-width: 20ch;
  margin-bottom: var(--space-lg);
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: var(--font-size-lg);
  max-width: 60ch;
  line-height: var(--line-height-relaxed);
  color: var(--text-secondary);
}

.hero p strong {
  color: var(--brand-primary);
}

/* Responsive Hero */
@media (max-width: 767px) {
  .hero {
    padding: var(--space-2xl) 0 var(--space-3xl) 0;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero p {
    font-size: var(--font-size-md);
  }
}

/* ============================================
   BUTTONS & FORMS
   ============================================ */

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: var(--button-height-base);
  padding: var(--button-padding-y) var(--button-padding-x);
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--text-on-dark);
  background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  border: none;
  border-radius: var(--border-radius-lg);
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  transition: var(--transition-all);
}

button::before, .button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--brand-secondary) 0%, var(--brand-primary) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

button:hover, .button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

button:hover::before, .button:hover::before {
  opacity: 1;
}

button:active, .button:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

button > *, .button > * {
  position: relative;
  z-index: 1;
}

button:focus, .button:focus {
  outline: var(--focus-ring-width) var(--focus-ring-style) var(--focus-ring-color);
  outline-offset: 3px;
}

button:disabled, .button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Form Controls */
input, textarea, select {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  padding: var(--input-padding-y) var(--input-padding-x);
  border: var(--input-border-width) solid var(--border-default);
  border-radius: var(--border-radius-lg);
  background: var(--bg-primary);
  width: 100%;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-all);
  min-height: var(--input-height);
}

input:hover, textarea:hover, select:hover {
  border-color: rgba(27, 77, 62, 0.3);
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(27, 77, 62, 0.1), var(--shadow-md);
}

label {
  display: block;
  margin-bottom: var(--space-xs);
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

/* Responsive Forms */
@media (max-width: 767px) {
  button, .button {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   CARDS & CONTENT BLOCKS
   ============================================ */

.card {
  padding: var(--space-xl);
  border: var(--border-width-1) solid rgba(229, 231, 235, 0.6);
  border-radius: var(--border-radius-lg);
  background: linear-gradient(145deg, rgba(255, 255, 255, 1) 0%, rgba(249, 250, 251, 0.5) 100%);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: var(--transition-all);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-primary) 0%, var(--brand-secondary) 100%);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(27, 77, 62, 0.2);
}

.card:hover::before {
  transform: scaleX(1);
}

.card h3 {
  margin-top: 0;
  color: var(--brand-primary);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-xl);
}

/* Responsive Cards */
@media (max-width: 767px) {
  .card {
    padding: var(--space-lg);
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }
}

/* ============================================
   CALLOUTS (for legal pages)
   ============================================ */

.callout {
  background: var(--bg-secondary);
  border-left: 4px solid var(--brand-primary);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
  border-radius: var(--border-radius-sm);
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-warning {
  border-left-color: #F59E0B;
  background: rgba(245, 158, 11, 0.05);
}

.callout-info {
  border-left-color: var(--color-accent-blue);
  background: rgba(44, 82, 130, 0.05);
}

/* ============================================
   FOOTER COMPONENTS
   ============================================ */

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-lg);
}

.footer-section h4 {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wider);
  color: var(--text-tertiary);
  margin-bottom: var(--space-md);
}

.footer-section a {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-decoration: none;
  padding: var(--space-xs) 0;
  transition: var(--transition-colors);
}

.footer-section a:hover {
  color: var(--brand-primary);
  padding-left: var(--space-xs);
}

.footer-disclaimer {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: var(--border-width-1) solid var(--border-default);
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  line-height: var(--line-height-relaxed);
}

.footer-legal {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: var(--border-width-1) solid var(--border-default);
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  text-align: center;
}

/* Responsive Footer */
@media (max-width: 767px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }
}

/* ============================================
   CTA LINK GROUPS
   ============================================ */

.cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
  margin-top: var(--space-xl);
}

.cta-group a:not(.button) {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--touch-target-min);
  padding: var(--space-sm) var(--space-md);
  font-weight: var(--font-weight-medium);
  color: var(--brand-primary);
  background: rgba(27, 77, 62, 0.05);
  border-radius: var(--border-radius-lg);
  text-decoration: none;
  transition: var(--transition-all);
}

.cta-group a:not(.button):hover {
  background: rgba(27, 77, 62, 0.1);
  transform: translateX(4px);
}

/* ============================================
   TABLES (for legal pages, data tables)
   ============================================ */

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-lg);
  font-size: var(--font-size-sm);
  border: var(--border-width-1) solid var(--border-default);
  border-radius: var(--border-radius-base);
  overflow: hidden;
}

thead {
  border-bottom: var(--border-width-2) solid var(--border-strong);
  background: var(--bg-secondary);
}

th {
  text-align: left;
  font-weight: var(--font-weight-semibold);
  padding: var(--space-sm) var(--space-md);
  color: var(--text-primary);
}

td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: var(--border-width-1) solid var(--border-light);
  color: var(--text-secondary);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--bg-secondary);
}

/* Responsive Tables */
@media (max-width: 767px) {
  table {
    font-size: var(--font-size-xs);
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  th, td {
    padding: var(--space-xs) var(--space-sm);
  }
}

/* ============================================
   LEGAL DOCUMENT LAYOUT
   ============================================ */

.legal-document {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg);
}

.document-header {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-lg);
  border-bottom: var(--border-width-2) solid var(--border-default);
}

.document-header h1 {
  font-family: var(--font-serif);
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-tight);
  margin-bottom: var(--space-sm);
  background: none;
  -webkit-text-fill-color: currentColor;
}

.document-meta {
  display: flex;
  gap: var(--space-lg);
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
}

/* Legal Document Sections */
.legal-document section {
  margin-bottom: var(--space-2xl);
}

.legal-document section:last-of-type {
  margin-bottom: var(--space-xl);
}

.legal-document h2 {
  font-family: var(--font-serif);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-md);
  margin-top: var(--space-xl);
  letter-spacing: var(--letter-spacing-snug);
}

.legal-document h3 {
  font-family: var(--font-sans);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
  margin-top: var(--space-lg);
}

/* Responsive Legal Documents */
@media (max-width: 767px) {
  .legal-document {
    padding: var(--space-xl) var(--space-md);
  }

  .document-header h1 {
    font-size: var(--font-size-3xl);
  }

  .document-meta {
    flex-direction: column;
    gap: var(--space-xs);
  }
}

/* ============================================
   STATS / METRICS DISPLAY
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-lg);
  margin: var(--space-2xl) 0;
}

.stat-item {
  text-align: center;
  padding: var(--space-lg);
  background: var(--bg-secondary);
  border-radius: var(--border-radius-lg);
  border: var(--border-width-1) solid var(--border-light);
}

.stat-value {
  display: block;
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  color: var(--brand-primary);
  line-height: var(--line-height-tight);
  margin-bottom: var(--space-xs);
}

.stat-label {
  display: block;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wide);
}

/* Responsive Stats */
@media (max-width: 767px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .stat-value {
    font-size: var(--font-size-3xl);
  }
}

/* ============================================
   PRINT COMPONENTS
   ============================================ */

@media print {
  .button, button, .cta-group {
    display: none;
  }

  .card {
    break-inside: avoid;
    box-shadow: none;
    border: var(--border-width-1) solid #ccc;
  }

  table {
    break-inside: avoid;
  }
}
