/* ===========================================================================
   innosys - authentication screens
   ---------------------------------------------------------------------------
   Replaces the stock template's auth chrome (a black 400px slab + a garage
   photograph, both wrong for a billing product) with a two-panel layout:
   an animated brand stage on the left, a focused sign-in card on the right.

   Motion is CSS/SVG only - no video file, so it stays crisp at any resolution,
   costs ~0 KB of bandwidth, and can be switched off wholesale by the reduced
   motion guard at the bottom of this file.
   ======================================================================== */

/* ---- 1. neutralise the old template chrome on every auth page ---------- */
.auth-main::before { display: none !important; }
.auth-main::after {
    background: linear-gradient(135deg, #0B1020 0%, #1A1440 45%, #2A123F 100%) !important;
}

/* ======================================================================== */
/*  2. login stage                                                          */
/* ======================================================================== */
.innosys-auth {
    position: fixed;
    inset: 0;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Arial, sans-serif;
    overflow: hidden;
    z-index: 5;
}

/* ---------------- left: brand stage ------------------------------------ */
.ia-stage {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0B1020 0%, #171238 48%, #2B0F3D 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4vh 5vw;
    color: #fff;
}

/* drifting colour clouds */
.ia-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .55;
    will-change: transform;
    pointer-events: none;
}
.ia-blob.b1 { width: 42vw; height: 42vw; left: -12vw; top: -14vw;  background: #22D3EE; animation: iaDrift1 22s ease-in-out infinite; }
.ia-blob.b2 { width: 38vw; height: 38vw; right: -10vw; top: 24vh;  background: #C026F0; animation: iaDrift2 26s ease-in-out infinite; }
.ia-blob.b3 { width: 30vw; height: 30vw; left: 22vw; bottom: -14vw; background: #6D5AE6; animation: iaDrift3 30s ease-in-out infinite; }

@keyframes iaDrift1 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(6vw, 5vh) scale(1.14); } }
@keyframes iaDrift2 { 0%,100% { transform: translate(0,0) scale(1.05); } 50% { transform: translate(-7vw, -6vh) scale(.9); } }
@keyframes iaDrift3 { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(4vw, -7vh) scale(1.2); } }

/* faint grid, gives the gradient some structure */
.ia-grid {
    position: absolute; inset: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: radial-gradient(ellipse at 35% 45%, #000 25%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse at 35% 45%, #000 25%, transparent 78%);
}

/* hexagons rising in the background, echoing the logo mark */
.ia-hexes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.ia-hex {
    position: absolute;
    bottom: -140px;
    opacity: 0;
    animation: iaRise linear infinite;
    will-change: transform, opacity;
}
.ia-hex svg { display: block; }
@keyframes iaRise {
    0%   { transform: translateY(0) rotate(0deg);       opacity: 0; }
    12%  { opacity: .5; }
    88%  { opacity: .5; }
    100% { transform: translateY(-118vh) rotate(190deg); opacity: 0; }
}

/* ---------------- stage content ---------------------------------------- */
.ia-stage-inner { position: relative; z-index: 3; max-width: 560px; }

.ia-logo { width: min(330px, 62%); height: auto; display: block; margin-bottom: 30px;
           animation: iaFadeUp .7s cubic-bezier(.22,.9,.3,1) both; }

.ia-kicker {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .74rem; font-weight: 700; letter-spacing: 2.6px; text-transform: uppercase;
    color: #A5F3FC; background: rgba(34,211,238,.10);
    border: 1px solid rgba(34,211,238,.28); border-radius: 999px; padding: 6px 14px;
    margin-bottom: 18px;
    animation: iaFadeUp .7s .05s cubic-bezier(.22,.9,.3,1) both;
}
.ia-kicker .dot { width: 7px; height: 7px; border-radius: 50%; background: #22D3EE; animation: iaPulse 2s ease-in-out infinite; }
@keyframes iaPulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .45; } }

