/* ==========================================================================
   FLOWEMO · AUTH PAGES
   Shared foundation for login, set-password and password-created.
   Rendered by templates/auth_base.html; the three pages only fill in the
   form column. Deliberately self-contained: the auth pages do not load
   Tailwind or Bootstrap, so nothing here can be overridden by them.
   ========================================================================== */
:root {
  --blue: #2C71F6;
  --blue-deep: #1B4BC4;
  --blue-light: #5992FF;
  --green: #00D287;

  --ink: #0F1421;
  --muted: #52525b;
  --muted-light: #86868b;
  --line: rgba(15,20,33,.11);

  --danger: #D64545;
  --warn: #F5B301;

  --ease: cubic-bezier(.2,.8,.2,1);
  --grid: 60px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: #fff;
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }

/* Service notice — rendered only when a message is passed in */
.notice {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px clamp(20px,4vw,40px);
  background: #EEF3FE; border-bottom: 1px solid rgba(44,113,246,.14);
  font-size: 13px; line-height: 1.5; color: #3A4256;
}
.notice svg { flex: none; width: 17px; height: 17px; color: var(--blue); margin-top: 1px; }
.notice b { display: block; color: var(--ink); font-weight: 600; }

.shell { display: grid; grid-template-columns: 52% 48%; min-height: 100vh; }
.notice ~ .shell { min-height: calc(100vh - 46px); }

/* ---------- Left brand panel ---------- */
.panel {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(30px,3.4vw,50px);
  background: linear-gradient(155deg, var(--blue-deep) 0%, var(--blue) 46%, var(--blue-light) 100%);
  color: #fff;
}
.panel__grid {
  position: absolute; inset: calc(var(--grid) * -2); z-index: -2;
  background-image:
    linear-gradient(to right, rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: var(--grid) var(--grid);
  animation: drift 52s linear infinite; will-change: transform;
}
.panel__grid--major {
  background-image:
    linear-gradient(to right, rgba(255,255,255,.14) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.14) 1px, transparent 1px);
  background-size: calc(var(--grid) * 4) calc(var(--grid) * 4);
}
.panel__glow { position: absolute; z-index: -2; border-radius: 50%; will-change: transform; }
.panel__glow--light {
  width: 80vmin; height: 80vmin; left: -24vmin; top: -30vmin;
  background: radial-gradient(circle, rgba(255,255,255,.15) 0%, rgba(255,255,255,0) 66%);
  animation: float-a 36s ease-in-out infinite;
}
.panel__glow--dark {
  width: 62vmin; height: 62vmin; right: -18vmin; top: 22%;
  background: radial-gradient(circle, rgba(27,75,196,.5) 0%, rgba(27,75,196,0) 66%);
  animation: float-b 46s ease-in-out infinite;
}
.panel__shape {
  position: absolute; z-index: -1; inset: -2% -6% -6% -6%;
  clip-path: polygon(0 104%,104% 58%,104% 104%);
  background: linear-gradient(102deg, var(--blue-deep) 0%, var(--blue) 100%);
  opacity: .95; animation: sway 30s ease-in-out infinite; will-change: transform;
}
.panel__shape::after {
  content: ""; position: absolute; inset: 0;
  clip-path: polygon(0 104%,104% 58%,104% 58.9%,0 104.9%);
  background: rgba(255,255,255,.4);
}
.panel__scrim {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to top,var(--blue-deep) 0%,rgba(27,75,196,.3) 35%,transparent 65%);
}

.panel__logo { display: flex; align-items: center; gap: 12px; text-decoration: none; position: relative; }
/* The logo is white-on-transparent, so it needs no plate behind it — the
   panel's blue is the background the artwork was drawn for. Height-driven
   so the aspect ratio stays exact at any width. */
.panel__logo-img { height: 36px; width: auto; display: block; }

.panel__copy { position: relative; max-width: 520px; margin-bottom: 4px; }
.panel__eyebrow {
  display: inline-flex; align-items: center; gap: 9px; margin-bottom: 20px;
  font-size: 11px; font-weight: 600; letter-spacing: 2.4px; text-transform: uppercase; color: rgba(255,255,255,.8);
}
.panel__eyebrow i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 4px rgba(0,210,135,.22); animation: pulse 2.8s ease-in-out infinite;
}
.panel__copy h1 {
  font-family: 'Montserrat', sans-serif; font-weight: 300;
  font-size: clamp(30px,3.1vw,46px); line-height: 1.1; letter-spacing: -1.2px; margin: 0 0 18px;
}
.panel__copy h1 b { font-weight: 600; }
.panel__copy p { font-size: 15.5px; line-height: 1.65; color: rgba(255,255,255,.85); margin: 0; max-width: 420px; }
.panel__meta {
  position: relative; display: flex; gap: 26px; flex-wrap: wrap;
  padding-top: 22px; border-top: 1px solid rgba(255,255,255,.2);
  font-size: 12.5px; color: rgba(255,255,255,.8);
}
.panel__meta span { display: flex; align-items: center; gap: 8px; }
.panel__meta svg { width: 15px; height: 15px; color: var(--green); flex: none; }

