:root {
  --navy: #0a3d4a;
  --navy-deep: #003d33;
  --mint: #00c4b4;
  --mint-bright: #00e0d0;
  --mint-glow: rgba(0, 209, 193, 0.55);
  --mint-glow-soft: rgba(0, 224, 208, 0.4);
  --white: #ffffff;
  --glass: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(255, 255, 255, 0.75);
  --text: #0a3d4a;
  --muted: #4a7080;
  --field-bg: rgba(255, 255, 255, 0.98);
  --field-border: rgba(10, 61, 74, 0.16);
  --radius: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--text);
  background-color: #eaf8f9;
  background-image: url("assets/pharmapilote-bg.png");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: hidden;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Overlay très léger pour garder la brillance du fond */
.page::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 72% 42%, rgba(0, 209, 193, 0.06), transparent 60%),
    linear-gradient(
      115deg,
      rgba(255, 255, 255, 0.08) 0%,
      rgba(255, 255, 255, 0.02) 40%,
      rgba(0, 61, 51, 0.04) 100%
    );
  pointer-events: none;
  z-index: 0;
}

.login-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 2.5rem clamp(1.25rem, 5vw, 5.5rem) 4.5rem;
  position: relative;
  z-index: 1;
}

.login-panel {
  width: min(100%, 420px);
  padding: 2.4rem 2.05rem 1.65rem;
  background:
    radial-gradient(ellipse 120% 80% at 100% -10%, rgba(0, 209, 193, 0.16), transparent 55%),
    radial-gradient(ellipse 90% 60% at -10% 110%, rgba(0, 61, 51, 0.06), transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0%, rgba(240, 252, 251, 0.94) 100%);
  backdrop-filter: blur(16px) saturate(1.35) brightness(1.05);
  -webkit-backdrop-filter: blur(16px) saturate(1.35) brightness(1.05);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 22px;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 0 0 1px rgba(0, 209, 193, 0.25),
    0 0 24px rgba(0, 224, 208, 0.45),
    0 0 56px rgba(0, 209, 193, 0.4),
    0 0 100px rgba(0, 209, 193, 0.22),
    0 20px 44px rgba(0, 61, 51, 0.14);
  animation: panelIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.login-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--navy-deep) 0%, var(--mint) 45%, var(--mint-bright) 100%);
  box-shadow: 0 0 20px rgba(0, 224, 208, 0.7);
}

.login-panel::after {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid rgba(0, 209, 193, 0.18);
  border-radius: 14px;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(0, 209, 193, 0.1), transparent 28%) top left / 48px 48px no-repeat,
    linear-gradient(-45deg, rgba(0, 61, 51, 0.06), transparent 28%) bottom right / 48px 48px no-repeat;
}

.login-panel:hover {
  box-shadow:
    0 0 0 1px rgba(0, 209, 193, 0.35),
    0 0 32px rgba(0, 224, 208, 0.55),
    0 0 70px rgba(0, 209, 193, 0.45),
    0 0 120px rgba(0, 209, 193, 0.28),
    0 24px 52px rgba(0, 61, 51, 0.16);
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.panel-header {
  margin-bottom: 1.35rem;
  text-align: center;
  position: relative;
  z-index: 1;
}

.brand-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #0b3d5c 0%, #0e5a6e 55%, #00b094 120%);
  box-shadow:
    0 0 0 3px rgba(0, 209, 193, 0.22),
    0 0 0 7px rgba(0, 209, 193, 0.08),
    0 0 22px rgba(0, 209, 193, 0.4);
  animation: markPulse 2.8s ease-in-out infinite;
}

@keyframes markPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 3px rgba(0, 209, 193, 0.22),
      0 0 0 7px rgba(0, 209, 193, 0.08),
      0 0 22px rgba(0, 209, 193, 0.4);
  }
  50% {
    box-shadow:
      0 0 0 3px rgba(0, 209, 193, 0.3),
      0 0 0 10px rgba(0, 209, 193, 0.12),
      0 0 30px rgba(0, 209, 193, 0.55);
  }
}

.brand-cross {
  position: relative;
  width: 22px;
  height: 22px;
}

.brand-cross::before,
.brand-cross::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 2px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.brand-cross::before {
  width: 8px;
  height: 22px;
}

