:root {
  --login-bg: linear-gradient(180deg, #f7fbf9 0%, #eef5f2 100%);
  --login-card-bg: rgba(255, 255, 255, 0.96);
  --login-border: #dbe5df;
  --login-text: #1f2933;
  --login-muted: #5f6c7b;
  --login-primary: #184f63;
  --login-primary-strong: #123d4d;
  --login-shadow: 0 24px 60px rgba(24, 79, 99, 0.12);
  --login-radius: 18px;
}

* {
  box-sizing: border-box;
}

body.login-page {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--login-text);
  background: var(--login-bg);
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.login-card {
  width: min(100%, 660px);
  padding: 32px;
  border: 1px solid var(--login-border);
  border-radius: var(--login-radius);
  background: var(--login-card-bg);
  box-shadow: var(--login-shadow);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
}

.login-brand img {
  display: block;
  width: min(100%, 480px);
  height: auto;
}

.login-brand .login-brand-logo {
  width: min(60%, 260px);
}

.login-heading {
  margin: 0 0 8px;
  font-size: 1.6rem;
  line-height: 1.15;
  text-align: center;
}

.login-subtitle {
  margin: 0 0 24px;
  color: var(--login-muted);
  text-align: center;
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-field {
  display: grid;
  gap: 8px;
}

.login-field label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--login-primary);
}

.login-field input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid #cfd9e2;
  border-radius: 12px;
  background: #fff;
  color: var(--login-text);
  font-size: 1rem;
}

.login-field input:focus {
  outline: none;
  border-color: #7aa6b4;
  box-shadow: 0 0 0 4px rgba(24, 79, 99, 0.12);
}

.login-submit {
  height: 50px;
  border: 0;
  border-radius: 12px;
  background: var(--login-primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 24px rgba(24, 79, 99, 0.18);
}

.login-submit:hover {
  background: var(--login-primary-strong);
}

.login-submit:active {
  transform: translateY(1px);
}

.login-submit:disabled {
  cursor: wait;
  opacity: 0.8;
}

.login-message {
  min-height: 22px;
  margin: 0;
  font-size: 0.95rem;
  text-align: center;
}

.login-message.is-error {
  color: #b42318;
}

.login-message.is-success {
  color: #166534;
}

.login-view {
  display: grid;
  gap: 16px;
}

/* Bouton "Se connecter avec Microsoft" */
.login-ms-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 50px;
  padding: 0 18px;
  border: 1px solid #cfd9e2;
  border-radius: 12px;
  background: #fff;
  color: #1f2933;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.login-ms-button:hover {
  border-color: #7aa6b4;
  box-shadow: 0 8px 20px rgba(24, 79, 99, 0.12);
}

.login-ms-button:active {
  transform: translateY(1px);
}

/* Logo Microsoft (4 carrés) */
.ms-logo {
  display: grid;
  grid-template-columns: repeat(2, 9px);
  grid-template-rows: repeat(2, 9px);
  gap: 2px;
}

.ms-square {
  display: block;
  width: 9px;
  height: 9px;
}

.ms-r { background: #f25022; }
.ms-g { background: #7fba00; }
.ms-b { background: #00a4ef; }
.ms-y { background: #ffb900; }

@media (max-width: 560px) {
  .login-card {
    padding: 24px 20px;
  }

  .login-heading {
    font-size: 1.35rem;
  }
}

/* Theme logo Topo Franco */
:root {
  --login-bg: linear-gradient(180deg, #f8fbf6 0%, #edf5f3 100%);
  --login-border: #d7e3de;
  --login-primary: #205870;
  --login-primary-strong: #173f50;
  --login-shadow: 0 24px 60px rgb(32 88 112 / .12);
}

.login-card {
  box-shadow: var(--login-shadow);
}

.login-field input:focus {
  border-color: #3f7280;
  box-shadow: 0 0 0 4px rgb(32 88 112 / .12);
}

.login-submit {
  box-shadow: 0 10px 24px rgb(32 88 112 / .18);
}

.login-ms-button:hover {
  border-color: #bfd3ca;
  box-shadow: 0 8px 20px rgb(32 88 112 / .12);
}

/* Identite Topo Franco : ecran d'acces sobre et institutionnel. */
:root {
  --login-bg: #f3f6f3;
  --login-border: #cbd8d1;
  --login-shadow: none;
  --login-radius: 4px;
}

.login-card {
  padding: 34px;
  box-shadow: none;
}

.login-heading {
  color: #173f50;
  letter-spacing: -.02em;
}

.login-field input,
.login-submit,
.login-ms-button {
  border-radius: 4px;
}

.login-submit {
  box-shadow: none;
}

.login-ms-button:hover {
  background: #f3f7f4;
  box-shadow: none;
}

.login-submit:focus-visible,
.login-ms-button:focus-visible,
.login-field input:focus-visible {
  outline: 3px solid rgb(32 88 112 / .26);
  outline-offset: 2px;
}
