/* user.css - Panel utilisateur */

.user-page {
  min-height: calc(100vh - 200px);
  padding: var(--space-10) 0;
}

/* Bannière de vérification */
.verification-banner {
  background: rgba(255, 200, 87, 0.15);
  border: 1px solid rgba(255, 200, 87, 0.3);
  border-radius: var(--radius);
  padding: var(--space-6);
  margin-bottom: var(--space-8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-6);
  animation: slideDown var(--speed-2) ease;
}

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

.verification-banner__content {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex: 1;
}

.verification-banner__content i {
  font-size: 2rem;
  color: var(--warn);
  flex-shrink: 0;
}

.verification-banner__content strong {
  display: block;
  color: var(--warn);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.verification-banner__content p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.btn-resend {
  padding: 10px 20px;
  background: rgba(255, 200, 87, 0.2);
  border: 1px solid rgba(255, 200, 87, 0.4);
  color: var(--warn);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--speed-1);
  white-space: nowrap;
}

.btn-resend:hover {
  background: rgba(255, 200, 87, 0.3);
  transform: translateY(-2px);
}

/* Header */
.user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-8);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: var(--space-8);
  box-shadow: var(--shadow);
}

.user-header__left {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.user-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #2ee1b5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #05332a;
  flex-shrink: 0;
}

.user-info h1 {
  font: 700 1.8rem/1.2 "Poppins", sans-serif;
  margin: 0 0 0.5rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  color: #1d9bf0;
  font-size: 1.5rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.user-info p {
  color: var(--muted);
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
}

.user-badge {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(0, 226, 166, 0.15);
  border: 1px solid rgba(0, 226, 166, 0.3);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand);
  text-transform: capitalize;
}

.btn-logout {
  padding: 10px 20px;
  background: rgba(255, 92, 98, 0.1);
  border: 1px solid rgba(255, 92, 98, 0.3);
  color: var(--danger);
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--speed-1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-logout:hover {
  background: rgba(255, 92, 98, 0.2);
  transform: translateY(-2px);
}

/* Grid */
.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--space-6);
}

/* Cards */
.user-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-6);
  box-shadow: var(--shadow);
  transition: all var(--speed-1);
}

.user-card:hover {
  border-color: rgba(0, 226, 166, 0.2);
}

.user-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
}

.user-card h2 {
  font: 600 1.2rem/1.3 "Poppins", sans-serif;
  margin: 0;
  color: var(--text);
}

.btn-edit {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--speed-1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-edit:hover {
  background: rgba(0, 226, 166, 0.1);
  border-color: var(--brand);
  color: var(--brand);
}

/* Form */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

.form-field {
  margin-bottom: var(--space-4);
}

.form-field label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-field input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  transition: all var(--speed-1);
}

.form-field input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-field input:not(:disabled):focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(0, 226, 166, 0.1);
}

.form-field small {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}

.btn-change-password {
  width: 100%;
  padding: 12px 16px;
  background: rgba(0, 226, 166, 0.1);
  border: 1px solid rgba(0, 226, 166, 0.3);
  color: var(--brand);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--speed-1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-change-password:hover {
  background: rgba(0, 226, 166, 0.2);
  transform: translateY(-2px);
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--line);
}

.btn-cancel,
.btn-save {
  flex: 1;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--speed-1);
}

.btn-cancel {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  border: 1px solid var(--line);
}

.btn-cancel:hover {
  background: rgba(255, 255, 255, 0.08);
}

.btn-save {
  background: linear-gradient(180deg, var(--brand), #2ee1b5);
  color: #05332a;
  position: relative;
  overflow: hidden;
}

.btn-save:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 226, 166, 0.3);
}

.btn-save.loading {
  pointer-events: none;
  opacity: 0.7;
}

.btn-save.loading .btn-save__text {
  opacity: 0;
}

.btn-save__loader {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border: 2px solid rgba(5, 51, 42, 0.3);
  border-top-color: #05332a;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.btn-save.loading .btn-save__loader {
  display: block;
}

@keyframes spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Stats */
.stats {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.stat {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: all var(--speed-1);
}

.stat:hover {
  border-color: rgba(0, 226, 166, 0.3);
  transform: translateX(4px);
}

.stat i {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(0, 226, 166, 0.15), rgba(46, 225, 181, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--brand);
  flex-shrink: 0;
}

.stat div {
  display: flex;
  flex-direction: column;
}

.stat__value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

.stat__label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* Quick Actions */
.quick-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.quick-action {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--speed-1);
}

.quick-action:hover {
  border-color: var(--brand);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 226, 166, 0.15);
}

.quick-action i {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, rgba(0, 226, 166, 0.15), rgba(46, 225, 181, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--brand);
  flex-shrink: 0;
}

.quick-action div {
  display: flex;
  flex-direction: column;
}