.brand-cross::after {
  width: 22px;
  height: 8px;
}

.panel-title {
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.brand-pharma {
  color: var(--navy);
}

.brand-pilote {
  color: var(--mint);
}

.panel-tagline {
  margin-top: 0.45rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy);
  opacity: 0.72;
}

.panel-divider {
  width: 88px;
  height: 2px;
  margin: 0.85rem auto 0.75rem;
  background: linear-gradient(90deg, transparent, var(--mint), transparent);
  border-radius: 2px;
  position: relative;
}

.panel-divider::before,
.panel-divider::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint);
  transform: translateY(-50%);
  box-shadow: 0 0 8px rgba(0, 209, 193, 0.7);
}

.panel-divider::before {
  left: -2px;
}

.panel-divider::after {
  right: -2px;
}

.panel-subtitle {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.panel-subtitle strong {
  color: var(--navy);
  font-weight: 700;
  letter-spacing: 0.1em;
  background: linear-gradient(90deg, rgba(0, 209, 193, 0.18), rgba(0, 209, 193, 0.05));
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.form-body {
  position: relative;
  z-index: 1;
  padding: 1.15rem 1rem 1.05rem;
  margin-bottom: 0.85rem;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(10, 61, 74, 0.08);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.field {
  margin-bottom: 1.05rem;
  position: relative;
  z-index: 1;
}

.field:last-of-type {
  margin-bottom: 1.15rem;
}

.field label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
}

.label-icon {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--mint);
  flex-shrink: 0;
}

.label-icon svg {
  width: 15px;
  height: 15px;
}

.field input,
.field select {
  width: 100%;
  height: 48px;
  padding: 0 1rem;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--navy);
  background: var(--field-bg);
  border: 1.5px solid var(--field-border);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field input::placeholder {
  color: #9bb0bd;
}

.field input:hover,
.field select:hover {
  border-color: rgba(0, 209, 193, 0.45);
}

.field input:focus,
.field select:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(0, 209, 193, 0.2), 0 0 16px rgba(0, 209, 193, 0.15);
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--navy);
  border-bottom: 2px solid var(--navy);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
  opacity: 0.55;
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  cursor: pointer;
}

.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 3rem;
}

.toggle-pwd {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.toggle-pwd:hover {
  color: var(--mint);
  background: rgba(0, 209, 193, 0.08);
}

.icon-eye {
  width: 20px;
  height: 20px;
}

.btn-login {
  width: 100%;
  height: 52px;
  margin-top: 0.15rem;
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--white);
  background: linear-gradient(135deg, var(--mint) 0%, #009980 45%, var(--navy) 160%);
  background-size: 160% 160%;
  background-position: 0% 50%;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow:
    0 0 20px rgba(0, 209, 193, 0.4),
    0 8px 20px rgba(0, 61, 51, 0.15);
  transition: background-position 0.35s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.btn-arrow {
  width: 18px;
  height: 18px;
  transition: transform 0.25s ease;
}

.btn-login:hover {
  background-position: 100% 50%;
  box-shadow:
    0 0 32px rgba(0, 209, 193, 0.55),
    0 10px 24px rgba(0, 61, 51, 0.2);
  transform: translateY(-1px);
}

.btn-login:hover .btn-arrow {
  transform: translateX(3px);
}

.btn-login:active {
  transform: translateY(0);
}

.panel-secure {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.panel-secure svg {
  width: 14px;
  height: 14px;
  color: var(--mint);
}

.copyright {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0.85rem 1.25rem 1.15rem;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  color: #ffffff;
  text-shadow:
    0 0 12px rgba(0, 209, 193, 0.45),
    0 1px 3px rgba(0, 0, 0, 0.45);
}

.copyright strong {
  font-weight: 700;
}

@media (max-width: 900px) {
  .login-wrap {
    justify-content: center;
    padding-top: 3rem;
    padding-bottom: 2rem;
  }

  .login-panel {
    width: min(100%, 380px);
  }
}

@media (max-width: 480px) {
  .login-panel {
    padding: 1.75rem 1.35rem 1.5rem;
  }

  .panel-title {
    font-size: 1.55rem;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
  }
}
