/* Custom Reset & Typography */
:root {
  --primary-color: #005163;
  --primary-hover: #00333e;
  --bg-color: #ffffff;
  --card-bg: #f8fafc;
  --text-color: #242424;
  --text-secondary: #475569;
  --success: #8bc53e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border-color: #cbd5e1;
  --font-family: 'ssp_l', 'ssp_r', 'Open Sans', sans-serif;
}

#digitalcheck-public-root,
#digitalcheck-admin-root {
  font-family: var(--font-family);
  
  color: var(--text-color);
  line-height: 1.6;
  text-align: left;
}

#digitalcheck-public-root *
#digitalcheck-admin-root * {
  box-sizing: border-box;
}

#digitalcheck-public-root a,
#digitalcheck-admin-root a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

#digitalcheck-public-root a:hover,
#digitalcheck-admin-root a:hover {
  color: var(--primary-hover);
}

#digitalcheck-public-root button,
#digitalcheck-admin-root button {
  cursor: pointer;
  font-family: var(--font-family);
  transition: all 0.2s ease-in-out;
}

/* Base Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px;
}

header {
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem 0;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}

header .nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-color) !important;
  font-family: 'ssp_b', sans-serif;
  letter-spacing: -0.02em;
  margin: 0;
}

.logo span {
  font-weight: 400;
  color: var(--text-secondary);
}

/* Button Component */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
}

.btn-primary {
  background-color: var(--success) !important;
  color: white !important;
}

.btn-primary:hover {
  background-color: #5ea205 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 197, 62, 0.3);
}

.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
}

.btn-secondary:hover {
  background-color: rgba(0, 81, 99, 0.05);
  border-color: var(--primary-color);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-danger:hover {
  background-color: #dc2626;
}

/* Public Flow - Hero Area */
.hero {
  text-align: center;
  padding: 3rem 0;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
  color: var(--primary-color);
  font-family: 'ssp_b', sans-serif;
}

.hero h1 mark {
  background: none;
  color: var(--success);
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto 2.5rem;
}

.audit-form-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 2.5rem;
  max-width: 800px;
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.audit-form-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--success));
}

.form-group {
  margin-bottom: 1.5rem;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.input-control {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 0.5rem;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  font-size: 1rem;
  outline: none;
  transition: all 0.2s ease-in-out;
  box-sizing: border-box;
}

.input-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 81, 99, 0.15);
}

/* Results Dashboard */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 3rem;
  margin-bottom: 2rem;
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 1rem;
  border: 1px solid var(--border-color);
}

.overall-score-widget {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.score-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  font-weight: 800;
  border: 8px solid var(--border-color);
  background-color: #ffffff;
}

.score-success { border-color: var(--success); color: var(--success); }
.score-warning { border-color: var(--warning); color: var(--warning); }
.score-danger { border-color: var(--danger); color: var(--danger); }

.score-circle span {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: -4px;
}

.category-scores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.category-score-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: left;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.category-score-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.category-score-card h3 {
  font-size: 1rem;
  color: var(--text-color);
  margin: 0;
  font-weight: 700;
}

.mini-score-bar {
  height: 6px;
  background-color: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 1rem;
}

.mini-score-fill {
  height: 100%;
  background-color: var(--primary-color);
}

/* Detailed Checklist Accordion */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  font-family: 'ssp_b', sans-serif;
}

.metrics-accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 4rem;
}

.metrics-accordion h3 {
border:0 !important;
font-weight:bold;
font-size: calc(var(--base-font-size) + 0.8rem) !important;
}

.metric-row {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  overflow: hidden;
  transition: all 0.2s ease-in-out;
}

.metric-row-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
}

.metric-row-header:hover {
  background-color: rgba(0, 81, 99, 0.02);
}

.metric-name-container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-success { background-color: rgba(139, 197, 62, 0.80); color:white; }
.badge-warning { background-color: rgba(245, 158, 11, 0.80); color: white; }
.badge-danger { background-color: rgba(239, 68, 68, 0.80); color: white; }

.metric-body {
  padding: 1em;
  background-color: #ffffff;
  border-top: 1px solid var(--border-color);
}

.metric-body p {
margin:0 !important;
padding:0 !important;
}



/* Lead Capture Box inside Results page */
.lead-capture-section {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 3rem;
  margin-bottom: 4rem;
  position: relative;
  overflow: hidden;
  color: #ffffff;
}

.lead-capture-section::after {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(139, 197, 62, 0.2) 0%, transparent 70%);
  z-index: 0;
}

