:root {
  --blue: #058bd6;
  --deep-blue: #0a5f9f;
  --ink: #0f1726;
  --muted: #4f5b6b;
  --line: #cfd9e8;
  --line-strong: #91a7bf;
  --danger: #b42318;
  --danger-bg: #fff1f0;
  --danger-line: #fff1f0;
  --field: #edf3fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  font-family: "Poppins", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
  background: #f6f8fb;
}

.top-loader {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 20;
  width: 100%;
  height: 3px;
  pointer-events: none;
  opacity: 0;
  overflow: hidden;
  background: rgba(5, 139, 214, 0.12);
}

.top-loader::before {
  content: "";
  display: block;
  width: 42%;
  height: 100%;
  transform: translateX(-110%);
  background: linear-gradient(90deg, var(--blue), #13a8ee);
}

.top-loader.is-loading {
  opacity: 1;
}

.top-loader.is-loading::before {
  animation: loading-bar 1.1s ease-in-out infinite;
}

@keyframes loading-bar {
  0% {
    transform: translateX(-110%);
  }

  55% {
    transform: translateX(120%);
  }

  100% {
    transform: translateX(240%);
  }
}

.login-shell {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
  height: 100vh;
}

.brand-panel {
  position: relative;
  overflow: hidden;
  height: 100vh;
  color: #fff;
  background: #071726;
}

.brand-photo,
.brand-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.brand-photo {
  object-fit: cover;
  object-position: 48% center;
  filter: saturate(1.08) contrast(1.03);
  transform: scale(1.02);
}

.brand-overlay {
  background:
    radial-gradient(circle at 58% 28%, rgba(2, 135, 207, 0.1), transparent 34%),
    linear-gradient(90deg, rgba(1, 15, 29, 0.88), rgba(3, 32, 58, 0.74) 48%, rgba(5, 39, 70, 0.42));
}

.brand-content {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100vh;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(34px, 4.8vw, 58px);
  padding-bottom: clamp(54px, 9vh, 86px);
}

.brand-header {
  position: absolute;
  top: clamp(28px, 5vh, 44px);
  left: clamp(34px, 4.8vw, 58px);
  z-index: 2;
}

.eyebrow {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-logo {
  width: 118px;
  height: 56px;
  margin: 0 0 14px;
  object-fit: cover;
  object-position: center 42%;
}

.brand-content h1 {
  max-width: 430px;
  margin: 0 0 14px;
  font-size: clamp(1.55rem, 2.55vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.brand-subtitle {
  max-width: 500px;
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.96);
  font-size: 0.82rem;
  line-height: 1.75;
}

.feature-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.73rem;
  font-weight: 600;
}

.feature-list li::before {
  content: "✓";
  margin-right: 9px;
  color: #b7ddff;
}

.form-panel {
  display: grid;
  place-items: center;
  height: 100vh;
  padding: 28px 40px;
  background: #f8fbff;
  overflow-y: auto;
}

.form-panel.login-kuba-bg {
  padding: 16px 22px;
}

.login-kuba-bg {
  background-color: #f8fbff;
  background-image:
    linear-gradient(rgba(248, 251, 255, 0.86), rgba(248, 251, 255, 0.86)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='56' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23b0bec9' stroke-width='0.55' stroke-linecap='square' stroke-linejoin='miter' opacity='0.22'%3E%3Cpath d='M40,0 L80,40 L40,80 L0,40 Z' /%3E%3Cpath d='M40,15 L55,40 L40,65 L25,40 Z' opacity='0.55' /%3E%3C/g%3E%3C/svg%3E");
  background-size: 56px 56px;
  background-position: center;
  background-repeat: repeat;
}

.login-card {
  width: min(100%, 390px);
}

.login-logo {
  display: block;
  width: 152px;
  height: 72px;
  margin: 0 auto;
  object-fit: cover;
  object-position: center 42%;
}

.login-card h2 {
  margin: 0 0 8px;
  text-align: center;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.035em;
}

.login-card:not(.inscription-card) {
  width: min(100%, 360px);
}

.login-card:not(.inscription-card) .login-logo {
  width: 118px;
  height: 54px;
}

.login-card:not(.inscription-card) h2 {
  margin: 0 0 4px;
  font-size: 1.42rem;
}

.login-card:not(.inscription-card) > .helper {
  margin: 0 0 14px;
  font-size: 0.78rem;
  line-height: 1.45;
}

.login-card:not(.inscription-card) form {
  gap: 6px;
}

.login-card:not(.inscription-card) label,
.login-card:not(.inscription-card) .label-row a {
  font-size: 0.7rem;
}

.login-card:not(.inscription-card) .label-row {
  margin-top: 4px;
  gap: 10px;
}

.login-card:not(.inscription-card) input {
  padding: 9px 11px;
  font-size: 0.76rem;
}

.login-card:not(.inscription-card) .password-field input {
  padding-right: 40px;
}

.login-card:not(.inscription-card) .password-toggle {
  width: 24px;
  height: 24px;
  right: 10px;
}

.login-card:not(.inscription-card) .password-toggle svg {
  width: 17px;
  height: 17px;
}

.login-card:not(.inscription-card) button[type="submit"] {
  margin-top: 12px;
  padding: 10px 14px;
  font-size: 0.76rem;
}

.helper {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
  text-align: center;
}

.login-foot {
  margin: 1.35rem 0 0;
  padding-top: 0.15rem;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}

.login-foot a {
  color: var(--deep-blue);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.login-foot a:hover {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-logo-link {
  display: block;
  width: fit-content;
  margin: 0 auto;
  cursor: pointer;
  text-decoration: none;
}

.auth-logo-link:hover .login-logo {
  opacity: 0.85;
}

.error-message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 18px;
  border: 1px solid var(--danger-line);
  border-left: 3px solid var(--danger-line);
  background: var(--danger-bg);
  padding: 12px 14px;
  color: #2d3848;
  font-size: 0.82rem;
}

.error-icon {
  display: grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #b45a52;
}

.error-icon svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.error-message strong,
.error-message small {
  display: block;
}

.error-message strong {
  margin-bottom: 2px;
  font-weight: 700;
}

.error-message small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
}

form {
  display: grid;
  gap: 10px;
}

label,
.label-row a {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
}

.label-row a {
  color: var(--deep-blue);
  text-decoration: none;
  transition: color 0.15s ease;
}

.label-row a:hover {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-bottom-color: #b9c8dc;
  border-radius: 0;
  background: var(--field);
  padding: 13px 15px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
  outline: none;
}

input:focus {
  border-color: var(--line-strong);
  border-bottom-color: var(--blue);
  background: #f2f6fc;
  box-shadow: none;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 48px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  display: grid;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #536172;
}

.password-toggle svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

button[type="submit"] {
  margin-top: 24px;
  border: 0;
  border-radius: 0;
  background: linear-gradient(90deg, var(--blue), #0489de);
  padding: 14px 18px;
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
}

/* Inscription entreprise — stepper (barres horizontales) */
.inscription-card {
  width: min(100%, 420px);
}

.inscription-card .login-logo {
  width: 118px;
  height: 54px;
}

.inscription-card h2 {
  margin: 0 0 4px;
  font-size: 1.42rem;
}

.inscription-card > .helper {
  margin: 0 0 14px;
  font-size: 0.78rem;
  line-height: 1.45;
}

.inscription-card label {
  font-size: 0.7rem;
  margin-top: 2px;
}

.inscription-card input:not([type="hidden"]) {
  padding: 9px 11px;
  font-size: 0.76rem;
}

.inscription-card .password-field input {
  padding-right: 40px;
}

.inscription-card .password-toggle {
  width: 24px;
  height: 24px;
}

.inscription-stepper {
  margin-bottom: 0.65rem;
}

.inscription-step-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-bottom: 0;
}

.inscription-bar {
  display: block;
  height: 4px;
  background: #e8edf4;
}

.inscription-bar.is-filled {
  background: var(--blue);
}

.inscription-step {
  display: none;
}

.inscription-step.is-active {
  display: grid;
  gap: 6px;
}

.inscription-map {
  width: 100%;
  height: 132px;
  border: 1px solid var(--line);
  background: #eef2f7;
}

.inscription-map-help {
  margin: -2px 0 2px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.4;
}

.field-error {
  margin: -4px 0 2px;
  font-size: 0.68rem;
  color: var(--danger);
}

.inscription-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.inscription-actions:has(#inscription-prev[hidden]) {
  grid-template-columns: 1fr;
}

.inscription-actions:has(#inscription-prev[hidden]) .inscription-btn-next {
  grid-column: 1;
}

.inscription-actions:has(#inscription-submit:not([hidden])) {
  grid-template-columns: auto 1fr;
  align-items: stretch;
}

.inscription-actions:has(#inscription-submit:not([hidden])) .inscription-btn-back {
  padding: 10px 12px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.inscription-terms {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin-top: 0.15rem;
}

.inscription-terms input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 2px 0 0;
  padding: 0;
  flex: 0 0 14px;
  accent-color: var(--blue);
}

.inscription-terms label {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.45;
  cursor: pointer;
}

.inscription-btn-next,
.inscription-btn-submit {
  border: 0;
  border-radius: 0;
  background: var(--blue);
  padding: 10px 14px;
  color: #fff;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.inscription-btn-submit {
  grid-column: auto;
}

.inscription-btn-back {
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: #fff;
  padding: 10px 12px;
  color: var(--ink);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.inscription-foot {
  margin: 1.35rem 0 0;
  padding-top: 0.15rem;
  color: var(--muted);
  font-size: 0.76rem;
  text-align: center;
}

.inscription-foot a {
  color: var(--deep-blue);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.inscription-foot a:hover {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.activation-timer {
  margin: 0 0 8px;
  padding: 10px 12px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.76rem;
  font-weight: 600;
  text-align: center;
}

.activation-timer.is-hidden {
  display: none;
}

.activation-timer.is-expired {
  border-color: #fecaca;
  background: #fef2f2;
  color: var(--danger);
}

#activation-timer-value {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.activation-timer-hint {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
  text-align: center;
}

.activation-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
}

.activation-step.is-active {
  color: var(--deep-blue);
}

.activation-step-sep {
  width: 28px;
  height: 2px;
  background: #dbeafe;
  border-radius: 999px;
}

.activation-step-panel.is-hidden {
  display: none;
}

.otp-label {
  display: block;
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
}

.otp-inputs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 10px;
}

.otp-digit {
  width: 44px;
  height: 52px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.otp-digit:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(5, 139, 214, 0.18);
}

.otp-digit.is-filled {
  border-color: #93c5fd;
  background: #f8fbff;
}

.otp-separator {
  width: 12px;
  height: 2px;
  margin: 0 2px;
  background: #cbd5e1;
  border-radius: 999px;
}

.otp-feedback {
  min-height: 1.2rem;
  margin: 0 0 8px;
  font-size: 0.74rem;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
}

.otp-feedback.is-error {
  color: var(--danger);
}

.otp-feedback.is-success {
  color: #15803d;
}

.otp-inputs.is-success .otp-digit.is-success {
  border-color: #22c55e;
  background: #ecfdf3;
  color: #15803d;
  transform: scale(1.03);
}

.otp-inputs.is-error .otp-digit.is-error {
  border-color: #f87171;
  background: #fef2f2;
  animation: otp-shake 0.35s ease;
}

.otp-inputs.is-expired .otp-digit {
  opacity: 0.55;
  pointer-events: none;
}

.activation-code-confirmed {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 10px 12px;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  background: #f0fdf4;
  color: #15803d;
  font-size: 0.78rem;
  font-weight: 600;
}

.activation-code-confirmed-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #22c55e;
}

.activation-code-confirmed-icon svg {
  width: 14px;
  height: 14px;
  fill: #fff;
}

@keyframes otp-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@media (max-width: 860px) {
  .login-shell {
    grid-template-columns: 1fr;
  }

  .brand-panel,
  .brand-content,
  .form-panel {
    height: auto;
  }

  .brand-content {
    min-height: 44vh;
    padding: 36px 28px;
  }

  .brand-header {
    left: 28px;
    top: 24px;
  }

  .brand-logo {
    width: 98px;
    height: 46px;
  }

  .form-panel {
    min-height: 56vh;
    padding: 34px 24px;
  }
}