:root {
  --lc-primary: #2563eb;
  --lc-primary-dark: #1d4ed8;
  --lc-accent: #0ea5e9;
  --lc-bg: #f5f7fb;
  --lc-surface: #ffffff;
  --lc-text: #1f2937;
  --lc-muted: #6b7280;
  --lc-border: #e5e7eb;
  --lc-danger: #dc2626;
  --lc-success: #16a34a;
  --lc-warning: #d97706;
  --lc-radius: 10px;
  --lc-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --lc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--lc-font);
  color: var(--lc-text);
  background: var(--lc-bg);
  line-height: 1.5;
}

a {
  color: var(--lc-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.lc-container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem;
}

/* Navigation bar */
.lc-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: var(--lc-surface);
  border-bottom: 1px solid var(--lc-border);
  box-shadow: var(--lc-shadow);
}

.lc-navbar .brand {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--lc-primary);
}

.lc-navbar nav a {
  margin-left: 1rem;
  color: var(--lc-muted);
  font-weight: 500;
}

.lc-navbar nav a:hover {
  color: var(--lc-text);
}

/* Cards */
.lc-card {
  background: var(--lc-surface);
  border: 1px solid var(--lc-border);
  border-radius: var(--lc-radius);
  box-shadow: var(--lc-shadow);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}

.lc-card h2,
.lc-card h3 {
  margin-top: 0;
}

/* Headings */
h1, h2, h3 {
  color: var(--lc-text);
  font-weight: 700;
}

/* Forms */
.lc-form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.92rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--lc-border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--lc-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

input.invalid,
select.invalid,
textarea.invalid {
  border-color: var(--lc-danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12);
}

/* ===== Autofill override: prevent browser white background on dark pages ===== */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px var(--autofill-bg, #fff) inset !important;
  -webkit-text-fill-color: var(--autofill-text, var(--lc-text)) !important;
  transition: background-color 5000s ease-in-out 0s;
  caret-color: var(--autofill-text, var(--lc-text));
}

.field-error {
  color: var(--lc-danger);
  font-size: 0.82rem;
  margin-top: 0.25rem;
  min-height: 1rem;
}

/* Buttons */
.lc-btn,
button,
input[type="submit"] {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border: none;
  border-radius: 8px;
  background: var(--lc-primary);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.lc-btn:hover,
button:hover,
input[type="submit"]:hover {
  background: var(--lc-primary-dark);
}

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

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

.lc-btn:disabled,
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Alerts */
.lc-alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}

.lc-alert.error {
  background: #fef2f2;
  color: var(--lc-danger);
  border: 1px solid #fecaca;
}

.lc-alert.success {
  background: #f0fdf4;
  color: var(--lc-success);
  border: 1px solid #bbf7d0;
}

.lc-alert.info {
  background: #eff6ff;
  color: var(--lc-primary-dark);
  border: 1px solid #bfdbfe;
}

/* Tables */
.lc-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--lc-surface);
}

.lc-table th,
.lc-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--lc-border);
}

.lc-table th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--lc-muted);
}

/* Star rating widget */
.lc-stars {
  display: inline-flex;
  flex-direction: row-reverse;
  font-size: 1.6rem;
  line-height: 1;
}

.lc-stars input {
  display: none;
}

.lc-stars label {
  color: #d1d5db;
  cursor: pointer;
  padding: 0 2px;
  margin: 0;
}

.lc-stars input:checked ~ label,
.lc-stars label:hover,
.lc-stars label:hover ~ label {
  color: #f59e0b;
}

.lc-rating-display {
  color: #f59e0b;
  font-weight: 600;
}

/* Utility */
.text-muted { color: var(--lc-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }

.lc-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

@media (max-width: 640px) {
  .lc-navbar {
    flex-direction: column;
    gap: 0.5rem;
  }
  .lc-container {
    padding: 1rem;
  }
}

/* ===== Accessibility: visible keyboard focus indicator (WCAG 2.4.7) ===== */
:focus-visible {
  outline: 3px solid var(--lc-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

a:focus-visible,
button:focus-visible,
.lc-btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid var(--lc-accent);
  outline-offset: 2px;
}

/* ===== Responsive breakpoints (applied site-wide via /css/main.css) ===== */
@media (max-width: 1024px) {
  .lc-container { max-width: 100%; padding: 1.25rem; }
  .lc-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 768px) {
  .lc-navbar { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .lc-navbar nav a { margin-left: 0; margin-right: 1rem; }
  .lc-grid { grid-template-columns: 1fr 1fr; }
  .lc-card { padding: 1.1rem; }
  .lc-table th, .lc-table td { padding: 0.5rem; font-size: 0.88rem; }
}

@media (max-width: 480px) {
  .lc-container { padding: 0.85rem; }
  .lc-grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  .lc-btn, button, input[type="submit"] { width: 100%; }
}

/* Global Toast Container */
#lc-toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.lc-toast {
  background: #1e293b;
  color: #f8fafc;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInToast 0.3s ease;
  border-left: 4px solid #3b82f6;
  font-size: 0.95rem;
}
.lc-toast.success { border-left-color: #10b981; }
.lc-toast.error { border-left-color: #ef4444; }
.lc-toast.warning { border-left-color: #f59e0b; }
@keyframes slideInToast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Global Loader Overlay */
#lc-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.6);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
}
#lc-loader.hidden { display: none !important; }
.lc-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(255,255,255,0.2);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: lcSpin 1s linear infinite;
}
@keyframes lcSpin {
  to { transform: rotate(360deg); }
}
