/* ============================================================
 *  Peerly — Page de connexion inter-services
 *  v1.1.0 — M3 Expressive + avatar radius + input readonly
 * ============================================================ */

.login-page {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--md-sys-color-surface);
  position: relative;
  overflow: hidden;
}

/* Halo décoratif en fond */
.login-page::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--md-sys-color-primary) 15%, transparent) 0%,
    transparent 70%
  );
  top: -200px;
  right: -200px;
  pointer-events: none;
  filter: blur(40px);
}
.login-page::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent) 0%,
    transparent 70%
  );
  bottom: -150px;
  left: -150px;
  pointer-events: none;
  filter: blur(40px);
}

.login-card {
  background: var(--md-sys-color-surface-container);
  border-radius: 28px;
  padding: 40px 32px 32px;
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: var(--md-sys-elevation-level3);
  border: 1px solid var(--md-sys-color-outline-variant);
  position: relative;
  z-index: 1;
  animation: loginCardIn 500ms cubic-bezier(0.22, 1.2, 0.36, 1);
}

@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.login-logo {
  width: 56px;
  height: 56px;
  display: block;
}

.login-title {
  font-size: 24px;
  font-weight: 400;
  line-height: 1.3;
  text-align: center;
  color: var(--md-sys-color-on-surface);
  margin: 0;
}
.login-service-name {
  color: var(--md-sys-color-primary);
  font-weight: 600;
}

.login-subtitle {
  font-size: 14px;
  line-height: 1.5;
  color: var(--md-sys-color-on-surface-variant);
  text-align: center;
  margin: 0 0 8px;
  max-width: 320px;
}

/* ---------- Avatar (auto-suffisant, sans avatar.css) ---------- */
.login-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 28px;
  color: var(--md-sys-color-on-primary);
  background: var(--md-sys-color-primary);
  overflow: hidden;
  flex-shrink: 0;
  user-select: none;
  margin: 8px auto 4px;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--md-sys-color-primary) 25%, transparent);
}
.login-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

/* ---------- Champ pseudo ---------- */
.login-field {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.login-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-left: 4px;
}

.login-field-hint {
  font-size: 11px;
  line-height: 1.5;
  color: var(--md-sys-color-on-surface-variant);
  padding: 0 4px;
  margin: 2px 0 0;
  opacity: 0.75;
}

/* ---------- Input readonly (état figé) ---------- */
#login-name[readonly] {
  background: var(--md-sys-color-surface-container-high);
  border-color: transparent;
  color: var(--md-sys-color-on-surface);
  cursor: default;
  padding-right: 44px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='11' width='18' height='11' rx='2' ry='2'/><path d='M7 11V7a5 5 0 0 1 10 0v4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}
#login-name[readonly]:hover {
  border-color: transparent;
  background-color: var(--md-sys-color-surface-container-high);
}
#login-name[readonly]:focus {
  border-color: transparent;
  background-color: var(--md-sys-color-surface-container-high);
  box-shadow: none;
  outline: none;
}

/* ---------- Actions ---------- */
.login-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}
.login-btn-primary,
.login-btn-secondary {
  width: 100%;
  height: 48px;
}

.login-hint {
  font-size: 11px;
  line-height: 1.5;
  color: var(--md-sys-color-on-surface-variant);
  text-align: center;
  margin: 8px 0 0;
  max-width: 320px;
  opacity: 0.7;
}

.login-error {
  font-size: 12px;
  color: var(--md-sys-color-error);
  text-align: center;
  margin: 8px 0 0;
  padding: 8px 12px;
  background: color-mix(in srgb, var(--md-sys-color-error) 12%, transparent);
  border-radius: 8px;
  width: 100%;
}

@media (max-width: 480px) {
  .login-card { padding: 32px 20px 24px; border-radius: 24px; }
  .login-title { font-size: 20px; }
  .login-logo { width: 48px; height: 48px; }
  .login-avatar { width: 64px; height: 64px; font-size: 24px; }
}