.ia-title {
    font-size: clamp(2.1rem, 3.9vw, 3.4rem); font-weight: 800; line-height: 1.06;
    margin: 0 0 14px; letter-spacing: -1.4px;
    animation: iaFadeUp .7s .12s cubic-bezier(.22,.9,.3,1) both;
}
.ia-title .grad {
    background: linear-gradient(100deg, #22D3EE 0%, #A78BFA 45%, #E879F9 100%);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ia-sub {
    font-size: 1.02rem; line-height: 1.65; color: rgba(255,255,255,.72);
    margin: 0 0 30px; max-width: 46ch;
    animation: iaFadeUp .7s .2s cubic-bezier(.22,.9,.3,1) both;
}

/* feature chips */
.ia-features { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 34px; }
.ia-feature {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: .83rem; font-weight: 600; color: rgba(255,255,255,.9);
    background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.13);
    border-radius: 10px; padding: 8px 13px;
    backdrop-filter: blur(8px);
    animation: iaFadeUp .55s both;
    transition: transform .22s ease, background .22s ease, border-color .22s ease;
}
.ia-feature:hover { transform: translateY(-3px); background: rgba(255,255,255,.13); border-color: rgba(34,211,238,.45); }
.ia-feature i { color: #67E8F9; font-size: .95rem; }
.ia-feature:nth-child(1) { animation-delay: .28s; }
.ia-feature:nth-child(2) { animation-delay: .34s; }
.ia-feature:nth-child(3) { animation-delay: .40s; }
.ia-feature:nth-child(4) { animation-delay: .46s; }
.ia-feature:nth-child(5) { animation-delay: .52s; }
.ia-feature:nth-child(6) { animation-delay: .58s; }

/* the animated "document being issued" motif */
.ia-doc { animation: iaFadeUp .8s .62s cubic-bezier(.22,.9,.3,1) both; }
.ia-doc .ln       { stroke-dasharray: 200; stroke-dashoffset: 200; animation: iaDraw 5.5s ease-in-out infinite; }
.ia-doc .ln:nth-of-type(2) { animation-delay: .35s; }
.ia-doc .ln:nth-of-type(3) { animation-delay: .70s; }
.ia-doc .ln:nth-of-type(4) { animation-delay: 1.05s; }
.ia-doc .tick     { stroke-dasharray: 40; stroke-dashoffset: 40; animation: iaTick 5.5s ease-in-out infinite; }
.ia-doc .stamp    { transform-origin: 190px 96px; animation: iaStamp 5.5s ease-in-out infinite; }
@keyframes iaDraw  { 0%,6% { stroke-dashoffset: 200; } 34%,72% { stroke-dashoffset: 0; } 92%,100% { stroke-dashoffset: 200; } }
@keyframes iaTick  { 0%,52% { stroke-dashoffset: 40; } 68%,86% { stroke-dashoffset: 0; } 96%,100% { stroke-dashoffset: 40; } }
@keyframes iaStamp { 0%,54% { transform: scale(.4); opacity: 0; } 66% { transform: scale(1.12); opacity: 1; } 74%,88% { transform: scale(1); opacity: 1; } 97%,100% { transform: scale(1); opacity: 0; } }

@keyframes iaFadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* ---------------- right: sign-in panel --------------------------------- */
.ia-panel {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    background: #fff;
    padding: 4vh 3vw;
    overflow-y: auto;
}
.ia-card { width: 100%; max-width: 400px; animation: iaFadeUp .65s .1s cubic-bezier(.22,.9,.3,1) both; }

.ia-card-logo { display: none; }          /* shown only on small screens */

.ia-welcome { font-size: 1.62rem; font-weight: 800; color: #12121A; margin: 0 0 6px; letter-spacing: -.5px; }
.ia-welcome-sub { font-size: .92rem; color: #6b7280; margin: 0 0 28px; }

/* floating-label fields */
.ia-field { position: relative; margin-bottom: 18px; }
.ia-field input {
    width: 100%; height: 54px;
    padding: 22px 44px 8px 15px;
    font-size: .96rem; color: #12121A;
    background: #F8F8FC;
    border: 1.5px solid #E5E3F0; border-radius: 11px;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.ia-field input:focus {
    background: #fff;
    border-color: #6D5AE6;
    box-shadow: 0 0 0 4px rgba(109,90,230,.14);
}
.ia-field label {
    position: absolute; left: 15px; top: 17px;
    font-size: .95rem; color: #9095A6; pointer-events: none;
    transition: all .18s cubic-bezier(.22,.9,.3,1);
}
.ia-field input:focus + label,
.ia-field input:not(:placeholder-shown) + label {
    top: 7px; font-size: .70rem; font-weight: 700;
    letter-spacing: .5px; text-transform: uppercase; color: #6D5AE6;
}
.ia-field .ia-ico {
    position: absolute; right: 15px; top: 50%; transform: translateY(-50%);
    color: #B6BAC8; font-size: 1rem; transition: color .2s ease;
}
.ia-field input:focus ~ .ia-ico { color: #6D5AE6; }
.ia-field .ia-eye { cursor: pointer; pointer-events: auto; }
.ia-field .ia-eye:hover { color: #6D5AE6; }

/* remember / forgot row */
.ia-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 22px; }
.ia-check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: .88rem; color: #4b5563; }
.ia-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.ia-check .box {
    width: 19px; height: 19px; border-radius: 6px;
    border: 1.5px solid #D4D2E3; background: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    transition: all .18s ease; flex: 0 0 auto;
}
.ia-check .box::after {
    content: ''; width: 5px; height: 9px;
    border: solid #fff; border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0); transition: transform .18s ease; margin-top: -2px;
}
.ia-check input:checked + .box { background: linear-gradient(135deg,#22D3EE,#6D5AE6); border-color: transparent; }
.ia-check input:checked + .box::after { transform: rotate(45deg) scale(1); }
.ia-check input:focus-visible + .box { box-shadow: 0 0 0 4px rgba(109,90,230,.18); }

.ia-link { font-size: .87rem; font-weight: 600; color: #6D5AE6; text-decoration: none; }
.ia-link:hover { color: #C026F0; text-decoration: underline; }

/* submit */
.ia-submit {
    position: relative; overflow: hidden;
    width: 100%; height: 52px; border: 0; border-radius: 11px;
    font-size: 1rem; font-weight: 700; color: #fff; cursor: pointer;
    background: linear-gradient(135deg, #22D3EE 0%, #6D5AE6 52%, #C026F0 100%);
    background-size: 200% 100%;
    box-shadow: 0 6px 18px rgba(109,90,230,.32);
    transition: background-position .5s ease, transform .16s ease, box-shadow .22s ease;
}
.ia-submit:hover  { background-position: 100% 0; transform: translateY(-2px); box-shadow: 0 10px 26px rgba(109,90,230,.42); }
.ia-submit:active { transform: translateY(0); }
.ia-submit::after {                       /* sweeping highlight */
    content: ''; position: absolute; top: 0; left: -60%; width: 45%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
    transform: skewX(-22deg);
    animation: iaSweep 3.6s ease-in-out infinite;
}
@keyframes iaSweep { 0%, 62% { left: -60%; } 92%, 100% { left: 120%; } }

.ia-submit.is-busy { pointer-events: none; opacity: .82; }
.ia-submit .spin { display: none; margin-right: 8px; }
.ia-submit.is-busy .spin { display: inline-block; animation: iaSpin .7s linear infinite; }
.ia-submit.is-busy .lbl  { opacity: .9; }
@keyframes iaSpin { to { transform: rotate(360deg); } }

.ia-foot { margin-top: 22px; text-align: center; font-size: .88rem; color: #6b7280; }
.ia-foot a { font-weight: 700; color: #6D5AE6; text-decoration: none; }
.ia-foot a:hover { color: #C026F0; text-decoration: underline; }

.ia-credit { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; font-size: .78rem; color: #9095A6; }
.ia-credit a { color: #6D5AE6; font-weight: 600; text-decoration: none; }
.ia-credit a:hover { color: #C026F0; text-decoration: underline; }

/* ---------------- responsive ------------------------------------------- */
@media (max-width: 991px) {
    .innosys-auth { grid-template-columns: 1fr; }

    /* The stage stops being a column and becomes the full-screen animated
       backdrop; the sign-in card then floats on top of it. Same blobs, grid
       and rising hexagons as desktop, so phones get the motion too. */
    .ia-stage {
        position: absolute; inset: 0;
        padding: 0;
        z-index: 0;
        justify-content: flex-start;
    }
    .ia-stage-inner { display: none; }        /* desktop copy is too tall for a phone */

    .ia-panel {
        position: relative; z-index: 2;
        background: transparent;
        padding: 20px 18px 52px;        /* bottom room for the pinned credit */
        flex-direction: column;         /* brand header stacks above the card */
        align-items: center;
        justify-content: flex-start;
    }
    .ia-panel > .ia-card { width: 100%; max-width: 420px; }

    /* Vertically centre brand + card as one block.
       Auto margins are used rather than justify-content:center because they
       centre when there is spare room but collapse when the content is taller
       than the screen - centring would clip the top of the card on short
       phones and make it unreachable. */
    .ia-mobile-brand      { margin-top: auto; }
    .ia-panel > .ia-card  { margin-bottom: auto; }

    /* Compact brand header: logo above the badge, both centred. */
    .ia-mobile-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
        margin-bottom: 18px;
        text-align: center;
        animation: iaFadeUp .6s cubic-bezier(.22,.9,.3,1) both;
    }
    .ia-mobile-brand img { width: min(200px, 56vw); height: auto; }
    .ia-mobile-brand .ia-kicker { margin: 0; font-size: .68rem; letter-spacing: 2.2px; padding: 5px 12px; }

    .ia-card  { background: rgba(255,255,255,.97); border-radius: 18px; padding: 28px 22px;
                box-shadow: 0 22px 60px rgba(0,0,0,.45); backdrop-filter: blur(6px); }
    .ia-card-logo { display: none; }          /* the mobile brand header covers this */

    .ia-credit { color: rgba(255,255,255,.62); }
    .ia-credit a { color: #A78BFA; }

    /* Fewer, gentler clouds so low-end phones stay smooth. */
    .ia-blob { filter: blur(54px); opacity: .5; }
    .ia-blob.b1 { width: 78vw; height: 78vw; left: -26vw; top: -18vh; }
    .ia-blob.b2 { width: 72vw; height: 72vw; right: -24vw; top: 30vh; }
    .ia-blob.b3 { display: none; }
}

@media (max-width: 400px) {
    .ia-welcome { font-size: 1.4rem; }
    .ia-card { padding: 24px 18px; }
    .ia-mobile-brand img { width: 180px; }
}

/* Desktop keeps the brand inside the stage, not above the card. */
@media (min-width: 992px) {
    .ia-mobile-brand { display: none; }
}

/* ---------------- accessibility ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .innosys-auth *,
    .innosys-auth *::before,
    .innosys-auth *::after {
        animation: none !important;
        transition-duration: .01ms !important;
    }
    .ia-doc .ln, .ia-doc .tick { stroke-dashoffset: 0 !important; }
    .ia-doc .stamp { transform: scale(1) !important; opacity: 1 !important; }
    .ia-hex { opacity: .35 !important; }
}
