/* Portail public — écran connexion OTP (inspiré admin UNHCR) */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --ha-primary: #0072bc;
  --ha-primary-dark: #005a96;
  --ha-bg-soft: #f0f7fc;
  --ha-text: #0f172a;
  --ha-muted: #64748b;
  --ha-border: #e2e8f0;
  --ha-card: rgba(255, 255, 255, 0.94);
}

.hub-auth-page {
  position: fixed;
  inset: 0;
  z-index: 2000;
  min-height: 100vh;
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--ha-bg-soft);
  color: var(--ha-text);
}

.hub-auth-page[hidden] {
  display: none !important;
}

.hub-auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 44% 56%;
}

.hub-auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem 1.5rem;
  background:
    radial-gradient(circle at 100% 0%, rgba(0, 114, 188, 0.12), transparent 40%),
    var(--ha-bg-soft);
}

.hub-auth-card {
  width: 100%;
  max-width: 440px;
  padding: 2.25rem 1.75rem;
  background: var(--ha-card);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(12px);
}

.hub-auth-brand {
  text-align: center;
  margin-bottom: 1.25rem;
}

.hub-auth-brand h1 {
  margin: 0.35rem 0 0.25rem;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ha-primary);
  letter-spacing: 0.02em;
}

.hub-auth-brand p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ha-muted);
}

.hub-auth-sep {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}

.hub-auth-sep::before,
.hub-auth-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--ha-border), transparent);
}

.hub-auth-sep span {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 114, 188, 0.1);
  color: var(--ha-primary);
}

.hub-auth-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.hub-auth-input-wrap {
  position: relative;
  margin-bottom: 1rem;
}

.hub-auth-input-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ha-muted);
  font-size: 1.05rem;
}

.hub-auth-input {
  width: 100%;
  padding: 0.75rem 0.85rem 0.75rem 2.5rem;
  border: 1px solid var(--ha-border);
  border-radius: 12px;
  font-size: 0.95rem;
}

.hub-auth-input:focus {
  outline: none;
  border-color: rgba(0, 114, 188, 0.45);
  box-shadow: 0 0 0 3px rgba(0, 114, 188, 0.12);
}

.hub-auth-input--otp {
  padding-left: 0.85rem;
  text-align: center;
  letter-spacing: 0.35em;
  font-weight: 700;
  font-size: 1.25rem;
}

.hub-auth-input--plain {
  padding-left: 0.85rem;
}

.hub-auth-sexe-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
}

.hub-auth-sexe-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
  cursor: pointer;
  font-weight: 500;
}

.hub-auth-sexe-opt input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--ha-primary);
}

.hub-auth-alert {
  font-size: 0.85rem;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  margin-bottom: 1rem;
}

.hub-auth-remember {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--ha-muted);
  cursor: pointer;
  margin-bottom: 0.25rem;
  user-select: none;
}

.hub-auth-remember input {
  margin-top: 0.15rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--ha-primary);
  flex-shrink: 0;
}

.hub-auth-btn {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(180deg, var(--ha-primary) 0%, var(--ha-primary-dark) 100%);
  box-shadow: 0 8px 24px rgba(0, 114, 188, 0.28);
}

.hub-auth-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.hub-auth-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--ha-primary);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  text-decoration: underline;
}

.hub-auth-foot {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--ha-muted);
}

.hub-auth-visual {
  position: relative;
  overflow: hidden;
  background: #0b1f3a;
  min-height: 100vh;
}

.hub-auth-bg {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse 100% 70% at 80% 10%, rgba(0, 114, 188, 0.35), transparent 45%),
    radial-gradient(ellipse 80% 50% at 10% 90%, rgba(0, 90, 150, 0.45), transparent 50%),
    linear-gradient(155deg, #061428 0%, #0f172a 50%, #020617 100%);
  background-size: cover;
  background-position: center;
  transform-origin: center;
  animation: hubKenburns 20s ease-in-out infinite alternate;
}

.hub-auth-bg-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(240, 247, 252, 0.12), rgba(0, 70, 150, 0.08));
  pointer-events: none;
}

@keyframes hubKenburns {
  from { transform: scale(1) translate3d(0, 0, 0); }
  to { transform: scale(1.07) translate3d(-14px, -8px, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .hub-auth-bg { animation: none; }
}

@media (max-width: 900px) {
  .hub-auth-shell {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }
  .hub-auth-visual {
    order: -1;
    min-height: 160px;
    max-height: 200px;
    flex: 0 0 auto;
  }
  .hub-auth-panel {
    flex: 1 1 auto;
    justify-content: flex-start;
    padding-top: 2rem;
  }
}
