:root{
  --bg:#eef3f9;
  --border:#d5deea;
  --text:#2c3a4b;
  --muted:#6f7f92;
  --accent:#2c7be5;
  --accent2:#69a7ff;
  --shadow:0 18px 60px rgba(15,23,42,.12);
  --radius:22px;
  --focus: 0 0 0 3px rgba(44,123,229,.20);
  --font: ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial;
  --mono: ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
  --max: 980px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: var(--font);
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.82)),
    url("./login-bg.jpeg") center/cover no-repeat,
    var(--bg);
  display:grid;
  place-items:center;
  padding:16px;
  min-height:100svh;
  overflow-x:hidden;
}

.auth{
  position: relative;
  width:min(var(--max), 100%);
  border-radius: 26px;
  border:1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(244,247,252,.92));
  box-shadow: var(--shadow);
  overflow:hidden;
  min-height: 560px;
}

.auth__glow{
  position:absolute;
  inset:-2px;
  background:
    radial-gradient(700px 340px at 18% 20%, rgba(44,123,229,.14), transparent 62%),
    radial-gradient(620px 340px at 82% 10%, rgba(105,167,255,.12), transparent 62%);
  pointer-events:none;
  opacity: .92;
}

.auth__chooser{
  position: relative;
  z-index: 1;
  min-height: 560px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 28px;
  padding: 32px;
}

.auth__chooser-head{
  display: grid;
  gap: 6px;
  max-width: 720px;
  width: 100%;
  justify-items:center;
  text-align:center;
}

.auth__hero-tag{
  display:flex;
  justify-content:center;
  margin-top: -38px;
  margin-bottom: 30px;
}

.auth__hero-title{
  margin: 0;
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: -.03em;
}

.auth__hero-text{
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  max-width: 60ch;
  text-wrap: pretty;
}

.auth__choice-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  width: 100%;
  max-width: 720px;
}

.auth__install{
  width:100%;
  max-width:720px;
  display:flex;
  justify-content:center;
}

.auth__choice{
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(245,248,252,.88));
  color: var(--text);
  padding: 24px;
  text-align: left;
  display: grid;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 14px 40px rgba(15,23,42,.08);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}

.auth__choice:hover{
  transform: translateY(-2px);
  border-color: rgba(44,123,229,.26);
  box-shadow: 0 18px 42px rgba(15,23,42,.12);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(246,249,253,.94));
}

.auth__choice:focus-visible{
  outline: none;
  box-shadow: var(--focus);
}

