/**
 * Tikiya.Pro — Design system (app & marketing)
 * Dégradé indigo → violet → bleu, émeraude succès, cartes douces, glass léger
 */

:root {
  /* Dégradé principal (indigo → violet → bleu électrique) */
  --gradient-primary: linear-gradient(135deg, #312e81 0%, #5b21b6 50%, #2563eb 100%);
  --gradient-primary-soft: linear-gradient(135deg, rgba(55, 48, 163, 0.08) 0%, rgba(91, 33, 182, 0.08) 50%, rgba(37, 99, 235, 0.08) 100%);
  --gradient-brand: linear-gradient(135deg, #0f0f0f 0%, #1e3a5f 35%, #4c1d95 65%, #2563eb 100%);
  --accent-indigo: #4f46e5;
  --accent-violet: #6d28d9;
  --accent-blue: #2563eb;

  /* Succès (émeraude) */
  --emerald: #059669;
  --emerald-soft: rgba(5, 150, 105, 0.12);
  --emerald-hover: rgba(5, 150, 105, 0.18);

  /* Fonds et texte */
  --midnight-navy: #0f172a;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --text-primary: #0f172a;
  --text-muted: #64748b;
  --text-muted-light: #94a3b8;

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-dark-bg: rgba(15, 23, 42, 0.6);
  --glass-dark-border: rgba(255, 255, 255, 0.08);
  --glass-sidebar-bg: rgba(255, 255, 255, 0.85);
  --glass-sidebar-border: rgba(15, 23, 42, 0.06);

  /* Ombres (douces, pas lourdes) */
  --shadow-soft: 0 4px 24px rgba(15, 23, 42, 0.06);
  --shadow-card: 0 8px 32px rgba(15, 23, 42, 0.08);
  --shadow-card-hover: 0 12px 40px rgba(15, 23, 42, 0.12);
  --shadow-glow: 0 0 40px rgba(79, 70, 229, 0.15);

  /* Rayons */
  --radius: 16px;
  --radius-sm: 12px;
  --radius-lg: 24px;

  /* Layout app */
  --sidebar-width: 260px;

  /* Micro-interactions (point 8) */
  --tk-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --tk-duration: 0.25s;
  --tk-duration-fast: 0.15s;
  --tk-focus-ring: 0 0 0 3px rgba(79, 70, 229, 0.35);

  /* Touche marocaine (point 9) — accents discrets */
  --tk-terracotta: #c45c3e;
  --tk-terracotta-soft: rgba(196, 92, 62, 0.1);
  --tk-majorelle: #5a4fcf;
  --tk-mint-morocco: #2d8f7a;
}

* {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Cartes (fond clair, ombre douce, hover lift) --- */
.tk-card,
.card.tk-card {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  transition: transform var(--tk-duration) var(--tk-ease), box-shadow var(--tk-duration) var(--tk-ease);
}
.tk-card:hover,
.card.tk-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}
.tk-card:focus-within {
  box-shadow: var(--shadow-soft), var(--tk-focus-ring);
}
.tk-card .card-body {
  border-radius: var(--radius);
}

/* --- Glass léger (blur + transparence) --- */
.tk-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}
.tk-glass-dark {
  background: var(--glass-dark-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-dark-border);
  border-radius: var(--radius);
}

/* --- Boutons accent (dégradé) + micro-interactions --- */
.btn-tk-primary {
  background: var(--gradient-primary);
  color: #fff;
  border: none;
  font-weight: 600;
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3);
  transition: transform var(--tk-duration-fast) var(--tk-ease), box-shadow var(--tk-duration-fast) var(--tk-ease), opacity var(--tk-duration-fast);
}
.btn-tk-primary:hover {
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(79, 70, 229, 0.4);
}
.btn-tk-primary:focus-visible {
  outline: none;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.3), var(--tk-focus-ring);
}
.btn-tk-primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 12px rgba(79, 70, 229, 0.3);
}
.btn-tk-primary.is-loading {
  pointer-events: none;
  opacity: 0.85;
}
.btn-tk-primary.is-loading .btn-spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  margin-right: 0.5rem;
  vertical-align: -0.15em;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tk-spin 0.7s linear infinite;
}
@keyframes tk-spin {
  to { transform: rotate(360deg); }
}

/* --- Succès (émeraude) --- */
.btn-tk-success,
.text-tk-success { color: var(--emerald); }
.bg-tk-success-soft { background: var(--emerald-soft); }
.badge-tk-success {
  background: var(--emerald-soft);
  color: var(--emerald);
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
}

/* --- Touche marocaine (point 9) — motifs discrets --- */
/* Filigrane géométrique (losange) */
.tk-pattern-subtle {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 30L30 60L0 30L30 0z' fill='none' stroke='rgba(79,70,229,0.04)' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 60px 60px;
}
/* Motif zellige discret (étoile à 8 branches / rub el hizb) */
.tk-pattern-zellige {
  background-image: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 2l2 6 6 2-6 2-2 6-2-6-6-2 6-2 2-6z' fill='none' stroke='rgba(79,70,229,0.035)' stroke-width='0.4'/%3E%3Cpath d='M16 14l1 3 3 1-3 1-1 3-1-3-3-1 3-1 1-3z' fill='none' stroke='rgba(90,79,207,0.03)' stroke-width='0.3'/%3E%3C/svg%3E");
  background-size: 32px 32px;
}
.tk-divider-pattern {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(79, 70, 229, 0.15), transparent);
}
/* Bande décorative type cadre marocain (ligne + motif) */
.tk-band-morocco {
  height: 4px;
  background: linear-gradient(90deg, transparent 0%, var(--tk-terracotta-soft) 15%, rgba(90, 79, 207, 0.12) 50%, var(--tk-terracotta-soft) 85%, transparent 100%);
  border-radius: 2px;
}
/* Coin ornemental discret (petit carré type zellige) */
.tk-corner-morocco {
  position: relative;
}
.tk-corner-morocco::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, transparent 50%, var(--tk-terracotta-soft) 50%);
  border-radius: 0 4px 0 0;
  pointer-events: none;
}
/* Bandeau bas sidebar (app) — touche marocaine */
.tk-sidebar-morocco-footer {
  margin-top: auto;
  height: 20px;
  min-height: 20px;
  background: var(--tk-terracotta-soft);
  background-image: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M16 2l2 6 6 2-6 2-2 6-2-6-6-2 6-2 2-6z' fill='none' stroke='rgba(196,92,62,0.06)' stroke-width='0.4'/%3E%3C/svg%3E");
  background-size: 32px 32px;
  border-top: 1px solid rgba(196, 92, 62, 0.08);
}

/* --- Micro-interactions (point 8) : champs, liens, feedback --- */
.tk-form-control:focus,
.form-control:focus,
.form-select:focus {
  border-color: var(--accent-indigo);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
  transition: border-color var(--tk-duration-fast) var(--tk-ease), box-shadow var(--tk-duration-fast) var(--tk-ease);
}
a:not(.btn):focus-visible {
  outline: none;
  border-radius: 4px;
  box-shadow: var(--tk-focus-ring);
}
.btn:focus-visible {
  outline: none;
  box-shadow: var(--tk-focus-ring);
}
/* Entrée en douceur pour blocs (optionnel) */
.tk-fade-in {
  animation: tk-fade-in 0.4s var(--tk-ease) both;
}
@keyframes tk-fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Feedback succès rapide (flash ou toast) */
.tk-flash-success {
  animation: tk-flash-in 0.35s var(--tk-ease) both;
}
@keyframes tk-flash-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
