/* The sign-in pages (allauth/layouts/entrance.html and manage.html: login, sign-up, the 2FA steps, password reset,
   waiting for approval): standalone — no Bootstrap, no app stylesheet — the error pages' look (errors.css): the
   dotted canvas, the brand gradient, CSS-only motion that stops for reduced motion. Light by default; dark when
   chosen in the app (<html data-theme>, static/js/theme.js). The allauth elements (templates/allauth/elements/)
   carry the au-* classes. */

:root {
    --a-bg: #f4f7fc;
    --a-card: #ffffff;
    --a-text: #0f1b3d;
    --a-muted: #5b6785;
    --a-faint: #9aa5bf;
    --a-line: #dfe6f3;
    --a-input: #f8faff;
    --a-brand: #2160f5;
    --a-brand-dark: #1a4fd6;
    --a-cyan: #06b6ff;
    --a-indigo: #6366f1;
    --a-pink: #ec4899;
    --a-green: #10b981;
    --a-amber: #f59e0b;
    --a-red: #e5484d;
    --a-grid: rgba(33, 96, 245, .07);
    --a-shadow: 0 1px 2px rgba(15, 27, 61, .05), 0 24px 60px -20px rgba(33, 96, 245, .28);
    color-scheme: light;
}
:root[data-theme="dark"] {
    --a-bg: #0b1226; --a-card: #121b36; --a-text: #e8eeff; --a-muted: #a3afcf; --a-faint: #6b789c;
    --a-line: #24325a; --a-input: #0e1630; --a-grid: rgba(120, 160, 255, .07);
    --a-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 24px 60px -20px rgba(0, 0, 0, .7);
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

body.au {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    color: var(--a-text);
    background: var(--a-bg);
    -webkit-font-smoothing: antialiased;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
}
.au a { color: var(--a-brand); text-decoration: none; }
.au a:hover { text-decoration: underline; }

/* ---------- the form side ---------- */
.au-side { position: relative; overflow: hidden; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
           background: radial-gradient(circle at 1px 1px, var(--a-grid) 1px, transparent 0) 0 0 / 22px 22px, var(--a-bg); }
.au-blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .28; pointer-events: none; }
.au-blob-1 { width: 360px; height: 360px; background: var(--a-cyan); top: -140px; left: -120px; animation: au-drift 20s ease-in-out infinite; }
.au-blob-2 { width: 300px; height: 300px; background: var(--a-indigo); bottom: -120px; right: -80px; animation: au-drift 24s ease-in-out infinite reverse; }

.au-top { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 24px 32px; }
.au-logo img { height: 30px; width: auto; display: block; }
.au-logo .au-logo-dark { display: none; }
:root[data-theme="dark"] .au-logo .au-logo-light { display: none; }
:root[data-theme="dark"] .au-logo .au-logo-dark { display: block; }
.au .au-back { font-size: 13px; color: var(--a-muted); display: inline-flex; align-items: center; gap: 6px; }
.au-back svg { width: 15px; height: 15px; }

.au-main { position: relative; z-index: 1; flex: 1; display: grid; place-items: center; padding: 8px 32px 40px; }
.au-card { width: 100%; max-width: 440px; background: color-mix(in srgb, var(--a-card) 88%, transparent);
           backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
           border: 1px solid var(--a-line); border-radius: 24px; padding: 36px 34px 30px; box-shadow: var(--a-shadow);
           animation: au-rise .6s cubic-bezier(.2, .8, .2, 1) both; }
.au-card-wide { max-width: 620px; }

.au-kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 16px; padding: 6px 12px 6px 8px; border-radius: 999px;
             background: color-mix(in srgb, var(--a-brand) 9%, transparent); color: var(--a-brand);
             font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.au-kicker i { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-style: normal;
               background: linear-gradient(135deg, var(--a-cyan), var(--a-brand)); color: #fff; font-size: 11px; }
.au-kicker-pulse i { animation: au-pulse 2s ease-in-out infinite; }

.au h1, .au-title { margin: 0 0 8px; font-size: 30px; line-height: 1.12; letter-spacing: -.025em; font-weight: 800; }
.au-hl { background: linear-gradient(90deg, var(--a-brand), var(--a-indigo)); -webkit-background-clip: text;
         background-clip: text; color: transparent; }
.au-sub { margin: 0 0 26px; color: var(--a-muted); line-height: 1.55; }
.au h2.au-h2 { margin: 26px 0 10px; font-size: 16px; font-weight: 700; }
.au p { line-height: 1.6; }
.au-p { color: var(--a-muted); margin: 0 0 16px; }

/* steps of the sign-up (account -> 2FA -> project) */
.au-steps { display: flex; align-items: center; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; font-size: 12px; font-weight: 600; color: var(--a-faint); }
.au-steps li { display: flex; align-items: center; gap: 6px; }
.au-steps li b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px;
                 border: 1.5px solid var(--a-line); background: var(--a-card); }