/* ---------- Right form column ---------- */
.form-col {
  position: relative; display: flex; flex-direction: column;
  padding: clamp(24px,3vw,40px) clamp(24px,5vw,72px);
}
.form-col__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
/* With no back link the lang chip is the only child and stays right-aligned. */
.form-col__top > :only-child { margin-left: auto; }
.back-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 100px; border: 1px solid transparent;
  font-size: 13px; font-weight: 500; color: var(--muted);
  text-decoration: none; transition: all .3s var(--ease);
}
.back-chip:hover { color: var(--blue); }
.back-chip svg { width: 15px; height: 15px; transition: transform .3s var(--ease); }
.back-chip:hover svg { transform: translateX(-3px); }
.lang-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: 100px; border: 1px solid var(--line);
  background: #fff; font-size: 13px; font-weight: 500; color: var(--muted);
  text-decoration: none; cursor: pointer; transition: all .3s var(--ease);
}
.lang-chip:hover { border-color: rgba(44,113,246,.35); color: var(--blue); }

.form-wrap { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 32px 0; }
.form-inner { width: 100%; max-width: 380px; margin: 0 auto; animation: rise .7s var(--ease) both; }

.kicker { font-size: 13px; font-weight: 600; letter-spacing: .3px; color: var(--blue); margin: 0 0 8px; }
.form-inner h2 {
  font-family: 'Montserrat', sans-serif; font-weight: 300; font-size: 34px; letter-spacing: -1px;
  margin: 0 0 10px; color: var(--ink);
}
.form-inner h2 b { font-weight: 600; }
.form-inner .sub { font-size: 14.5px; line-height: 1.6; color: var(--muted); margin: 0 0 32px; }
.form-inner .sub b { color: var(--ink); font-weight: 600; }

/* Server-side errors (Django form.errors / messages) */
.alert {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; margin: 0 0 20px; border-radius: 11px;
  background: rgba(214,69,69,.07); border: 1px solid rgba(214,69,69,.22);
  font-size: 13.5px; line-height: 1.5; color: #8E2F2F;
}
.alert svg { width: 17px; height: 17px; flex: none; margin-top: 1px; color: var(--danger); }
.alert ul { margin: 0; padding-left: 16px; }
.alert--ok {
  background: rgba(0,210,135,.08); border-color: rgba(0,210,135,.28); color: #0A6E4A;
}
.alert--ok svg { color: #0A8F5F; }

.field { position: relative; margin-bottom: 14px; }
.field input {
  width: 100%; height: 58px; padding: 24px 16px 9px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff;
  font-family: inherit; font-size: 15px; color: var(--ink); outline: none;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.field--pw input { padding-right: 52px; }
.field label {
  position: absolute; left: 16px; top: 19px; pointer-events: none;
  font-size: 15px; color: #9aa0b0;
  transition: all .2s var(--ease);
}
.field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(44,113,246,.13); }
.field input:focus+label,
.field input:not(:placeholder-shown)+label {
  top: 9px; font-size: 11px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--muted-light);
}
.field input:focus+label { color: var(--blue); }
.field--ok input { border-color: rgba(0,210,135,.55); }
.field--ok input:focus { box-shadow: 0 0 0 3px rgba(0,210,135,.15); }
.field--error input { border-color: rgba(214,69,69,.6); }
.field--error input:focus { box-shadow: 0 0 0 3px rgba(214,69,69,.13); }

.toggle {
  position: absolute; right: 9px; top: 11px; width: 36px; height: 36px;
  border: 0; border-radius: 9px; background: transparent; color: #9aa0b0;
  display: grid; place-items: center; cursor: pointer; transition: all .25s var(--ease);
}
.toggle:hover { background: rgba(44,113,246,.08); color: var(--blue); }
.toggle svg { width: 18px; height: 18px; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 18px 0 26px; }
/* Single trailing item (the forgot-password link with no checkbox beside it) */
.row--end { justify-content: flex-end; }
.link { font-size: 13.5px; font-weight: 500; color: var(--blue); text-decoration: none; transition: opacity .25s var(--ease); }
.link:hover { opacity: .68; }

/* Password strength meter */
.meter { margin: -2px 0 16px; }
.meter__bars { display: flex; gap: 5px; }
.meter__bars i {
  flex: 1; height: 4px; border-radius: 100px; background: #E7EAF1;
  transition: background .3s var(--ease);
}
.meter__label {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 8px; font-size: 12px; color: var(--muted-light);
}
.meter__label b { font-weight: 600; color: var(--muted); }