.lead-capture-section h2, 
.lead-capture-section p, 
.lead-capture-section label, 
.lead-capture-section span {
  color: #ffffff !important;
}

.lead-capture-section .checkbox-label {
  color: rgba(255,255,255,0.85) !important;
}

.lead-capture-section .input-control {
  background-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.lead-capture-section .input-control:focus {
  background-color: rgba(255, 255, 255, 0.15);
  border-color: #ffffff;
}

/* Fix inline dark-mode background injected by React App.js */
.lead-capture-section > div > div:nth-child(2) {
  background-color: rgba(0, 0, 0, 0.15) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
}

.lead-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .lead-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

.lead-checklist {
  display: flex;
  gap: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

@media (max-width: 576px) {
  .lead-checklist {
    flex-direction: column;
    gap: 0.75rem;
  }
}

.lead-form-card {
  background-color: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  padding: 2rem;
  border-radius: 0.75rem;
}

@media (max-width: 576px) {
  .lead-form-card {
    padding: 1.25rem;
  }
}

.checkbox-label {
  display: flex;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  align-items: flex-start;
}

.checkbox-label input {
  margin-top: 3px;
}

/* Admin Dashboard Panel */
.admin-container {
  display: flex;
  min-height: calc(100vh - 80px);
  background-color: var(--bg-color);
}

.admin-sidebar {
  width: 260px;
  border-right: 1px solid var(--border-color);
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background-color: var(--card-bg);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s ease;
}

.sidebar-link:hover, .sidebar-link.active {
  color: var(--primary-color);
  background-color: rgba(0, 81, 99, 0.05);
}

.sidebar-link.active {
  background-color: #ffffff;
  border-left: 3px solid var(--primary-color);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.admin-content {
  flex: 1;
  padding: 3rem;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background-color: #ffffff;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
}

th {
  background-color: var(--card-bg);
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: 'ssp_b', sans-serif;
}

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

/* Loading Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0, 81, 99, 0.1);
  border-top-color: var(--success);
  border-radius: 50%;
  animation: spin 1s infinite linear;
  margin: 2rem auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Alert notifications */
.alert {
  padding: 1rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.alert-success { background-color: rgba(139, 197, 62, 0.15); color: #5ea205; border: 1px solid rgba(139, 197, 62, 0.3); }
.alert-error { background-color: rgba(239, 68, 68, 0.15); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }

/* =========================================
   Mobile Optimization (Smartphones & Tablets)
   ========================================= */
@media (max-width: 768px) {

.lead-grid p, .metric-body p {font-size:16px !important}

  .audit-form-card {padding:20px 10px !important; box-sizing: border-box;}
  .audit-form-card > form {flex-direction: column; margin-bottom: 0 !important;}

  /* Hero Section */
  .hero {
    padding: 2rem 0;
  }
  .hero h1 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
  }
  .hero p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }

  /* Form & Cards */
  .audit-form-card {
    padding: 1rem 0.5rem;
    
  }
.form-group {text-align: center;}
  .form-group > div {
    flex-direction: column;
  }

  .speedtest {padding:10px;}

  /* Results Dashboard */
  .results-header {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
    gap: 1rem;
  }
  .overall-score-widget {
    flex-direction: column;
    gap: 1rem;
  }

  .lead-capture-section {
    padding: 1.5rem;
  }
  .lead-capture-section::after {
    display: none;
  }

  /* Metrics Accordion */
  .metric-row-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
  }
  .status-badge {
    align-self: flex-start;
  }

  /* Admin Dashboard Panel */
  .admin-container {
    flex-direction: column;
  }
  .admin-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }
  .sidebar-link {
    flex: 1 1 auto;
    justify-content: center;
  }
  .sidebar-link.active {
    border-left: none;
    border-bottom: 3px solid var(--primary-color);
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0;
  }
  .admin-content {
    padding: 1.5rem 1rem;
  }
  
  /* Tables */
  th, td {
    padding: 0.75rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {



  .category-scores-grid {
    grid-template-columns: 1fr;
  }
  header .nav-container {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  .audit-form-card .btn {
    width: 100%;
    justify-content: center;
  }
  .lead-grid {
    gap: 1.5rem;
  }
}

/* Results Page Overhauls & AI Readiness Summary Styling */
.results-summary-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
  text-align: left;
}

.overall-score-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.overall-score-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.gemini-summary-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.gemini-summary-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
}

@media (max-width: 768px) {
  .results-summary-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .overall-score-card {
    padding: 2rem !important;
  }
}
