/**
 * Style Modern Premium pour le formulaire VoIP SNDI
 * Design: Glassmorphism, Modern UI, Responsive Fixes
 */

/* ==================== VARIABLES ==================== */
:root {
  /* Palette SNDI Modernisée */
  --primary: #FF9900;
  /* Orange SNDI */
  --primary-dark: #E68A00;
  --primary-light: #FFB84D;
  --primary-gradient: linear-gradient(135deg, #FF9900 0%, #FF7700 100%);

  --secondary: #009B4D;
  /* Vert SNDI */
  --accent: #0066CC;
  /* Bleu SNDI */

  /* Neutres & Surfaces */
  --bg-body: #F4F7F6;
  --bg-card: #FFFFFF;
  --text-main: #2D3748;
  --text-muted: #718096;
  --border-light: #E2E8F0;

  /* Ombres Premium */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.02);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.95);
  --glass-border: 1px solid rgba(255, 255, 255, 0.2);

  /* Transitions */
  --ease-out: cubic-bezier(0.215, 0.61, 0.355, 1);
}

/* ==================== RESET & BASE ==================== */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ==================== HEADER PREMIUM ==================== */
header.header-logos {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1.5rem 0;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 100;
}

.header-logos .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-logos img {
  height: 70px;
  width: auto;
  transition: transform 0.3s var(--ease-out);
}

.header-logos img:hover {
  transform: scale(1.05);
}

.header-title-block {
  text-align: center;
}

.header-title-block h2 {
  color: var(--primary-dark);
  font-size: 1.5rem;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-title-block h3 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0.25rem 0 0.5rem;
}

.header-title-block h4 {
  font-size: 1.1rem;
  color: var(--secondary);
  margin: 0;
}

/* ==================== NAVBAR MODERN ==================== */
.navbar {
  background: var(--primary-gradient) !important;
  box-shadow: var(--shadow-md);
  padding: 0.75rem 0;
}

.navbar-brand {
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

/* Fix Mobile Logout Visibility */
.navbar-toggler {
  border: 2px solid rgba(255, 255, 255, 0.5);
  padding: 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

/* Mobile Logout Button Specifics */
@media (max-width: 991px) {
  .btn-logout-mobile {
    background-color: rgba(255, 255, 255, 0.9);
    color: var(--primary-dark) !important;
    /* Force orange text for contrast */
    border: 1px solid white;
    font-weight: 600;
    margin-right: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }

  .btn-logout-mobile:hover {
    background-color: white;
    color: var(--primary) !important;
  }
}

/* ==================== CARDS & FORMS ==================== */
.card {
  background: var(--bg-card);
  border: none;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

/*
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
*/

.card-body {
  padding: 2.5rem;
}

.section-title {
  font-size: 1.25rem;
  color: var(--primary-dark);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--border-light);
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 24px;
  background: var(--primary-gradient);
  margin-right: 0.75rem;
  border-radius: 4px;
}

/* Champs de formulaire modernes */
.form-label {
  font-weight: 600;
  color: var(--text-main);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.form-control,
.form-select {
  border: 2px solid var(--border-light);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.2s ease;
  background-color: #FAFAFA;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--primary);
  background-color: white;
  box-shadow: 0 0 0 4px rgba(255, 153, 0, 0.1);
  outline: none;
}

.required::after {
  content: " *";
  color: #E53E3E;
}

/* Equipment Items Styled */
.equipment-item {
  background: #FFF9F0;
  /* Très léger orange */
  border: 1px solid rgba(255, 153, 0, 0.15);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.equipment-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary-gradient);
}

.equipment-item h6 {
  color: var(--primary-dark);
  margin-bottom: 1.25rem;
  font-size: 1.1rem;
}

/* ==================== WIZARD STEPS REDESIGN ==================== */
.wizard-progress {
  display: flex;
  justify-content: space-between;
  margin-bottom: 3rem;
  position: relative;
  padding: 0 1rem;
}

.wizard-progress::before {
  content: '';
  position: absolute;
  top: 24px;
  left: 40px;
  right: 40px;
  height: 3px;
  background: var(--border-light);
  z-index: 0;
  border-radius: 3px;
}

/* Remplissage de la barre de progression */
.wizard-progress-fill {
  /* Cette classe serait contrôlée par JS pour animer la largeur */
  position: absolute;
  top: 24px;
  left: 40px;
  height: 3px;
  background: var(--primary);
  z-index: 0;
  transition: width 0.5s var(--ease-out);
}

.wizard-step {
  position: relative;
  z-index: 1;
  text-align: center;
  width: 100%;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.wizard-step:hover {
  opacity: 1;
}

.wizard-step.active,
.wizard-step.completed {
  opacity: 1;
}

.wizard-step-circle {
  width: 50px;
  height: 50px;
  background: var(--bg-card);
  border-radius: 50%;
  border: 3px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  /* Bouncy effect */
}

/* Active Step */
.wizard-step.active .wizard-step-circle {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: scale(1.15);
  box-shadow: 0 0 0 6px rgba(255, 153, 0, 0.15);
}

/* Completed Step */
.wizard-step.completed .wizard-step-circle {
  background: var(--secondary);
  border-color: var(--secondary);
  color: white;
}

.wizard-step-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.3s ease;
}

.wizard-step.active .wizard-step-label {
  color: var(--primary-dark);
}

/* ==================== BUTTONS ==================== */
.btn {
  border-radius: 10px;
  font-weight: 600;
  padding: 0.75rem 1.5rem;
  letter-spacing: 0.01em;
  transition: all 0.2s var(--ease-out);
}

.btn-primary {
  background: var(--primary-gradient);
  border: none;
  box-shadow: 0 4px 6px rgba(255, 153, 0, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #FF8800 0%, #FF6600 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(255, 153, 0, 0.35);
}

.btn-success {
  background: linear-gradient(135deg, var(--secondary) 0%, #007A3D 100%);
  border: none;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .header-logos .container {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .header-logos img {
    height: 60px;
  }

  .card-body {
    padding: 1.5rem;
  }

  /* Wizard Mobile Transform */
  .wizard-progress {
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 1rem;
    scrollbar-width: none;
    /* Firefox */
  }

  .wizard-progress::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
  }

  .wizard-step {
    min-width: 80px;
    /* Ensure click area */
    margin-right: 1rem;
  }

  .wizard-step-label {
    display: none;
    /* Hide labels on mobile to save space */
  }

  .wizard-step.active .wizard-step-label {
    display: block;
    /* Show only active label */
    position: absolute;
    width: 200px;
    left: 50%;
    transform: translateX(-50%);
    top: 60px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .wizard-progress::before {
    top: 25px;
    left: 0;
    right: 0;
    width: 200%;
    /* Make line longer for scroll */
  }

  .wizard-navigation {
    flex-direction: column-reverse;
    gap: 1rem;
  }

  .wizard-navigation .btn {
    width: 100%;
  }

  /* Indicators showing Step X/Y */
  .mobile-step-indicator {
    display: block;
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 700;
    color: var(--primary);
  }
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wizard-step-content.active {
  animation: fadeInUp 0.4s var(--ease-out);
}

/* Dropdown on Hover for Desktop */
@media (min-width: 992px) {
  .hover-dropdown:hover .dropdown-menu {
    display: block;
    margin-top: 0;
    animation: fadeInUp 0.2s ease-out;
  }
}

/* Dropdown Menu Styling */
.dropdown-menu {
  border: none;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 0.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
}

.dropdown-item {
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background-color: var(--primary-light);
  color: white;
}

.dropdown-item.text-danger:hover {
  background-color: #dc3545;
  color: white !important;
}