.au-steps li.on { color: var(--a-text); }
.au-steps li.on b { border-color: transparent; color: #fff; background: linear-gradient(135deg, var(--a-cyan), var(--a-brand)); box-shadow: 0 4px 12px -4px var(--a-brand); }
.au-steps li + li::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: var(--a-line); margin-right: 2px; }

/* fields */
.au-field { margin: 0 0 16px; }
.au-label { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 7px; font-size: 13px; font-weight: 600; color: var(--a-text); }
.au-label a { font-weight: 500; font-size: 12.5px; }
.au-label.au-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.au-input { position: relative; }
.au-input svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--a-faint);
                transition: color .15s ease; pointer-events: none; }
.au-input input, .au input.au-control, .au textarea.au-control {
    width: 100%; height: 50px; padding: 0 14px 0 44px; border-radius: 14px; border: 1.5px solid var(--a-line);
    background: var(--a-input); color: var(--a-text); font: inherit; font-size: 15px; outline: none;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.au input.au-control.au-plain, .au textarea.au-control { padding-left: 14px; }
.au textarea.au-control { height: auto; min-height: 120px; padding-top: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.au-input input::placeholder, .au .au-control::placeholder { color: var(--a-faint); }
.au-input input:hover, .au .au-control:hover { border-color: color-mix(in srgb, var(--a-brand) 30%, var(--a-line)); }
.au-input input:focus, .au .au-control:focus { border-color: var(--a-brand); background: var(--a-card);
                                               box-shadow: 0 0 0 4px color-mix(in srgb, var(--a-brand) 16%, transparent); }
.au-input:focus-within svg { color: var(--a-brand); }
/* over the hover and focus borders above by specificity */
.au .au-invalid input, .au .au-invalid input:hover, .au .au-invalid input:focus,
.au .au-invalid .au-control, .au .au-invalid .au-control:hover, .au .au-invalid .au-control:focus { border-color: var(--a-red); }
.au-err { margin: 6px 0 0; font-size: 13px; color: var(--a-red); }
.au-help { margin: 6px 0 0; font-size: 12.5px; color: var(--a-muted); }
.au-help ul { margin: 4px 0 0; padding-left: 18px; }
.au-check { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 14px; color: var(--a-muted); cursor: pointer; }
.au-check input { width: 18px; height: 18px; accent-color: var(--a-brand); margin: 0; }
/* the 2FA code: big digits */
.au input[autocomplete="one-time-code"] { font: 600 22px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .4em; text-align: center; padding-left: 14px; }

/* buttons */
.au-btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
          height: 48px; padding: 0 22px; border-radius: 14px; border: 1.5px solid transparent; font: inherit; font-size: 15px;
          font-weight: 650; cursor: pointer; transition: transform .15s ease, box-shadow .2s ease, border-color .15s ease; }
.au-btn svg { width: 18px; height: 18px; }
/* buttons are links too: over .au a and .au a:hover by specificity, not !important */
.au .au-btn, .au .au-btn:hover { text-decoration: none; }
.au .au-btn-primary { color: #fff; background: linear-gradient(135deg, var(--a-brand) 0%, var(--a-indigo) 100%);
                  box-shadow: 0 12px 26px -10px rgba(33, 96, 245, .7); }
.au-btn-primary::after { content: ""; position: absolute; inset: 0; transform: translateX(-120%);
                         background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .35) 50%, transparent 80%); }
.au-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 30px -10px rgba(33, 96, 245, .8); }
.au-btn-primary:hover::after { animation: au-shine .9s ease; }
.au-btn-primary:active { transform: translateY(0); }
.au .au-btn-ghost { color: var(--a-text); background: var(--a-card); border-color: var(--a-line); }
.au-btn-ghost:hover { border-color: color-mix(in srgb, var(--a-brand) 45%, var(--a-line)); transform: translateY(-1px); }
.au .au-btn-danger { color: #fff; background: var(--a-red); }
.au .au-btn-link { height: auto; padding: 0; background: none; color: var(--a-brand); font-weight: 600; }
.au-btn-block { width: 100%; }
.au-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--a-brand) 55%, transparent); outline-offset: 2px; }
.au-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.au-actions-col { flex-direction: column; align-items: stretch; }

