/* Québec Auto Finance — page de connexion */
:root {
  --qaf-navy: #18355e;
  --qaf-navy-deep: #0f2442;
  --qaf-blue: #0080bc;
  --qaf-blue-dark: #006a9c;
  --qaf-ink: #1c2533;
  --qaf-muted: #5f6b7a;
  --qaf-line: #d7dde5;
  --qaf-bg: #f4f6f9;
  --qaf-error: #b3261e;
  --qaf-error-bg: #fdecea;
}

* { box-sizing: border-box; }

html, body { height: 100%; margin: 0; }

body.qaf-login {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--qaf-ink);
  background: var(--qaf-bg);
  -webkit-font-smoothing: antialiased;
}

.qaf-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(380px, 1fr);
  min-height: 100vh;
}

/* ---------- Panneau visuel ---------- */
.qaf-visual {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(0, 128, 188, 0.55) 0%, rgba(0, 128, 188, 0) 60%),
    linear-gradient(160deg, var(--qaf-navy) 0%, var(--qaf-navy-deep) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 56px;
}
/* Anneaux décoratifs */
.qaf-visual::before,
.qaf-visual::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.09);
  pointer-events: none;
}
.qaf-visual::before { width: 620px; height: 620px; right: -220px; top: -180px; box-shadow: 0 0 0 70px rgba(255,255,255,0.025), 0 0 0 140px rgba(255,255,255,0.02); }
.qaf-visual::after  { width: 260px; height: 260px; left: -90px; top: 38%; border-color: rgba(143, 208, 239, 0.18); }

.qaf-points {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  gap: 12px;
}
.qaf-points li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.9);
}
.qaf-points li::before {
  content: "";
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 128, 188, 0.9) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 12px no-repeat;
}
.qaf-visual > * { position: relative; }

.qaf-visual-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8fd0ef;
  margin: 0 0 14px;
}
.qaf-visual h1 {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.15;
  font-weight: 700;
  margin: 0 0 14px;
  max-width: 14em;
}
.qaf-visual p {
  font-size: 16px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
  margin: 0;
  max-width: 30em;
}

/* ---------- Panneau formulaire ---------- */
.qaf-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 32px 24px;
  background: #fff;
}

.qaf-card { width: 100%; max-width: 380px; }

.qaf-logo { display: block; width: 200px; height: auto; margin: 0 0 36px; }

.qaf-card h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--qaf-navy);
  margin: 0 0 6px;
}
.qaf-sub { font-size: 15px; color: var(--qaf-muted); margin: 0 0 28px; }

/* Messages Flash (rendus par $this->Flash->render()) */
.qaf-card .message {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 1.45;
  padding: 12px 14px;
  border-radius: 8px;
  margin: 0 0 20px;
  cursor: pointer;
  background: #e8f4fb;
  color: var(--qaf-navy);
  border: 1px solid #bfe0f1;
}
.qaf-card .message.error {
  background: var(--qaf-error-bg);
  color: var(--qaf-error);
  border-color: #f5c2bd;
}
.qaf-card .message.success { background: #e7f6ec; color: #1e6b3a; border-color: #bfe5cb; }
.qaf-card .message.hidden { display: none; }

/* Champs */
.qaf-field { margin: 0 0 18px; }
.qaf-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--qaf-ink);
  margin: 0 0 6px;
}
.qaf-input-wrap { position: relative; }
.qaf-input-wrap .qaf-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #8a96a6;
  pointer-events: none;
}
.qaf-field .input { margin: 0; }         /* wrapper div ajouté par FormHelper */
.qaf-field input[type="text"],
.qaf-field input[type="password"] {
  width: 100%;
  height: 48px;
  padding: 0 44px 0 42px;
  font-size: 15px;
  color: var(--qaf-ink);
  background: #fff;
  border: 1px solid var(--qaf-line);
  border-radius: 8px;
  transition: border-color .15s, box-shadow .15s;
}
.qaf-field input:hover { border-color: #b8c2cf; }
.qaf-field input:focus {
  outline: none;
  border-color: var(--qaf-blue);
  box-shadow: 0 0 0 3px rgba(0, 128, 188, 0.18);
}

.qaf-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #8a96a6;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.qaf-toggle:hover { color: var(--qaf-navy); background: #f1f4f8; }
.qaf-toggle:focus-visible { outline: 2px solid var(--qaf-blue); outline-offset: 1px; }
.qaf-toggle svg { width: 18px; height: 18px; }

.qaf-submit {
  width: 100%;
  height: 48px;
  margin-top: 8px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--qaf-blue);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
.qaf-submit:hover { background: var(--qaf-blue-dark); }
.qaf-submit:active { transform: translateY(1px); }
.qaf-submit:focus-visible { outline: 3px solid rgba(0, 128, 188, 0.35); outline-offset: 2px; }

.qaf-help {
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid #edf0f4;
  font-size: 13px;
  color: var(--qaf-muted);
  line-height: 1.5;
}
.qaf-help a { color: var(--qaf-blue); font-weight: 600; text-decoration: none; white-space: nowrap; }
.qaf-help a:hover { text-decoration: underline; }

.qaf-foot {
  margin-top: auto;
  padding-top: 32px;
  font-size: 12px;
  color: #98a2b0;
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .qaf-shell { grid-template-columns: 1fr; }
  .qaf-visual { min-height: 180px; padding: 28px 24px; }
  .qaf-visual h1 { font-size: 24px; }
  .qaf-visual p, .qaf-visual-kicker, .qaf-points { display: none; }
  .qaf-visual::before { width: 360px; height: 360px; right: -140px; top: -160px; }
  .qaf-panel { padding: 36px 22px 20px; }
  .qaf-logo { width: 170px; margin-bottom: 28px; }
}
