:root {
  --cgos-primary-color: #18ace6;
  --cgos-seconday-color: #138AB9;
}

.cgosauth-login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: 3rem 1rem;
}

.cgosauth-login-card {
  width: 100%;
  max-width: 500px;
  background: #ffffff;
  border-radius: 1rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  border: 1px solid #f1f5f9;
  position: relative;
}

.cgosauth-login-card__decorative-line {
  height: 50px;
  width: 100%;
  background: linear-gradient(to right, var(--cgos-primary-color), #06b6d4);
}

.cgosauth-login-card__content {
  padding: 2.5rem;
}

.cgosauth-login-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.cgosauth-login-header__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #eff6ff;
  color: var(--cgos-primary-color);
  margin-bottom: 1rem;
  box-shadow: 0 0 0 8px rgba(59, 130, 246, 0.05);
}

/* .cgosauth-login-header__icon::before {
  font-family: "Font Awesome 7 Free";
  font-weight: 900;
  content: "\f023";
  font-size: 1.5rem;
} */

.cgosauth-login-header__title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #0f172a;
  margin: 0 0 0.5rem 0;
  letter-spacing: -0.025em;
}

.cgosauth-login-header__subtitle {
  font-size: 1rem;
  color: #64748b;
  margin: 0;
}

.cgosauth-form-group {
  margin-bottom: 2rem;
}

.cgosauth-form-label {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #334155;
  margin-bottom: 0.5rem;
}

.cgosauth-input-wrapper {
  position: relative;
}

.cgosauth-input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

/* .cgosauth-input-icon::before {
  font-family: "Font Awesome 7 Free";
  font-weight: 900;
  content: "\f007";
  font-size: 1.25rem;
} */

.cgosauth-input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 2.75rem;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  font-size: 1rem;
  color: #0f172a;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.cgosauth-input::placeholder {
  color: #cbd5e1;
}

.cgosauth-input:focus {
  outline: none;
  border-color: var(--cgos-primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background-color: #ffffff;
}

.cgosauth-input-hint {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #94a3b8;
}

/* .cgosauth-input-hint::before {
  font-family: "Font Awesome 7 Free";
  font-weight: 900;
  content: "\f05a";
  font-size: 0.875rem;
} */

.cgosauth-pincode-group {
  margin-bottom: 2rem;
}

.cgosauth-pincode-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.cgosauth-pincode-badge {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--cgos-primary-color);
  background-color: #eff6ff;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
}

.cgosauth-pincode__display {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  max-width: 360px;
}

.cgosauth-pincode__digit {
  text-align: center;
  height: 34px;
  line-height: normal;
  font-size: 1rem;
  font-weight: 600;
  background-color: #ffffff;
  border: 1px solid #D9D9D9;
  pointer-events: none;
  /* color: var(--cgos-seconday-color); */
  transition: all 0.15s ease;
}

.cgosauth-pincode__digit:focus {
  /* border-color: var(--cgos-primary-color); */
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.cgosauth-pincode__numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 360px;
  /* max-width: 280px; */
  padding-top: 0.5rem;
}

.cgosauth-pincode__numpad-btn {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #DCDCDC;
  font-size: 1rem;
  font-weight: 500;
  color: #383838;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  /* margin: 0 auto; */
}

/* 1ère colonne (1, 4, 7...) : Alignée à Droite */
.cgosauth-pincode__numpad-btn:nth-child(3n + 1) {
  justify-self: end; 
  /* ou 'right' */
}

/* 2ème colonne (2, 5, 8...) : Alignée au Centre */
.cgosauth-pincode__numpad-btn:nth-child(3n + 2) {
  justify-self: center;
}

/* 3ème colonne (3, 6, 9...) : Alignée à Gauche */
.cgosauth-pincode__numpad-btn:nth-child(3n) {
  justify-self: start; 
  /* ou 'left' */
}

.cgosauth-pincode__numpad-btn:hover {
  background-color: #666666;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  color: #FFF;
  transform: scale(1.02);
}

.cgosauth-pincode__numpad-btn:active {
  transform: scale(0.95);
}

.cgosauth-pincode__numpad-btn--empty {
  visibility: hidden;
  pointer-events: none;
}

.cgosauth-pincode__numpad-btn--backspace {
  background-color: #fef2f2;
  color: #ef4444;
}

.cgosauth-pincode__numpad-btn--backspace:hover {
  background-color: #fee2e2;
  color: #ef4444;
  box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.2), 0 2px 4px -1px rgba(239, 68, 68, 0.1);
  transform: scale(1.05);
}

.cgosauth-actions {
  margin-top: 1.5rem;
}

.cgosauth-submit-btn {
  width: 100%;
  background-color: var(--cgos-primary-color);
  color: #ffffff;
  font-size: 1.125rem;
  font-weight: 500;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(0, 43, 73, 0.1), 0 4px 6px -2px rgba(0, 43, 73, 0.05);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.cgosauth-submit-btn:hover {
  background-color: var(--cgos-seconday-color);
  transform: scale(1.01);
}

.cgosauth-submit-btn:active {
  transform: scale(0.99);
}

/* .cgosauth-submit-btn::after {
  font-family: "Font Awesome 7 Free";
  font-weight: 900;
  content: "\f061";
  opacity: 0.8;
  font-size: 1.25rem;
} */

.cgosauth-help {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

.cgosauth-help-link {
  font-size: 1rem;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  transition: color 0.15s ease;
}

.cgosauth-help-link:hover {
  color: var(--cgos-primary-color);
}

/* ========================================
   Security Badge
   ======================================== */

.cgosauth-security-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 1rem;
  margin-top: 1rem;
  border-top: 1px solid #f1f5f9;
}

.cgosauth-security-badge__content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: #15803d;
  background-color: #f0fdf4;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid #bbf7d0;
}

.cgosauth-security-badge__content i {
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 640px) {
  .cgosauth-login-card__content {
    padding: 2rem 1.5rem;
  }

  .cgosauth-login-header__title {
    font-size: 1.25rem;
  }

  .cgosauth-login-header__subtitle {
    font-size: 0.875rem;
  }

  .cgosauth-pincode__numpad {
    gap: 0.75rem;
    max-width: 240px;
  }

  .cgosauth-pincode__digit {
    height: 3rem;
    font-size: 1.25rem;
  }
}

/* ========================================
   Error Messages
   ======================================== */

.cgosauth-form-errors {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 0.75rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.cgosauth-form-errors ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cgosauth-form-errors li {
  color: #dc2626;
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.cgosauth-form-errors li:last-child {
  margin-bottom: 0;
}

/* ========================================
   Override default PrestaShop styles
   ======================================== */

#login-form .form-group.row {
  margin-bottom: 0;
}

#login-form .form-control-label {
  padding: 0;
}

#login-form .col-md-3,
#login-form .col-md-6 {
  padding: 0;
  max-width: 100%;
  flex: 0 0 100%;
}

#login-form .form-footer {
  /* margin-top: 0;
  padding: 0; */
}
