/* ==========================================
   NEXUS LOGIN PAGE - RESPONSIVE CSS
   ========================================== */

/* ==========================================
   1. BASE & BODY
   ========================================== */

body.home {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #152a52 0%, #1a2332 50%, #0f1419 100%);
  color: #e6eef6;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* ==========================================
   2. CONTAINER & LAYOUT
   ========================================== */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.vh-fix {
  min-height: 100vh;
}

.d-flex {
  display: flex;
}

.align-items-lg-center {
  align-items: center;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -15px;
}

.justify-content-center {
  justify-content: center;
}

.w-100 {
  width: 100%;
}

.col-12 {
  flex: 0 0 100%;
  max-width: 100%;
  padding: 0 15px;
}

@media (min-width: 576px) {
  .col-sm-10 {
    flex: 0 0 83.333333%;
    max-width: 83.333333%;
  }
}

@media (min-width: 992px) {
  .col-lg-5 {
    flex: 0 0 41.666667%;
    max-width: 41.666667%;
  }
  
  .col-lg-6 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* ==========================================
   3. LOGO SECTION
   ========================================== */

.logo-section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
  position: relative;
}

.logo-section.border-right {
  border-right: 2px solid rgba(91, 163, 197, 0.2);
}

.logo {
  max-width: 180px;
  height: auto;
  margin-bottom: 24px;
  filter: drop-shadow(0 8px 16px rgba(91, 163, 197, 0.3));
  animation: float 3s ease-in-out infinite;
}

.logo-text {
  max-width: 200px;
  height: auto;
  opacity: 0.9;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ==========================================
   4. FORM SECTION
   ========================================== */

.form-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

form {
  width: 100%;
  max-width: 450px;
  background: rgba(255, 255, 255, 0.95) !important;
  border-radius: 16px;
  padding: 40px !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

form h4 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 32px;
  text-align: center;
}

.blue-text {
  color: #1e3c72 !important;
}

/* ==========================================
   5. FORM ELEMENTS
   ========================================== */

.mb-3 {
  margin-bottom: 24px;
}

.mb-4 {
  margin-bottom: 32px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.3px;
}

.input-group {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  width: 100%;
}

.input-group-text {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  color: #5ba3c5;
  text-align: center;
  white-space: nowrap;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-right: none;
  border-radius: 8px 0 0 8px;
}

.form-control {
  display: block;
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: #1e3c72;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #dee2e6;
  border-radius: 0 8px 8px 0;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  color: #1e3c72;
  background-color: #fff;
  border-color: #5ba3c5;
  outline: 0;
  box-shadow: 0 0 0 3px rgba(91, 163, 197, 0.25);
}

.form-control::placeholder {
  color: #9aa0a6;
  opacity: 1;
}

/* ==========================================
   6. BUTTON
   ========================================== */

.d-grid {
  display: grid;
}

.btn {
  display: inline-block;
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  padding: 14px 24px;
  font-size: 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #5ba3c5 0%, #2a5298 100%);
  border-color: #5ba3c5;
  box-shadow: 0 4px 12px rgba(91, 163, 197, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #4a92b4 0%, #1e3c72 100%);
  border-color: #4a92b4;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(91, 163, 197, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(91, 163, 197, 0.3);
}

.btn i {
  margin-right: 8px;
}

/* ==========================================
   7. ANIMATIONS
   ========================================== */

.slide-in {
  animation: slideInLeft 0.6s ease-out;
}

.fade-in {
  animation: fadeIn 0.8s ease-out 0.3s both;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================
   8. UTILITIES
   ========================================== */

.text-center {
  text-align: center;
}

.me-1 {
  margin-right: 4px;
}

.me-2 {
  margin-right: 8px;
}

.p-4 {
  padding: 40px !important;
}

.rounded {
  border-radius: 16px !important;
}

.shadow-sm {
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
}

.bg-white {
  background-color: rgba(255, 255, 255, 0.95) !important;
}

/* ==========================================
   9. ICONS (Bootstrap Icons)
   ========================================== */

.bi {
  display: inline-block;
  vertical-align: middle;
}

.bi-person-lock:before {
  content: "🔐";
}

.bi-envelope-fill:before {
  content: "✉️";
}

.bi-lock-fill:before {
  content: "🔒";
}

.bi-box-arrow-in-right:before {
  content: "➡️";
}

/* ==========================================
   10. RESPONSIVE DESIGN
   ========================================== */

/* Tablettes et petits écrans (max-width: 1200px) */
@media (max-width: 1200px) {
  .container {
    max-width: 960px;
  }
}

/* Tablets portrait (max-width: 991px) */
@media (max-width: 991px) {
  .logo-section.border-right {
    border-right: none;
    border-bottom: 2px solid rgba(91, 163, 197, 0.2);
    padding-bottom: 40px;
    margin-bottom: 20px;
  }
  
  .form-section {
    padding-top: 20px;
  }
  
  .row {
    flex-direction: column;
  }
  
  .col-lg-5,
  .col-lg-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Mobile paysage et petites tablettes (max-width: 768px) */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }
  
  .logo {
    max-width: 140px;
  }
  
  .logo-text {
    max-width: 160px;
  }
  
  .logo-section {
    padding: 30px 15px;
  }
  
  .form-section {
    padding: 30px 15px;
  }
  
  form {
    padding: 32px 24px !important;
    max-width: 100%;
  }
  
  form h4 {
    font-size: 20px;
    margin-bottom: 24px;
  }
  
  .mb-3 {
    margin-bottom: 20px;
  }
  
  .mb-4 {
    margin-bottom: 24px;
  }
}

/* Mobile portrait (max-width: 576px) */
@media (max-width: 576px) {
  .container {
    padding: 0 10px;
  }
  
  .logo {
    max-width: 120px;
    margin-bottom: 20px;
  }
  
  .logo-text {
    max-width: 140px;
  }
  
  .logo-section {
    padding: 20px 10px;
  }
  
  .logo-section.border-right {
    padding-bottom: 30px;
    margin-bottom: 15px;
  }
  
  .form-section {
    padding: 20px 10px;
  }
  
  form {
    padding: 24px 20px !important;
    border-radius: 12px;
  }
  
  form h4 {
    font-size: 18px;
    margin-bottom: 20px;
  }
  
  .form-label {
    font-size: 13px;
    margin-bottom: 6px;
  }
  
  .input-group-text {
    padding: 10px 12px;
    font-size: 14px;
  }
  
  .form-control {
    padding: 10px 12px;
    font-size: 14px;
  }
  
  .btn-primary {
    padding: 12px 20px;
    font-size: 14px;
  }
  
  .mb-3 {
    margin-bottom: 16px;
  }
  
  .mb-4 {
    margin-bottom: 20px;
  }
}

/* Très petits mobiles (max-width: 400px) */
@media (max-width: 400px) {
  .logo {
    max-width: 100px;
    margin-bottom: 16px;
  }
  
  .logo-text {
    max-width: 120px;
  }
  
  form {
    padding: 20px 16px !important;
  }
  
  form h4 {
    font-size: 16px;
    margin-bottom: 16px;
  }
  
  .input-group-text {
    padding: 8px 10px;
    font-size: 13px;
  }
  
  .form-control {
    padding: 8px 10px;
    font-size: 13px;
  }
  
  .btn-primary {
    padding: 10px 16px;
    font-size: 13px;
    letter-spacing: 0.3px;
  }
}

/* Landscape mobile adjustments */
@media (max-height: 600px) and (orientation: landscape) {
  .vh-fix {
    min-height: auto;
  }
  
  .logo-section {
    padding: 20px 15px;
  }
  
  .logo {
    max-width: 100px;
    margin-bottom: 12px;
  }
  
  .logo-text {
    max-width: 120px;
  }
  
  .form-section {
    padding: 20px 15px;
  }
  
  form {
    padding: 20px !important;
  }
  
  form h4 {
    font-size: 18px;
    margin-bottom: 16px;
  }
  
  .mb-3 {
    margin-bottom: 12px;
  }
  
  .mb-4 {
    margin-bottom: 16px;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .logo,
  .logo-text {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn-primary {
    padding: 16px 24px;
    font-size: 16px;
  }
  
  .form-control {
    padding: 14px 16px;
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .input-group-text {
    padding: 14px 16px;
  }
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .logo {
    animation: none;
  }
  
  .slide-in,
  .fade-in {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
  /* Already using dark theme, no changes needed */
}

/* Print styles */
@media print {
  body.home {
    background: white;
    color: black;
  }
  
  .logo-section,
  .logo,
  .logo-text {
    display: none;
  }
  
  form {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .btn-primary {
    display: none;
  }
}