.au-or { display: flex; align-items: center; gap: 12px; margin: 22px 0 18px; font-size: 12px; color: var(--a-faint); text-transform: uppercase; letter-spacing: .08em; }
.au-or::before, .au-or::after { content: ""; flex: 1; height: 1px; background: var(--a-line); }
.au-hr { border: 0; height: 1px; background: var(--a-line); margin: 22px 0; }
.au-alt { text-align: center; color: var(--a-muted); font-size: 14px; margin: 0; }
.au-alt a { font-weight: 650; }

.au-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; margin: 0 0 18px; font-size: 14px; line-height: 1.5;
            background: color-mix(in srgb, var(--a-brand) 8%, var(--a-card)); border: 1px solid color-mix(in srgb, var(--a-brand) 22%, transparent); }
.au-alert-error { background: color-mix(in srgb, var(--a-red) 8%, var(--a-card)); border-color: color-mix(in srgb, var(--a-red) 30%, transparent); color: var(--a-red); }
.au-alert-success { background: color-mix(in srgb, var(--a-green) 9%, var(--a-card)); border-color: color-mix(in srgb, var(--a-green) 30%, transparent); }
.au-alert-warning { background: color-mix(in srgb, var(--a-amber) 10%, var(--a-card)); border-color: color-mix(in srgb, var(--a-amber) 35%, transparent); }

.au-trust { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 20px 0 0; font-size: 12.5px; color: var(--a-faint); }
.au-trust svg { width: 15px; height: 15px; color: var(--a-green); }