/* Requirement checklist */
.reqs { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 7px; }
.reqs li {
  display: flex; align-items: center; gap: 9px;
  font-size: 12.8px; line-height: 1.4; color: var(--muted-light);
  transition: color .25s var(--ease);
}
.reqs li i {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 1.5px solid rgba(15,20,33,.18); background: #fff;
  display: grid; place-items: center;
  transition: all .25s var(--ease);
}
.reqs li i svg { width: 9px; height: 9px; color: #fff; opacity: 0; transform: scale(.5); transition: all .2s var(--ease); }
.reqs li.is-ok { color: var(--muted); }
.reqs li.is-ok i { background: var(--green); border-color: var(--green); }
.reqs li.is-ok i svg { opacity: 1; transform: scale(1); }
.reqs li.is-bad { color: #8E2F2F; }
.reqs li.is-bad i { border-color: rgba(214,69,69,.5); background: rgba(214,69,69,.08); }

.match {
  display: none; align-items: center; gap: 7px;
  margin: -6px 0 18px; font-size: 12.8px; font-weight: 500;
}
.match.is-visible { display: flex; }
.match svg { width: 14px; height: 14px; flex: none; }
.match--ok { color: #0A8F5F; }
.match--bad { color: #8E2F2F; }

/* Primary action — used as both <button> and <a> */
.submit-btn {
  width: 100%; height: 54px; border: 0; border-radius: 12px; cursor: pointer;
  font-family: inherit; font-size: 15px; font-weight: 600; color: #fff;
  background: var(--blue); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: background .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease), opacity .25s var(--ease);
  box-shadow: 0 8px 18px -6px rgba(44,113,246,.5);
}
.submit-btn svg { width: 17px; height: 17px; transition: transform .3s var(--ease); }
.submit-btn:hover:not(:disabled) { background: var(--blue-deep); transform: translateY(-1px); box-shadow: 0 12px 24px -8px rgba(44,113,246,.55); }
.submit-btn:hover:not(:disabled) svg { transform: translateX(3px); }
.submit-btn:active:not(:disabled) { transform: translateY(0); }
.submit-btn:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }

/* Completion badge (password created) */
.done-badge {
  width: 58px; height: 58px; border-radius: 50%; margin: 0 0 22px;
  display: grid; place-items: center;
  background: rgba(0,210,135,.12); color: #0A8F5F;
  animation: pop .5s var(--ease) .15s both;
}
.done-badge svg { width: 27px; height: 27px; }

.after { margin-top: 24px; font-size: 13.5px; color: var(--muted); }
.form-col__foot {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted-light); padding-top: 8px;
}
.form-col__foot a { color: var(--muted-light); text-decoration: none; margin-left: 18px; transition: color .25s var(--ease); }
.form-col__foot a:hover { color: var(--blue); }

/* ---------- Animations & responsive ---------- */
@keyframes drift { from { transform: translate3d(0,0,0); } to { transform: translate3d(calc(var(--grid) * -1),calc(var(--grid) * -1),0); } }
@keyframes float-a { 0%, 100% { transform: translate3d(0,0,0) scale(1); } 50% { transform: translate3d(5vmin,4vmin,0) scale(1.1); } }
@keyframes float-b { 0%, 100% { transform: translate3d(0,0,0) scale(1.06); } 50% { transform: translate3d(-4vmin,-5vmin,0) scale(1); } }
@keyframes sway { 0%, 100% { transform: translate3d(0,0,0); } 50% { transform: translate3d(-2.5%,-1.6%,0); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px rgba(0,210,135,.22); } 50% { box-shadow: 0 0 0 9px rgba(0,210,135,0); } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }

@media (max-width: 1180px) { .shell { grid-template-columns: 46% 54%; } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; min-height: 0; }
  .notice ~ .shell { min-height: 0; }
  .panel { min-height: 270px; padding: 26px clamp(22px,6vw,40px) 34px; gap: 26px; }
  .panel__shape { clip-path: polygon(0 104%,104% 66%,104% 104%); }
  .panel__shape::after { clip-path: polygon(0 104%,104% 66%,104% 67.4%,0 105.4%); }
  .panel__copy h1 { font-size: 29px; }
  .panel__copy p, .panel__meta { display: none; }
  .form-col { padding: 16px clamp(22px,6vw,40px) 26px; }
  .form-wrap { padding: 20px 0 26px; }
}
@media (max-width: 560px) {
  :root { --grid: 48px; }
  .panel { min-height: 230px; }
  .panel__copy h1 { font-size: 26px; letter-spacing: -.6px; }
  .form-inner h2 { font-size: 29px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
