/* =============================================
   BASE
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: "Avenir Next", "Avenir", Helvetica, Arial, sans-serif;
  background: #fff;
  color: #111;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* =============================================
   PAGE CONTAINER — max 480px, centered
   ============================================= */
.login-page {
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 28px 40px;
  display: flex;
  flex-direction: column;
  background: #fff;
  position: relative;
}

/* =============================================
   BACK BUTTON
   ============================================= */
.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-top: 16px;
  margin-left: -6px;
  border-radius: 50%;
  color: #0aa3e5;
  transition: background 0.15s;
}
.back-btn:hover { background: rgba(10,163,229,0.08); }
.back-btn svg { width: 24px; height: 24px; }

/* =============================================
   TITLE
   ============================================= */
.login-title {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.3px;
  text-align: center;
  color: #111;
  margin-top: 28px;
  margin-bottom: 36px;
}

/* =============================================
   FORM
   ============================================= */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

/* Field group */
.field-group {
  margin-bottom: 24px;
}

.field-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #888;
  margin-bottom: 6px;
  line-height: 1.4;
}

.field-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1.5px solid #ccc;
  transition: border-color 0.2s;
}
.field-wrap:focus-within {
  border-bottom-color: #111;
}

.field-input {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 400;
  color: #111;
  padding: 8px 0;
  line-height: 1.4;
  caret-color: #111;
}
.field-input::placeholder { color: transparent; }

/* Eye toggle */
.eye-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #999;
  display: flex;
  align-items: center;
  transition: color 0.2s;
  flex-shrink: 0;
}
.eye-btn:hover { color: #555; }
.eye-btn svg { width: 20px; height: 20px; }

/* Forgot password */
.forgot-link {
  display: block;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: #0aa3e5;
  margin-top: 8px;
  margin-bottom: 0;
  transition: opacity 0.15s;
}
.forgot-link:hover { opacity: 0.75; }

/* Spacer pushes buttons to bottom */
.form-spacer { flex: 1; min-height: 40px; }

/* =============================================
   CONNEXION BUTTON
   ============================================= */
.connexion-btn {
  width: 100%;
  padding: 16px;
  border-radius: 100px;
  border: none;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  margin-bottom: 16px;
  letter-spacing: 0.1px;

  /* Default disabled state */
  background: #d0d0d0;
  color: #fff;
}
.connexion-btn:not(:disabled) {
  background: #2bc5f4;
  color: #fff;
  cursor: pointer;
}
.connexion-btn:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(43,197,244,0.4);
}
.connexion-btn:not(:disabled):active { transform: scale(0.98); }
.connexion-btn:disabled { cursor: default; }

/* =============================================
   OR DIVIDER
   ============================================= */
.or-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.or-line {
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}
.or-text {
  font-size: 13px;
  font-weight: 600;
  color: #999;
  letter-spacing: 0.5px;
}

/* =============================================
   SOCIAL BUTTONS
   ============================================= */
.social-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 15px 20px;
  border-radius: 100px;
  border: none;
  background: #000;
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
  transition: background 0.2s, transform 0.15s;
  letter-spacing: 0.1px;
}
.social-btn:hover { background: #222; transform: translateY(-1px); }
.social-btn:active { transform: scale(0.98); }

.social-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* =============================================
   REMEMBER CHECKBOX
   ============================================= */
.remember-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 4px;
  cursor: pointer;
}

.remember-check {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.remember-custom-check {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  border: 1.5px solid #0aa3e5;
  border-radius: 3px;
  background: #0aa3e5;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  transition: background 0.15s;
}
.remember-check:not(:checked) ~ .remember-custom-check {
  background: #fff;
}
.remember-custom-check svg { width: 12px; height: 12px; }

.remember-text {
  font-size: 13px;
  color: #666;
  line-height: 1.4;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 380px) {
  .login-page { padding: 0 20px 32px; }
  .login-title { font-size: 24px; }
  .social-btn { font-size: 15px; }
}

/* =============================================
   WRONG CREDENTIALS ERROR
   ============================================= */

/* Shake animation for fields */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}
.shake { animation: shake 0.45s ease; }

.creds-error {
  display: none;
  align-items: flex-start;
  gap: 8px;
  background: #fff2f2;
  border: 1px solid #ffcccc;
  border-radius: 10px;
  padding: 11px 13px;
  margin-bottom: 6px;
  font-size: 13px;
  color: #d0021b;
  font-weight: 500;
  line-height: 1.45;
  animation: shakeIn 0.35s ease;
}
.creds-error.visible { display: flex; }
.creds-error svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin-top: 1px;
  stroke: #d0021b;
}

/* =============================================
   SOCIAL LOGIN ERROR MESSAGE
   ============================================= */
.social-error {
  display: none;
  align-items: flex-start;
  gap: 8px;
  background: #fff2f2;
  border: 1px solid #ffcccc;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: -4px;
  margin-bottom: 4px;
  font-size: 13px;
  color: #d0021b;
  font-weight: 500;
  line-height: 1.45;
  animation: shakeIn 0.35s ease;
}
.social-error.visible {
  display: flex;
}
.social-error svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  stroke: #d0021b;
}

@keyframes shakeIn {
  0%   { opacity: 0; transform: translateY(-6px); }
  60%  { opacity: 1; transform: translateY(2px); }
  100% { transform: translateY(0); }
}