.auth__choice-kicker{
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.auth__choice-title{
  font-size: 20px;
  line-height: 1.2;
}

.auth__choice-text{
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.auth__panes{
  position: relative;
  z-index: 1;
  min-height: 560px;
  display:block;
}

.auth__pane{
  padding: 22px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap: 14px;
  max-width: 560px;
  margin: 0 auto;
  min-height: 560px;
}

.auth.is-home .auth__panes{
  display:none;
}

.auth:not(.is-home) .auth__chooser{
  display:none;
}

.auth:not(.is-home) .auth__pane--signup,
.auth:not(.is-home) .auth__pane--login{
  display:none;
}

.auth.is-signup:not(.is-home) .auth__pane--signup{
  display:flex;
}

.auth:not(.is-signup):not(.is-home) .auth__pane--login{
  display:flex;
}

.auth__title{ margin:0; font-size:20px; letter-spacing:.2px; }
.auth__lead{ margin:0; color: var(--muted); font-size:13px; line-height:1.55; }

.auth__meta{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  color: var(--muted);
  font-size:12px;
}
.auth__meta--spaced{ margin-top: 8px; }

/* Tags (petits badges) */
.tag{
  font-family: var(--mono);
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.78);
  color: var(--muted);
  user-select:none;
  white-space:nowrap;
}
.tag--ok{ border-color: rgba(0,210,122,.28); background: rgba(0,210,122,.08); }
.tag--warn{ border-color: rgba(245,128,62,.28); background: rgba(245,128,62,.08); }

.auth__hero-tag .tag{
  font-size: 30px;
  line-height: 1.1;
  padding: 8px 18px;
  font-weight: 700;
  border-radius: 999px;
}

/* Social */
.auth__social{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top: 6px;
}
.social-btn{
  min-width: 56px;
  width:56px;
  height:40px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius: 14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.78);
  cursor:pointer;
  user-select:none;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
  padding: 0 12px;
}
.social-btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,.96); border-color: rgba(44,123,229,.24); }
.social-btn:active{ transform: translateY(0); }
.social-btn::before{
  display:block;
  font-size:18px;
  line-height:1;
  color:var(--text);
}
.social-btn--google::before{ content:"G"; font-weight:800; color:#db4437; font-family:Arial, sans-serif; }
.social-btn--github::before{ content:"⌘"; font-weight:800; color:#111827; }
.social-btn--microsoft::before{ content:"⊞"; font-weight:800; color:#2563eb; }
.social-btn--apple::before{ content:""; font-weight:800; color:#111827; font-family:Arial, sans-serif; }

/* Form */
.form{ display:flex; flex-direction:column; gap: 10px; margin-top: 8px; }
.form__field{ display:flex; flex-direction:column; gap: 6px; }
.form__label{ font-size: 12px; color: var(--muted); }
.form__hint{
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.form__control{
  width:100%;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.88);
  color: var(--text);
  padding: 11px 12px;
  font-size: 13px;
  outline:none;
}
.form__control:focus{
  box-shadow: var(--focus);
  border-color: rgba(44,123,229,.35);
}

.account-switch{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.account-switch__btn{
  border:1px solid var(--border);
  background: rgba(255,255,255,.78);
  color: var(--text);
  padding:10px 12px;
  border-radius: 14px;
  cursor:pointer;
  font-size:13px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}

.account-switch__btn:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,.96);
  border-color: rgba(44,123,229,.24);
}

.account-switch__btn.is-active{
  border-color: rgba(44,123,229,.40);
  background: rgba(44,123,229,.12);
  color: var(--text);
}

.form__actions{
  display:flex;
  gap: 10px;
  flex-wrap:wrap;
  justify-content:flex-end;
  align-items:center;
  margin-top: 4px;
}

/* Buttons */
.btn{
  border:1px solid var(--border);
  background: rgba(255,255,255,.78);
  color:var(--text);
  padding:10px 12px;
  border-radius:14px;
  cursor:pointer;
  font-size:13px;
  user-select:none;
  display:inline-flex;
  align-items:center;
  gap:8px;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
  white-space: nowrap;
}
.btn:hover{ transform: translateY(-1px); background: rgba(255,255,255,.96); border-color: rgba(44,123,229,.24); }
.btn:active{ transform: translateY(0); }
.btn:focus-visible{ outline:none; box-shadow: var(--focus); }

.btn--primary{ border-color: rgba(44,123,229,.40); background: rgba(44,123,229,.12); }
.btn--ghost{ background: rgba(255,255,255,.62); }
.auth__mobile-back{ display:inline-flex; }

/* Link button */
.link{
  border:0;
  background:transparent;
  color: var(--muted);
  font-size: 12px;
  cursor:pointer;
  padding: 6px 0;
  align-self:flex-start;
}
.link:hover{ color: var(--text); text-decoration: underline; }

.auth__messages{
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 5;
  display: grid;
  gap: 8px;
}

#liEmailWrap[hidden]{
  display:none !important;
}

.auth__message{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.88);
  color: var(--text);
  box-shadow: 0 10px 24px rgba(15,23,42,.08);
}

.auth__message--success{
  border-color: rgba(0,210,122,.24);
  background: rgba(0,210,122,.08);
}

.auth__message--error{
  border-color: rgba(230,55,87,.24);
  background: rgba(230,55,87,.08);
}

.form__errors{
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(230,55,87,.22);
  background: rgba(230,55,87,.08);
  color: #7a1f32;
  font-size: 12px;
  line-height: 1.5;
}

.authModal[hidden]{
  display:none !important;
}

.authModal{
  position:fixed;
  inset:0;
  z-index:30;
  display:grid;
  place-items:center;
  padding:20px;
}

.authModal__backdrop{
  position:absolute;
  inset:0;
  background:rgba(20,31,48,.34);
  backdrop-filter: blur(6px);
}

.authModal__dialog{
  position:relative;
  z-index:1;
  width:min(100%, 460px);
  border-radius: 24px;
  border:1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(245,248,252,.95));
  box-shadow: 0 24px 72px rgba(15,23,42,.18);
  padding: 22px;
  display:grid;
  gap: 14px;
}

.authModal__head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}

.authModal__title{
  margin:10px 0 6px;
  font-size: 22px;
  line-height:1.15;
}

.authModal__text{
  margin:0;
  color:var(--muted);
  font-size:13px;
  line-height:1.55;
}

.authModal__close{
  width:40px;
  height:40px;
  border-radius:14px;
  border:1px solid var(--border);
  background:rgba(255,255,255,.84);
  color:var(--text);
  font-size:24px;
  line-height:1;
  cursor:pointer;
}

.authModal__close:hover{
  background:rgba(255,255,255,.98);
}

.authModal__form{
  margin-top:0;
}