.quick-action span {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.quick-action small {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* Alert */
.alert {
  margin-top: var(--space-4);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  display: none;
}

.alert.show {
  display: block;
  animation: fadeIn var(--speed-2) ease;
}

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

.alert.error {
  background: rgba(255, 92, 98, 0.15);
  border: 1px solid rgba(255, 92, 98, 0.3);
  color: var(--danger);
}

.alert.success {
  background: rgba(110, 231, 168, 0.15);
  border: 1px solid rgba(110, 231, 168, 0.3);
  color: var(--ok);
}

/* Responsive */
@media (max-width: 768px) {
  .user-header {
    flex-direction: column;
    text-align: center;
    gap: var(--space-4);
  }

  .user-header__left {
    flex-direction: column;
  }

  .btn-logout {
    width: 100%;
    justify-content: center;
  }

  .user-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

/* Modal custom */
.modal-content {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
}

.modal-header {
  border-bottom: 1px solid var(--line);
  padding: var(--space-6);
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--text);
}

.modal-body {
  padding: var(--space-6);
}

.modal-body p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.modal-footer {
  border-top: 1px solid var(--line);
  padding: var(--space-6);
  gap: var(--space-3);
}

.btn-close {
  filter: invert(1);
  opacity: 0.6;
}

.btn-close:hover {
  opacity: 1;
}

.btn-secondary {
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--speed-1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
  padding: 10px 20px;
  background: linear-gradient(180deg, var(--danger), #ff3d44);
  border: none;
  color: white;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--speed-1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(255, 92, 98, 0.4);
}

.btn-primary {
  padding: 10px 20px;
  background: linear-gradient(180deg, var(--brand), #2ee1b5);
  border: none;
  color: #05332a;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--speed-1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 226, 166, 0.4);
}

.btn-success {
  padding: 10px 20px;
  background: linear-gradient(180deg, var(--ok), #4ee18c);
  border: none;
  color: #05332a;
  border-radius: var(--radius-sm);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.email-highlight {
  padding: var(--space-3);
  background: rgba(0, 226, 166, 0.1);
  border: 1px solid rgba(0, 226, 166, 0.3);
  border-radius: var(--radius-sm);
  color: var(--brand);
  font-weight: 600;
  text-align: center;
  margin: var(--space-4) 0;
}

.text-muted {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: var(--space-3);
}

.spinner-border {
  width: 1rem;
  height: 1rem;
  border-width: 2px;
}

/* ============================================
   SECTION DEMANDES CVE
   ============================================ */
.demandes-section {
  margin-top: 3rem;
  scroll-margin-top: 100px;
}

/* Header */
.demandes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.75rem;
}

.demandes-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
}

.demandes-header h2 i {
  color: var(--brand);
  font-size: 1.15rem;
}

.btn-new-demande {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  background: var(--brand);
  color: #fff;
  border-radius: 8px;
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.2px;
  transition: opacity 0.15s;
}

.btn-new-demande:hover { opacity: 0.82; color: #fff; }

/* Loading */
.demandes-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--muted);
  padding: 2.5rem 0;
  font-size: 0.9rem;
}

/* Vide */
.demandes-empty {
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 4rem 0;
  color: var(--muted);
  text-align: center;
}

.demandes-empty i    { font-size: 2.8rem; opacity: 0.25; }
.demandes-empty p    { margin: 0; font-size: 0.9rem; }

/* Liste */
.demandes-list {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* ── Card demande ── */
.demande-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  padding: 1.5rem 1.75rem;
  min-height: 90px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
  align-items: center;
  margin-bottom: 0;
  position: relative;
  margin-top: 10px;
}

.demande-card:hover {
  border-color: var(--brand);
  box-shadow: 0 4px 20px rgba(0, 226, 166, 0.07);
}

/* Gauche */
.demande-card__left {
  display: contents;
}

/* Icône */
.demande-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(0, 226, 166, 0.09);
  border: 1px solid rgba(0, 226, 166, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Infos texte */
.demande-card__info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  overflow: hidden;
}

.demande-card__top {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.demande-card__numero {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  letter-spacing: 0.4px;
}

.demande-card__bottom {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  flex-wrap: wrap;
}

.demande-card__sep {
  opacity: 0.3;
  font-size: 0.7rem;
}

/* Badges formule */
.badge-formule {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.badge-essential { background: rgba(100,100,255,0.12); color: #7878ff; }
.badge-optimal   { background: rgba(0,226,166,0.12);   color: var(--brand); }
.badge-signature { background: rgba(255,170,0,0.12);   color: #ffaa00; }
.badge-prestige  { background: rgba(200,130,255,0.12); color: #c882ff; }
.badge-horizon   { background: rgba(255,80,80,0.12);   color: #ff6060; }

/* Bouton justificatif */
.demande-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.2rem;
  background: rgba(0, 226, 166, 0.07);
  border: 1px solid rgba(0, 226, 166, 0.22);
  border-radius: 9px;
  color: var(--brand);
  font-size: 0.83rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.demande-card__btn i { font-size: 1rem; }

.demande-card__btn:hover {
  background: rgba(0, 226, 166, 0.14);
  border-color: var(--brand);
  color: var(--brand);
}

/* Mobile */
@media (max-width: 640px) {
  .demande-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.1rem;
    padding: 1.2rem;
  }
  .demande-card__btn {
    width: 100%;
    justify-content: center;
    padding: 0.7rem;
  }
  .demandes-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  .btn-new-demande { width: 100%; justify-content: center; }
}

/* Badges statut demande */
.badge-statut {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.badge-statut i { font-size: 0.72rem; }

.badge-attente  {
  background: rgba(255, 170, 0, 0.1);
  color: #ffaa00;
  border: 1px solid rgba(255, 170, 0, 0.2);
}

.badge-transfere {
  background: rgba(0, 226, 166, 0.1);
  color: var(--brand);
  border: 1px solid rgba(0, 226, 166, 0.2);
}