:root {
  --color-primary: #0f172a;
  --color-primary-light: #1e293b;
  --color-accent: #f97316;
  --color-accent-hover: #ea580c;
  --color-success: #10b981;
  --color-info: #3b82f6;
  --color-warning: #f59e0b;
  --color-error: #ef4444; /* Added var referenced in javascript (line 675) but missing in root */
  
  --color-bg: #f8fafc;
  --color-bg-alt: #f1f5f9; /* Added var referenced in javascript (line 663) */
  --color-card-bg: #ffffff;
  --color-text: #334155;
  --color-text-dark: #0f172a;
  --color-border: #e2e8f0;
  
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -4px rgba(0,0,0,0.05);
  
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

/* Layout structure */
.dashboard-header {
  background-color: var(--color-primary);
  color: white;
  padding: 2rem 0;
  border-bottom: 4px solid var(--color-accent);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-title h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.header-title p {
  color: #94a3b8;
  font-size: 0.95rem;
  margin-top: 0.25rem;
}

/* Stats display */
.stats-container {
  display: flex;
  gap: 1rem;
}

.stat-badge {
  background-color: var(--color-primary-light);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid #334155;
  font-size: 0.85rem;
  text-align: center;
}

.stat-badge span {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-accent);
}

/* Navigation Tabs */
.nav-tabs {
  background-color: white;
  border-bottom: 1px solid var(--color-border);
  padding-top: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.tabs-flex {
  display: flex;
  gap: 1.5rem;
}

.tab-btn {
  background: none;
  border: none;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: #64748b;
  padding: 0.75rem 0.5rem;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.tab-btn::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--color-accent);
  transform: scaleX(0);
  transition: var(--transition);
}

.tab-btn.active {
  color: var(--color-accent);
}

.tab-btn.active::after {
  transform: scaleX(1);
}

/* Content Area */
.tab-content {
  padding: 2.5rem 0;
  display: none;
}

.tab-content.active {
  display: block;
}

/* List of sites tracking grid */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-control {
  flex: 1;
  max-width: 400px;
  min-width: 250px;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  font-size: 0.95rem;
  font-family: inherit;
}

.search-control:focus {
  outline: none;
  border-color: var(--color-accent);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

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

.btn-accent:hover {
  background-color: var(--color-accent-hover);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--color-border);
  color: var(--color-text);
}

.btn-outline:hover {
  background-color: var(--color-bg);
  border-color: #cbd5e1;
}

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

.btn-info:hover {
  background-color: #2563eb;
  border-color: #2563eb;
}

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

.site-card {
  background-color: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.site-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.card-header h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--color-text-dark);
  font-weight: 700;
  word-break: break-word;
}

.status-badge {
  display: inline-flex;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-déployé {
  background-color: #d1fae5;
  color: #065f46;
}

.status-compilé {
  background-color: #dbeafe;
  color: #1e40af;
}

.status-initialisé {
  background-color: #fef3c7;
  color: #92400e;
}

.card-body {
  flex: 1;
  margin-bottom: 1.5rem;
}

.meta-row {
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.meta-row .label {
  color: #94a3b8;
  width: 80px;
  flex-shrink: 0;
}

.meta-row .val {
  color: var(--color-text);
  font-weight: 500;
}

/* Help details style */
.help-details {
  background-color: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.help-details[open] {
  box-shadow: var(--shadow-md);
}

.help-details summary {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-primary);
  cursor: pointer;
  outline: none;
  user-select: none;
}

.help-content {
  margin-top: 1rem;
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
}

.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

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

.help-col h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.help-col p {
  font-size: 0.82rem;
  color: var(--color-text);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.card-actions {
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: auto;
}

.card-actions .action-btn {
  flex: 1;
  min-width: 90px;
  font-size: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  background-color: white;
  color: var(--color-text-dark);
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.card-actions .btn-compiler {
  background-color: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}
.card-actions .btn-compiler:hover {
  background-color: var(--color-primary-light);
  border-color: var(--color-primary-light);
}

.card-actions .btn-deployer {
  background-color: var(--color-success);
  color: white;
  border-color: var(--color-success);
}
.card-actions .btn-deployer:hover {
  background-color: #059669;
  border-color: #059669;
}

.card-actions .btn-deployer:disabled {
  background-color: #e2e8f0;
  color: #94a3b8;
  border-color: #e2e8f0;
  cursor: not-allowed;
  opacity: 0.6;
}

.card-actions .btn-visualiser {
  background-color: white;
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.card-actions .btn-visualiser:hover {
  background-color: #fff7ed;
}
.card-header .edit-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  cursor: pointer;
  transition: var(--transition);
  padding: 0;
}
.card-header .edit-btn:hover {
  background-color: var(--color-bg);
  color: var(--color-text-dark);
  border-color: #cbd5e1;
}

.modal-body-scrollable {
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 0.5rem;
  margin-bottom: 1.5rem;
}

/* Drag and Drop Zone and Image Uploads */
.drag-drop-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-sm);
  padding: 2rem;
  text-align: center;
  background-color: var(--color-bg);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
}

.drag-drop-zone:hover, .drag-drop-zone.dragover {
  border-color: var(--color-info);
  background-color: #eff6ff;
}

.drag-drop-message p {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-dark);
  margin-bottom: 0.25rem;
}

.drag-drop-message p strong {
  color: var(--color-info);
}

.image-preview-card {
  position: relative;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.image-preview-card img {
  width: 100%;
  height: 70px;
  object-fit: cover;
  border-radius: 4px;
}

.image-preview-card .image-name {
  font-size: 0.7rem;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-align: center;
  margin-top: 0.25rem;
}

.image-preview-card .upload-progress {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.7);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
}

.image-preview-card .upload-success {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--color-success);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: bold;
}