.au-badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--a-input); border: 1px solid var(--a-line); }
.au-panel { border: 1px solid var(--a-line); border-radius: 16px; padding: 18px; margin: 0 0 16px; background: var(--a-input); }
.au-panel h3 { margin: 0 0 8px; font-size: 15px; }
.au-img { display: block; margin: 12px auto 18px; max-width: 220px; padding: 10px; border-radius: 16px; background: #fff; border: 1px solid var(--a-line); }
.au code, .au pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.au-foot { position: relative; z-index: 1; padding: 0 32px 22px; font-size: 12px; color: var(--a-faint); }

/* ---------- the showcase side: a live cockpit ---------- */
.au-show { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; padding: 56px 64px; color: #e8eeff;
           background: radial-gradient(1200px 600px at 100% 0%, rgba(6, 182, 255, .35), transparent 60%),
                       radial-gradient(900px 600px at 0% 100%, rgba(99, 102, 241, .45), transparent 60%),
                       linear-gradient(160deg, #0b2a6b 0%, #0a1740 55%, #090f2a 100%); }
.au-show::before { content: ""; position: absolute; inset: 0; opacity: .5;
                   background: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px) 0 0 / 44px 44px,
                               linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px) 0 0 / 44px 44px;
                   mask-image: radial-gradient(ellipse at 60% 40%, #000 30%, transparent 75%);
                   -webkit-mask-image: radial-gradient(ellipse at 60% 40%, #000 30%, transparent 75%); }
.au-aurora { position: absolute; inset: -20%; pointer-events: none;
             background: conic-gradient(from 0deg at 60% 40%, transparent 0deg, rgba(6, 182, 255, .18) 60deg, transparent 120deg,
                                        rgba(236, 72, 153, .14) 200deg, transparent 260deg);
             filter: blur(40px); animation: au-spin 30s linear infinite; }
.au-show > * { position: relative; }
.au-show h2 { margin: 0 0 14px; font-size: clamp(30px, 3.2vw, 44px); line-height: 1.08; letter-spacing: -.03em; font-weight: 800; max-width: 15em; }
.au-show h2 span { background: linear-gradient(90deg, #7dd3fc, #a5b4fc 50%, #f9a8d4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.au-show > p { margin: 0 0 34px; color: #b8c4e8; font-size: 16px; line-height: 1.6; max-width: 32em; }

.au-board { position: relative; height: 330px; max-width: 560px; }
.au-tile { position: absolute; border-radius: 18px; padding: 16px 18px; background: rgba(255, 255, 255, .07);
           border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
           box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .6); }
.au-tile small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #93a3d1; margin: 0 0 6px; }

/* a keyword climbing: #14 -> #3 */
.au-rank { top: 0; left: 0; width: 290px; animation: au-float 7s ease-in-out infinite; }
.au-rank-row { display: flex; align-items: center; gap: 12px; }
.au-rank-kw { flex: 1; min-width: 0; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.au-rank-pos { position: relative; height: 34px; width: 54px; overflow: hidden; border-radius: 10px; background: rgba(16, 185, 129, .16); color: #6ee7b7; font-weight: 800; font-size: 18px; }
.au-rank-pos span { position: absolute; inset: 0; display: grid; place-items: center; animation: au-roll 6s ease-in-out infinite; }
.au-rank-pos span:nth-child(1) { animation-delay: 0s; }
.au-rank-pos span:nth-child(2) { animation-delay: 2s; }
.au-rank-pos span:nth-child(3) { animation-delay: 4s; }
.au-delta { font-size: 12px; font-weight: 700; color: #6ee7b7; }

/* the visibility chart drawing itself */
.au-chart { top: 96px; left: 70px; width: 330px; animation: au-float 8s ease-in-out .8s infinite; }
.au-chart svg { display: block; width: 100%; height: 92px; overflow: visible; }
.au-chart .au-line { fill: none; stroke: url(#au-g-line); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round;
                     stroke-dasharray: 520; stroke-dashoffset: 520; animation: au-draw 5s ease-in-out infinite; }
.au-chart .au-area { fill: url(#au-g-area); opacity: .9; }
.au-chart .au-dot { fill: #7dd3fc; animation: au-pulse 2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.au-chart-top { display: flex; align-items: baseline; justify-content: space-between; }
.au-chart-top b { font-size: 22px; letter-spacing: -.02em; }

/* the site health ring */
.au-health { top: 30px; right: 0; width: 150px; text-align: center; animation: au-float 9s ease-in-out .4s infinite; }
.au-health svg { width: 96px; height: 96px; display: block; margin: 2px auto 0; transform: rotate(-90deg); }
.au-health .au-ring-bg { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 10; }
.au-health .au-ring { fill: none; stroke: url(#au-g-ring); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 264;
                      stroke-dashoffset: 264; animation: au-ring 5s ease-out infinite; }
.au-health b { display: block; margin-top: -62px; margin-bottom: 30px; font-size: 26px; }

/* the tasks pill and the backlinks chip */
.au-task { bottom: 26px; left: 0; display: flex; align-items: center; gap: 10px; padding: 12px 16px; animation: au-float 6s ease-in-out 1.2s infinite; }
.au-task i { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-style: normal; background: linear-gradient(135deg, #34d399, #10b981); color: #052e1f; font-weight: 900; }
.au-task span { font-size: 13.5px; font-weight: 600; }
.au-links { bottom: 0; right: 30px; display: flex; align-items: center; gap: 10px; padding: 12px 16px; animation: au-float 7.5s ease-in-out 2s infinite; }
.au-links b { font-size: 20px; }
.au-links em { font-style: normal; font-size: 12px; color: #6ee7b7; font-weight: 700; }

.au-mods { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 34px; padding: 0; list-style: none; }
.au-mods li { padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: #cfd8f6;
              background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); }

/* motion */
@keyframes au-drift { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(40px, 30px) scale(1.1); } }
@keyframes au-rise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes au-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes au-spin { to { transform: rotate(360deg); } }
@keyframes au-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.18); opacity: .8; } }
@keyframes au-shine { to { transform: translateX(120%); } }
@keyframes au-draw { 0% { stroke-dashoffset: 520; } 55%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -520; } }
@keyframes au-ring { 0% { stroke-dashoffset: 264; } 60%, 100% { stroke-dashoffset: 21; } }
@keyframes au-roll { 0% { transform: translateY(100%); opacity: 0; } 8%, 30% { transform: translateY(0); opacity: 1; }
                     38%, 100% { transform: translateY(-100%); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
    /* stylelint-disable-next-line declaration-no-important -- the reduced-motion reset must beat every rule */
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .au-chart .au-line { stroke-dashoffset: 0; }
    .au-health .au-ring { stroke-dashoffset: 21; }
    .au-rank-pos span { opacity: 0; } .au-rank-pos span:nth-child(3) { opacity: 1; transform: none; }
}

/* narrow screens: the form only, the cockpit gone */
@media (max-width: 1020px) {
    body.au { grid-template-columns: minmax(0, 1fr); }
    .au-show { display: none; }
}
@media (max-width: 520px) {
    .au-top { padding: 16px; }
    .au-main { padding: 0 12px 28px; }
    .au-card { padding: 28px 20px 24px; border-radius: 20px; }
    .au h1, .au-title { font-size: 26px; }
    .au-foot { padding: 0 16px 18px; }
}
.au-defs { position: absolute; }
.au input[autocomplete="one-time-code"]::placeholder { letter-spacing: .02em; font-size: 16px; font-weight: 500; }
.au form + .au-p { margin-top: 18px; }
