/* =========================================================================
   ISPA — Auth (split-screen) + Chat IA
   ========================================================================= */

/* ---------- Authentification ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }

.auth__aside {
  position: relative; overflow: hidden; color: #fff;
  background:
    linear-gradient(150deg, rgba(75,80,219,.78) 0%, rgba(109,92,240,.72) 55%, rgba(139,92,246,.78) 100%),
    url("/static/img/auth-bg.jpg") center/cover no-repeat;
  display: flex; flex-direction: column; justify-content: space-between; padding: 48px;
}
/* aurora doux */
.auth__aside::before, .auth__aside::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55;
}
.auth__aside::before { width: 360px; height: 360px; background: #A78BFA; top: -80px; right: -60px; }
.auth__aside::after  { width: 300px; height: 300px; background: #38BDF8; bottom: -90px; left: -40px; opacity: .4; }
.auth__brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }
.auth__brand .brand__mark { background: rgba(255,255,255,.18); box-shadow: none; backdrop-filter: blur(4px); }
.auth__brand-name { font-family: var(--ff-display); font-weight: 800; font-size: 20px; }
.auth__pitch { position: relative; z-index: 2; max-width: 420px; }
.auth__pitch h2 { color: #fff; font-size: 34px; line-height: 1.15; margin-bottom: 16px; }
.auth__pitch p { color: rgba(255,255,255,.82); font-size: 15.5px; line-height: 1.6; }
.auth__features { position: relative; z-index: 2; display: flex; flex-direction: column; gap: 14px; }
.auth__feature { display: flex; align-items: center; gap: 13px; font-size: 14.5px; color: rgba(255,255,255,.92); }
.auth__feature span { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.16); display: grid; place-items: center; flex-shrink: 0; }
.auth__feature svg { width: 18px; height: 18px; }

.auth__main { display: grid; place-items: center; padding: 40px; background: var(--bg); }
.auth__card { width: 100%; max-width: 400px; }
.auth__card h1 { font-size: 27px; margin-bottom: 6px; }
.auth__card .sub { color: var(--muted); margin-bottom: 30px; }
.auth__footer { text-align: center; margin-top: 22px; font-size: 14px; color: var(--muted); }
.auth__footer a { color: var(--primary); font-weight: 600; }
.auth__demo { margin-top: 22px; padding: 14px 16px; background: var(--primary-tint); border: 1px solid var(--primary-soft); border-radius: 12px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; }
.auth__demo b { color: var(--primary-600); }

@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth__aside { display: none; } }

.auth__msg { padding: 11px 15px; border-radius: 10px; font-size: 14px; margin-bottom: 16px; border-left: 3px solid; font-weight: 500; }
.auth__msg--success { background: #f0fdf4; border-left-color: #22c55e; color: #166534; }
.auth__msg--info    { background: #eff6ff; border-left-color: #3b82f6; color: #1e40af; }
.auth__msg--warning { background: #fffbeb; border-left-color: #f59e0b; color: #92400e; }
.auth__msg--error, .auth__msg--danger { background: #fef2f2; border-left-color: #ef4444; color: #991b1b; }


/* ---------- Chat IA ---------- */
.chat { display: grid; grid-template-columns: 1fr; height: calc(100vh - 70px); }
.chat__wrap { display: flex; flex-direction: column; height: 100%; }
.chat__head { padding: 18px 28px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; background: var(--surface); }
.chat__avatar { width: 44px; height: 44px; border-radius: 13px; background: linear-gradient(135deg, var(--primary), #8B5CF6); display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.chat__head h2 { font-size: 17px; }
.chat__head p { font-size: 13px; color: var(--muted); }
.chat__ctx { margin-left: auto; }

.chat__stream { flex: 1; overflow-y: auto; padding: 28px; display: flex; flex-direction: column; gap: 18px; background: var(--bg); }
.msg { display: flex; gap: 12px; max-width: 760px; }
.msg__av { width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.msg__av--ai { background: linear-gradient(135deg, var(--primary), #8B5CF6); color: #fff; }
.msg__av--me { background: var(--primary-soft); color: var(--primary-600); }
.msg__bubble { padding: 13px 17px; border-radius: 16px; font-size: 14.5px; line-height: 1.6; box-shadow: var(--sh-xs); }
.msg--ai .msg__bubble { background: var(--surface); border: 1px solid var(--line); border-top-left-radius: 5px; }
.msg--me { margin-left: auto; flex-direction: row-reverse; }
.msg--me .msg__bubble { background: var(--primary); color: #fff; border-top-right-radius: 5px; }

.chat__compose { padding: 18px 28px 24px; background: var(--surface); border-top: 1px solid var(--line); }
.chat__inputbar { display: flex; gap: 12px; align-items: flex-end; background: var(--bg); border: 1px solid var(--line-2); border-radius: 18px; padding: 8px 8px 8px 18px; transition: border .16s, box-shadow .16s; }
.chat__inputbar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-tint); }
.chat__inputbar textarea { flex: 1; border: none; outline: none; background: none; resize: none; font-family: inherit; font-size: 14.5px; max-height: 120px; padding: 8px 0; color: var(--ink); }
.chat__send { width: 42px; height: 42px; border-radius: 13px; background: var(--primary); border: none; color: #fff; cursor: pointer; display: grid; place-items: center; flex-shrink: 0; transition: background .16s; }
.chat__send:hover { background: var(--primary-600); }
.chat__send:disabled { opacity: .5; cursor: default; }
.chat__hint { font-size: 12px; color: var(--muted); text-align: center; margin-top: 10px; }

.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: bounce 1.2s infinite; }
.typing span:nth-child(2){ animation-delay: .15s; } .typing span:nth-child(3){ animation-delay: .3s; }
@keyframes bounce { 0%,60%,100%{ transform: translateY(0); opacity:.4 } 30%{ transform: translateY(-5px); opacity:1 } }

.chat-suggestions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: auto 0; }
.chat-suggestions__item { background: var(--surface); border: 1px solid var(--line-2); border-radius: 14px; padding: 14px 18px; font-size: 14px; cursor: pointer; max-width: 260px; transition: border .16s, transform .1s; }
.chat-suggestions__item:hover { border-color: var(--primary); transform: translateY(-2px); }
.chat-welcome { text-align: center; margin: auto 0 26px; }
.chat-welcome h3 { font-size: 21px; margin-bottom: 8px; }
.chat-welcome p { color: var(--muted); }