/* Form Styles (Intake tab) */
.form-card {
  background-color: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  max-width: 800px;
  margin: 0 auto;
}

.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: fadeIn var(--transition);
}

.step-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 0.5rem;
}

.step-desc {
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
  color: var(--color-text-dark);
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-text-dark);
  background-color: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.15);
}

/* Services dynamic array */
.services-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.service-item-block {
  border: 1px solid var(--color-border);
  background-color: var(--color-bg-alt);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  position: relative;
}

.remove-service-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--color-error);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
}

.add-service-btn-container {
  text-align: center;
  margin-bottom: 1.5rem;
}

/* Steps tracker */
.steps-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  position: relative;
}

.steps-nav::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--color-border);
  z-index: 1;
  transform: translateY(-50%);
}

.step-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: white;
  border: 3px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  color: #64748b;
  position: relative;
  z-index: 2;
  transition: var(--transition);
}

.step-dot.active {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.step-dot.completed {
  border-color: var(--color-success);
  background-color: var(--color-success);
  color: white;
}

.form-navigation {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--color-border);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
}

/* Modal / Popup for file downloading instructions */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
  display: none;
}

.modal-content {
  background: white;
  border-radius: var(--radius-md);
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.modal-body {
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.modal-body ol {
  padding-left: 1.25rem;
  margin: 1rem 0;
}

.modal-body ol li {
  margin-bottom: 0.5rem;
}

.modal-body code {
  display: block;
  background-color: var(--color-bg);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  border: 1px solid var(--color-border);
  overflow-x: auto;
  margin-top: 0.5rem;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  background: white;
  border-radius: var(--radius-md);
  border: 1px dashed var(--color-border);
  grid-column: 1 / -1;
}

.empty-state h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-text-dark);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.9rem;
  color: #64748b;
}

/* Socials dynamic list styling */
.socials-dynamic-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.social-row {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

.remove-social-btn {
  background: none;
  border: none;
  color: var(--color-error);
  cursor: pointer;
  font-weight: 600;
  font-size: 1.2rem;
  padding: 0.25rem 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.remove-social-btn:hover {
  transform: scale(1.1);
}

@media (max-width: 580px) {
  .social-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
    border: 1px solid var(--color-border);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    position: relative;
  }
  .remove-social-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
  }
}

/* Login Screen Style */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 1.5rem;
}

.login-card {
  background: rgba(30, 41, 59, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 3.5rem 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.login-header {
  margin-bottom: 2rem;
}

.login-logo {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  display: inline-block;
  animation: float 3s ease-in-out infinite;
}

.login-card h2 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: white;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.login-card p {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

.login-card .form-label {
  color: #cbd5e1;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.login-card .form-control {
  background-color: rgba(15, 23, 42, 0.4);
  border-color: rgba(255, 255, 255, 0.1);
  color: white;
}

.login-card .form-control:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25);
  outline: none;
}

.login-submit-btn {
  width: 100%;
  margin-top: 1rem;
}

.login-error {
  color: #f87171;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.75rem;
  text-align: left;
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* FAQ Markdown / README style mapping */
.faq-list details {
  background-color: white;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.faq-list details[open] {
  box-shadow: var(--shadow-md);
}

.faq-list details summary {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-primary);
  cursor: pointer;
  outline: none;
  user-select: none;
}

.faq-list details > summary + * {
  margin-top: 1rem;
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
}

.faq-list details p {
  margin-bottom: 1rem;
  line-height: 1.6;
  font-size: 0.92rem;
  color: var(--color-text);
}

.faq-list details ul, .faq-list details ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.faq-list details li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.faq-list details code {
  background-color: var(--color-bg);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--color-accent);
  border: 1px solid var(--color-border);
}

.faq-list details pre {
  background-color: var(--color-bg);
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  overflow-x: auto;
  margin: 1rem 0;
}

.faq-list details pre code {
  background: none;
  padding: 0;
  color: var(--color-text-dark);
  border: none;
}

.faq-list details h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--color-primary);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px dashed var(--color-border);
  padding-bottom: 0.25rem;
}

.faq-list details h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--color-primary);
  margin-top: 1.75rem;
  margin-bottom: 1rem;
}

