:root {
  /* Colors */
  --main-bg-color: #ffffff;
  --main-text-color: #333333;
  --accent-color: #007BFF; /* Primary Accent (Bootstrap primary) */
  --brand-green: #30683c; /* Homepage slogan banner */
  --muted-bg: #e9e9e9; /* Examples section */
  --border-color: #dddddd;

  /* Typography */
  --font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --fs-h1: 2.5rem;
  --fs-h2: 2rem;
  --fs-h3: 1.5rem;
  --fs-body: 1rem;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Surfaces */
  --surface-bg: #ffffff;

  /* Spacing scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
}



* {
  box-sizing: border-box;
}



body {
  margin: 0;
  padding: 0;
  background-color: var(--main-bg-color);
  color: var(--main-text-color);
  font-family: var(--font-family);
  line-height: 1.6;
}



h1 {
  font-size: var(--fs-h1);
  margin-bottom: 0.5em;
}

h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p, li, input, button, select, textarea { font-size: var(--fs-body); }



a, a:hover, a:active, a:visited {
  text-decoration: none;
  color: initial;
}



img {
  max-width: 100%;
  height: auto;
}



footer {
  text-align: center;
  margin-top: 20px;
  width: 100%;
}



#mflash {
  color: red;
}



#logo-banner {
  width: 100%;
  max-width: 600px;
  margin: 40px auto;
  display: block;
}

#logo-banner img {
  width: 80%;
  height: auto;
}



#slogan-banner {
  background-color: var(--brand-green);
  text-align: center;
  font-size: 1.2em;
  color: var(--main-bg-color);
  margin-top: 10px;
  padding: 200px 0;
}



#about-section {
  padding: 80px;
  background-color: var(--main-bg-color);
  color: var(--main-text-color);
  font-family: var(--font-family);
}



#examples-section {
  background-color: var(--muted-bg);
  color: var(--main-text-color);
  font-family: var(--font-family);
}

#examples-section img {
  width: 300px;
}



#pnl-info-section {
  padding: 80px;
  background-color: var(--main-bg-color);
  color: var(--main-text-color);
  font-family: var(--font-family);
}



#products-section {
  padding: 20px;
  background-color: #ffffff;
  color: var(--main-text-color);
  font-family: var(--font-family);
}


#services-section {
  padding: 80px;
  background-color: var(--main-bg-color);
  color: var(--main-text-color);
  font-family: var(--font-family);
}

#services-section p {
  font-size: 1.4em;
}



.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}



.product-item {
  border: 1px solid var(--border-color);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-sm);
}



.footer-content {
  padding: 80px;
}

/* Utilities and custom components */
.btn-brand {
  background-color: var(--brand-green);
  color: #fff;
  border-color: var(--brand-green);
}
.btn-brand:hover,
.btn-brand:focus {
  background-color: #295a35;
  border-color: #295a35;
  color: #fff;
}

.banner-brand {
  background: var(--brand-green);
  color: #fff;
  padding: var(--space-6) 0;
}

.card-surface {
  background: var(--surface-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
}

/* Dark mode overrides */
:root[data-theme='dark'] {
  --main-bg-color: #0d1117;
  --main-text-color: #c9d1d9;
  --muted-bg: #161b22;
  --border-color: #30363d;
  --surface-bg: #161b22;
  --brand-green: #3fb950;
  --accent-color: #58a6ff;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4);
}

:root[data-theme='dark'] .btn-brand {
  background-color: #238636;
  border-color: #238636;
}

:root[data-theme='dark'] .btn-brand:hover,
:root[data-theme='dark'] .btn-brand:focus {
  background-color: #2ea043;
  border-color: #2ea043;
}

:root[data-theme='dark'] .alert-info {
  background-color: #1c2d41;
  border-color: #1f6feb;
  color: #79c0ff;
}

:root[data-theme='dark'] .alert-danger {
  background-color: #2c1e1e;
  border-color: #f85149;
  color: #ff7b72;
}

:root[data-theme='dark'] .alert-success {
  background-color: #1e2c21;
  border-color: #238636;
  color: #7ee787;
}

/* Navigation */
.navbar {
  background-color: var(--surface-bg) !important;
  border-bottom: 1px solid var(--border-color);
}

.navbar-brand,
.nav-link,
.navbar-text {
  color: var(--main-text-color) !important;
}

.nav-link:hover {
  opacity: 0.8;
}

.swatch {
  width: 100%;
  height: 60px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid rgba(0, 0, 0, 0.1);
  border-top-color: var(--brand-green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner-lg {
  width: 3rem;
  height: 3rem;
  border-width: 4px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Loading overlay and spinner */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 9999;
}

.loading-overlay.active {
  display: flex;
}

.loading-overlay .spinner {
  width: 3rem;
  height: 3rem;
  border-width: 0.3rem;
  margin-bottom: 1rem;
}

.loading-overlay p {
  color: white;
  margin: 0;
  font-size: 1.1rem;
}

/* Form validation styles */
.form-control.is-valid,
.form-select.is-valid {
  border-color: var(--brand-green) !important;
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid,
.form-select.is-invalid {
  border-color: #dc3545 !important;
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.invalid-feedback {
  display: block;
  color: #dc3545;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.invalid-feedback.d-none {
  display: none !important;
}

.password-strength {
  margin-top: 0.5rem;
}

.password-strength .progress {
  height: 5px;
  background-color: rgba(0, 0, 0, 0.1);
}

.char-counter {
  font-size: 0.875rem;
  color: var(--muted-text-color);
}

.required-indicator {
  color: #dc3545;
  font-weight: bold;
}

/* Dark mode form validation adjustments */

:root[data-theme='dark'] .spinner {
  border-color: rgba(255, 255, 255, 0.2);
  border-top-color: var(--brand-green);
}

:root[data-theme='dark'] .password-strength .progress {
  background-color: rgba(255, 255, 255, 0.1);
}

:root[data-theme='dark'] .form-control.is-valid,
:root[data-theme='dark'] .form-select.is-valid {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%233fb950' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
}

:root[data-theme='dark'] .form-control.is-invalid,
:root[data-theme='dark'] .form-select.is-invalid {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23f85149'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23f85149' stroke='none'/%3e%3c/svg%3e");
}
