@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --primary: #0f172a;
  --primary-light: #1e293b;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --accent-light: #dbeafe;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --text: #1e293b;
  --text-light: #64748b;
  --text-white: #fff;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f8f9fa;
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
  transition: var(--transition);
}

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

/* ============================================================
   UTILITAIRES
   ============================================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-2 {
  gap: 8px;
}

.gap-4 {
  gap: 16px;
}

.grid {
  display: grid;
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.w-full {
  width: 100%;
}

.text-center {
  text-align: center;
}

.hidden {
  display: none !important;
}

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
}

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

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

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

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

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

.btn-dark:hover {
  background: var(--primary-light);
}

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

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

.btn-orange {
  background: #f59e0b;
  color: white;
}

.btn-orange:hover {
  background: #d97706;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 16px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

/* ============================================================
   FORMULAIRES
   ============================================================ */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  transition: var(--transition);
  background: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-input::placeholder {
  color: #94a3b8;
}

/* ============================================================
   BADGES / ALERTES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.alert {
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid var(--success);
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid var(--danger);
}

/* ============================================================
   TABLEAUX
   ============================================================ */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius);
  background: white;
  box-shadow: var(--shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--bg);
}

th, td {
  padding: 14px 20px;
  text-align: left;
  font-size: 14px;
}

th {
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.5px;
}

tbody tr {
  border-top: 1px solid var(--border);
  transition: var(--transition);
}

tbody tr:hover {
  background: var(--bg);
}

/* ============================================================
   HEADER GLOBAL
   ============================================================ */
.global-header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.global-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.global-header .logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.global-header .logo img {
  height: 36px;
  width: auto;
}

.global-header .logo-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.global-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ============================================================
   SÉLECTEUR DE LANGUE
   ============================================================ */
.lang-selector {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  transition: var(--transition);
}

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

.lang-btn .flag {
  font-size: 16px;
}

.lang-btn .lang-label {
  color: var(--text-light);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lang-btn .lang-name {
  font-weight: 600;
}

.lang-btn .arrow {
  font-size: 10px;
  color: var(--text-light);
  margin-left: 4px;
  transition: transform 0.2s;
}

.lang-btn.active .arrow {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
}

.lang-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.lang-dropdown-item:last-child {
  border-bottom: none;
}

.lang-dropdown-item:hover {
  background: var(--bg);
}

.lang-dropdown-item .flag {
  font-size: 18px;
}

.lang-dropdown-item .check {
  margin-left: auto;
  color: var(--accent);
  font-weight: 700;
}

.lang-dropdown-item.active {
  background: var(--accent-light);
}

/* ============================================================
   KYC PAGE - CHOIX TYPE DE COMPTE
   ============================================================ */
.kyc-choice-page {
  background: #f8f9fa;
  min-height: 100vh;
}

.kyc-choice-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
}

.kyc-choice-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
}

.kyc-choice-subtitle {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 48px;
}

.kyc-option-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.kyc-option-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.kyc-option-card:hover .kyc-option-arrow {
  color: var(--accent);
}

.kyc-option-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.kyc-option-content {
  flex: 1;
}

.kyc-option-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.kyc-option-desc {
  font-size: 14px;
  color: var(--text-light);
}

.kyc-option-arrow {
  font-size: 24px;
  color: var(--text-light);
  transition: var(--transition);
  font-weight: 300;
}

/* ============================================================
   KYC FORMULAIRE MULTI-ÉTAPES
   ============================================================ */
.kyc-form-page {
  background: #f8f9fa;
  min-height: 100vh;
  padding: 40px 0;
}

.kyc-form-container {
  max-width: 700px;
  margin: 0 auto;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.kyc-form-header {
  background: var(--primary);
  color: white;
  padding: 32px;
  text-align: center;
}

.kyc-form-header h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.kyc-form-header p {
  opacity: 0.8;
  font-size: 14px;
}

.kyc-form-progress {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 24px 32px 0;
}

.kyc-form-step {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  background: var(--border);
  color: var(--text-light);
  transition: var(--transition);
}

.kyc-form-step.active {
  background: var(--accent);
  color: white;
}

.kyc-form-step.completed {
  background: var(--success);
  color: white;
}

.kyc-form-body {
  padding: 32px;
}

.kyc-form-step-content {
  display: none;
}

.kyc-form-step-content.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

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

.kyc-form-footer {
  display: flex;
  justify-content: space-between;
  padding: 24px 32px 32px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   LOGIN PAGE (Design Capture2)
   ============================================================ */
.login-header {
  background: var(--accent);
  padding: 0;
}

.login-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.login-header .logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-header .logo img {
  height: 32px;
  width: auto;
}

.login-header .logo-text {
  font-size: 18px;
  font-weight: 700;
  color: white;
}

.login-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.login-header .login-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.9;
}

.login-header .login-link:hover {
  opacity: 1;
}

.login-page {
  background: #eef2f7;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.login-card {
  background: white;
  border-radius: var(--radius);
  padding: 48px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  text-align: center;
}

.login-card h2 {
  font-size: 22px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.login-card .login-subtitle {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 32px;
}

.login-input-group {
  display: flex;
  align-items: stretch;
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: var(--transition);
}

.login-input-group:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.login-input-icon {
  width: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border-right: 1px solid var(--border);
  color: var(--text-light);
  font-size: 18px;
}

.login-input {
  flex: 1;
  padding: 12px 16px;
  border: none;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.login-input::placeholder {
  color: #94a3b8;
}

.login-btn-orange {
  width: 100%;
  padding: 14px;
  background: #f59e0b;
  color: white;
  font-size: 16px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  margin-top: 8px;
}

.login-btn-orange:hover {
  background: #d97706;
}

.login-forgot {
  display: block;
  margin-top: 20px;
  color: #f59e0b;
  font-size: 14px;
  font-weight: 500;
}

.login-forgot:hover {
  color: #d97706;
  text-decoration: underline;
}

/* ============================================================
   DASHBOARD LANG SELECTOR IN TOPBAR
   ============================================================ */
.topbar-lang {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
}

.topbar-lang:hover {
  border-color: var(--accent);
}

.topbar-lang .flag {
  font-size: 16px;
}

.topbar-lang .arrow {
  font-size: 10px;
  color: var(--text-light);
}

/* Responsive */
@media (max-width: 768px) {
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .kyc-form-container {
    margin: 24px;
  }
  .global-header-inner {
    padding: 12px 16px;
  }
  .global-header-right {
    gap: 8px;
  }
  .lang-btn .lang-label,
  .lang-btn .lang-name {
    display: none;
  }
}
