/* 
   kW Calc Legal & Content Pages Stylesheet
   Tailored for about.html, contact.html, privacy-policy.html, terms.html, and cookie-policy.html
*/

:root {
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #475569;
  --bg-card: #ffffff;
  --bg-accent: #f8fafc;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --border: #e2e8f0;
  --radius-lg: 12px;
  --radius-md: 8px;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 10px 15px -3px rgba(37, 99, 235, 0.05), 0 4px 6px -2px rgba(37, 99, 235, 0.03);
}

.legal-page-wrapper {
  background-color: #f8fafc;
  min-height: 80vh;
  padding: 0 0 5rem;
}

.legal-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ─── Hero / Header Section ────────────────────────────────── */
.legal-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 60%, #1d4ed8 100%);
  border-radius: 0;
  padding: 0;
  margin-bottom: 3rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
  position: relative;
  overflow: hidden;
  width: 100%;
}

.legal-hero-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem;
  text-align: center;
  position: relative;
  z-index: 2;
}

.legal-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.legal-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 1rem;
  border-radius: 9999px;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  backdrop-filter: blur(4px);
}

.legal-hero h1 {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.legal-hero p {
  color: rgba(255, 255, 255, 0.95);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ─── Content Card ────────────────────────────────────────── */
.legal-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  box-shadow: var(--shadow);
}

.legal-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 2.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.legal-card h2:first-of-type {
  margin-top: 0;
}

.legal-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.legal-card p {
  font-size: 0.975rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.legal-card ul, .legal-card ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.legal-card li {
  font-size: 0.975rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
  position: relative;
}

.legal-card ul li {
  list-style: none;
}

.legal-card ul li::before {
  content: "•";
  color: var(--primary);
  font-weight: bold;
  display: inline-block;
  width: 1em;
  margin-left: -1em;
}

.legal-card a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dashed rgba(37, 99, 235, 0.4);
  transition: all 0.2s ease;
}

.legal-card a:hover {
  color: var(--primary-hover);
  border-bottom-color: var(--primary-hover);
  background-color: rgba(37, 99, 235, 0.04);
  border-radius: 2px;
}

/* ─── Callout Panels ──────────────────────────────────────── */
.legal-callout {
  border-left: 4px solid var(--primary);
  background-color: #f0f7ff;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.legal-callout-warning {
  border-left-color: #f59e0b;
  background-color: #fffbeb;
}

.legal-callout p {
  margin-bottom: 0 !important;
  font-size: 0.95rem;
}

.legal-callout strong {
  color: var(--text-primary);
}

/* ─── Interactive Contact Form ────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
  margin-top: 1rem;
}

@media (max-width: 850px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.info-icon {
  width: 42px;
  height: 42px;
  background-color: #eff6ff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.info-icon svg {
  width: 20px;
  height: 20px;
}

.info-details h3 {
  margin: 0 !important;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.info-details p {
  margin: 0.25rem 0 0 !important;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.contact-form-card {
  background: var(--bg-accent);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2rem;
}

.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

@media (max-width: 550px) {
  .form-group-row {
    grid-template-columns: 1fr;
  }
}

.form-field {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-field input, .form-field textarea {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background-color: #ffffff;
  color: var(--text-primary);
  transition: all 0.2s ease;
  outline: none;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.9;
}

.form-field input:focus, .form-field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.btn-submit {
  width: 100%;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.85rem;
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-submit:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-submit:active {
  transform: translateY(0);
}

/* Success Card Animation */
.success-card {
  display: none;
  text-align: center;
  padding: 3rem 1.5rem;
}

.success-card.show {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.4s ease forwards;
}

.success-icon {
  width: 64px;
  height: 64px;
  background-color: #dcfce7;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #15803d;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 10px rgba(34, 197, 94, 0.15);
}

.success-icon svg {
  width: 32px;
  height: 32px;
}

.success-card h3 {
  font-size: 1.35rem;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0 !important;
}

.success-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 320px;
  margin: 0 auto !important;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ─── Cookie Policy Table ────────────────────────────────── */
.cookie-table-container {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.cookie-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.cookie-table th {
  background-color: #f8fafc;
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--border);
}

.cookie-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}

.cookie-table tr:last-child td {
  border-bottom: none;
}

.cookie-table code {
  background-color: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-family: SFMono-Regular, Consolas, Monaco, monospace;
  font-size: 0.8rem;
  color: #0f172a;
}

.cookie-badge {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-essential { background-color: #fee2e2; color: #991b1b; }
.badge-analytics { background-color: #eff6ff; color: #1e40af; }
.badge-advertising { background-color: #fef3c7; color: #78350f; }

/* ─── Responsive adjustments ──────────────────────────────── */
@media (max-width: 768px) {
  .legal-page-wrapper {
    padding: 0 0 3rem;
  }
  .legal-card {
    padding: 2rem 1.25rem;
  }
  .legal-hero-inner {
    padding: 3.5rem 1.25rem;
  }
  .legal-hero {
    margin-bottom: 2rem;
  }
}
