/* ZenflowCRM sign-in pages.

   The same layout ZenflowHR's Account area uses, with its artwork: a blue field with soft corner
   curves, the infinity mark riding the top-right corner of the card, and one 750px card split
   into an illustration panel and the form. The card is always light - it sits on its own colour
   field, so it does not follow the platform's dark palette.

   Two things here are easy to get wrong, and were:

   - HR sets `html { font-size: 14px }`, so every rem in its stylesheets is 14px-based. This page
     cannot change the root size without moving the rest of the app, so the sizes borrowed from it
     are written in px, already converted.
   - HR's brand blue and its control blue are different colours. #1870D1 paints the page and the
     wordmark; #246DFF paints buttons, links and anything selected. */

:root {
    /* The brand pair (--blue / --ocean-blue in HR) paints the page and the wordmark. */
    --auth-blue: #1870d1;
    --auth-cyan: #07c3d6;

    /* Controls use the semantic primary, which is a different blue from the brand one. */
    --auth-primary: #246dff;
    --auth-link: #246dff;

    --auth-ink: #1e1e1e;
    --auth-muted: #6b7280;
    --auth-text-muted: #9ca3af;
    --auth-field: #f5f5f5;
    --auth-border: #e5e7eb;
    --auth-section: #f9fafb;
}

.auth-bg {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: hidden;
    padding: 40px 16px;
    padding-top: calc(40px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(40px + env(safe-area-inset-bottom, 0px));
    background: radial-gradient(50% 88.03% at 50% 50%, var(--auth-cyan) 0%, var(--auth-blue) 100%);
    font-family: "Inter", sans-serif;
    font-size: 14px;
}

/* Decoration only, and never over the card. */
.curve-img {
    position: absolute;
    width: 240px;
    pointer-events: none;
    user-select: none;
}

.top-left-img { top: 0; left: -100px; width: 700px; }
.top-right-img { top: 0; right: 0; width: 160px; }
.bottom-left-img { bottom: 0; left: 0; width: 610px; }
.bottom-right-img { bottom: 0; right: 0; width: 580px; }

.auth-container {
    position: relative;
    z-index: 99;
    display: flex;
    justify-content: space-between;
    width: 750px;
    max-width: 100%;
}

/* The infinity mark deliberately overhangs the card's top-right corner. */
.loop-img {
    position: absolute;
    top: -18%;
    right: -12%;
    width: 16%;
    pointer-events: none;
}

.loop-img img { width: 100%; }

/* --- Illustration panel --------------------------------------------------------------------- */

.left-form-box {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40%;
    padding: 106px 22px;
    overflow: hidden;
    background: #a7c7e7;
    border-top-left-radius: 40px;
    border-bottom-left-radius: 40px;
}

.left-form-box img { position: absolute; }

.left-form-box .login-img {
    width: 290px;
    max-width: none;
    left: 50%;
    transform: translate(-40%, 0);
}

.left-form-box .wave-bg-left { left: 0; top: 0; height: 65%; }
.left-form-box .wave-bg-right { right: 0; top: 0; width: 34%; height: 100%; }

/* --- Form panel ----------------------------------------------------------------------------- */

.form-box {
    width: 60%;
    background: #fff;
    padding: 26px 46px;
    border-top-right-radius: 40px;
    border-bottom-right-radius: 40px;
    color: var(--auth-ink);
}

.form-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
}

.auth-logo {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    flex-shrink: 0;
}

.auth-logo img { width: 34px; height: 34px; }

/* HR draws its wordmark as one 135x34 SVG, where the letters land at about 12.5px and sit heavier
   than Inter 700. Measured against it, 900 covers the same amount of ink. */
.auth-logo-text {
    font-size: 13.3px;
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 1;
    color: var(--auth-blue);
}

/* HR sets the two words almost flush, so this is 2px, not a word space. */
.auth-logo-text span {
    margin-left: 5px;
    color: var(--auth-cyan);
}

.form-head {
    margin-bottom: 27px;
    clear: both;
}

.form-head .title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 48px;
    color: var(--auth-ink);
}

.form-head .subtitle {
    margin: 0 0 4px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--auth-muted);
}

/* --- Fields ---------------------------------------------------------------------------------
   HR's login page overrides its own base spacing further down its stylesheet: 6px between
   fields and 40px inputs, not the 18px and 50px the shared rules set. */

.inputfield { position: relative; margin-bottom: 6px; }

.inputfield > label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 500;
    line-height: 26px;
    color: var(--auth-ink);
}

.input-box { position: relative; }

.inputfield input[type="text"],
.inputfield input[type="email"],
.inputfield input[type="password"],
.inputfield input[type="tel"] {
    width: 100%;
    height: 40px;
    border: 1px solid transparent;
    border-radius: 15px;
    background: var(--auth-field);
    padding: 10px 62px 10px 22px;
    font-family: inherit;
    font-size: 14px;
    color: var(--auth-ink);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.inputfield input::placeholder { color: #9aa3ad; }

.inputfield input:focus {
    outline: none;
    background: #fff;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgb(36 109 255 / 14%);
}

.inputfield .icon {
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translate(0, -50%);
    width: 18px;
    pointer-events: none;
}

.inputfield .icon img { width: 100%; display: block; }

.toggle-visibility {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #78828f;
    cursor: pointer;
}

.toggle-visibility:hover { color: var(--auth-ink); background: #ececec; }

.toggle-visibility:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 1px;
}

.code-input {
    font-family: var(--mono);
    font-size: 21px;
    letter-spacing: 8px;
    text-align: center;
    padding-right: 22px !important;
}

/* --- Remember me and forgot password -----------------------------------------------------------
   The "gooey" checkbox from HR: a grey ring that fills cyan and splashes outward, with the tick
   drawn on by animating a dash offset. The blur filter in the markup is what makes the splash
   read as one blob rather than six separate dots. */

.action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.rmb .checkbox-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
}

.rmb .checkbox-text {
    font-size: 14px;
    font-weight: 500;
    line-height: 26px;
    color: var(--auth-ink);
    white-space: nowrap;
}

.checkbox-wrapper {
    position: relative;
    display: block;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.checkbox-wrapper > svg {
    position: absolute;
    top: -130%;
    left: -170%;
    width: 110px;
    pointer-events: none;
}

.checkbox-wrapper .cbx {
    display: block;
    width: 24px;
    height: 24px;
}

.checkbox-wrapper .cbx input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    position: absolute;
    top: 5px;
    left: 4px;
    width: 16px;
    height: 16px;
    margin: 0;
    border: 2px solid #bfbfc0;
    border-radius: 50%;
    cursor: pointer;
}

.checkbox-wrapper .cbx input[type="checkbox"]:focus { outline: 0; }

.checkbox-wrapper .cbx input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--auth-primary);
    outline-offset: 3px;
}

.checkbox-wrapper .cbx label {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    margin: 0;
    background: none;
    border-radius: 50%;
    pointer-events: none;
}

.checkbox-wrapper .cbx > svg {
    position: absolute;
    top: 5px;
    left: 7px;
    z-index: 1;
    width: 10px;
    pointer-events: none;
}

.checkbox-wrapper .cbx > svg path {
    stroke: #fff;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 19;
    stroke-dashoffset: 19;
    transition: stroke-dashoffset 0.3s ease;
    transition-delay: 0.2s;
}

.checkbox-wrapper .cbx input:checked + label { animation: splash 0.6s ease forwards; }
.checkbox-wrapper .cbx input:checked + label + svg path { stroke-dashoffset: 0; }

@keyframes splash {
    40% {
        background: var(--auth-cyan);
        box-shadow: 0 -18px 0 -8px var(--auth-cyan), 16px -8px 0 -8px var(--auth-cyan),
            16px 8px 0 -8px var(--auth-cyan), 0 18px 0 -8px var(--auth-cyan),
            -16px 8px 0 -8px var(--auth-cyan), -16px -8px 0 -8px var(--auth-cyan);
    }

    100% {
        background: var(--auth-cyan);
        box-shadow: 0 -36px 0 -10px transparent, 32px -16px 0 -10px transparent,
            32px 16px 0 -10px transparent, 0 36px 0 -10px transparent,
            -32px 16px 0 -10px transparent, -32px -16px 0 -10px transparent;
    }
}

.psd a,
.link-button {
    padding: 0;
    border: none;
    background: none;
    font-family: inherit;
    font-weight: 500;
    font-size: 14px;
    line-height: 27px;
    color: var(--auth-ink);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.4s ease;
}

.psd a:hover,
.link-button:hover { color: var(--auth-blue); }

/* --- Submit ------------------------------------------------------------------------------------
   HR's medium action button, with its rem sizes converted from a 14px root. */

.submit {
    margin-top: 39px;
    margin-bottom: 20px;
    text-align: center;
}

.action-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px 7px 9px;
    border: none;
    border-radius: 10rem;
    background: var(--auth-primary);
    color: #fff;
    font-family: inherit;
    font-size: 13.125px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

/* HR's primary button goes black on hover, not a darker blue. */
.action-button:hover { background: #000; }
.action-button:hover .button__icon-wrapper { color: #000; }

.action-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgb(36 109 255 / 30%);
}

/* Two arrows live in the wrapper, one parked off-screen. On hover the first leaves to the
   top-right and the copy arrives from the bottom-left, so the arrow appears to fly through.
   overflow:hidden is what keeps the parked copy out of sight. */
.action-button .button__icon-wrapper {
    position: relative;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    color: var(--auth-primary);
    flex-shrink: 0;
    overflow: hidden;
    transition: color 0.3s ease;
}

.action-button .button__icon-svg { width: 8px; }

.action-button .button__icon-svg--copy {
    position: absolute;
    transform: translate(-150%, 150%);
}

.action-button:hover:not(:disabled) .button__icon-svg:first-child {
    transition: transform 0.3s ease-in-out;
    transform: translate(150%, -150%);
}

.action-button:hover:not(:disabled) .button__icon-svg--copy {
    transition: transform 0.3s ease-in-out 0.1s;
    transform: translate(0);
}

.action-button--block { width: 100%; justify-content: center; }

.action-button--ghost {
    background: #fff;
    border: 1px solid var(--auth-border);
    color: var(--auth-ink);
}

.action-button--ghost:hover { background: var(--auth-section); color: var(--auth-ink); }
.action-button--ghost:hover .button__icon-wrapper { color: var(--auth-primary); }

/* --- Social sign-in ------------------------------------------------------------------------------ */

.social-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 34px 0 14px;
    color: var(--auth-text-muted);
    font-size: 11.375px;
}

.social-divider::before,
.social-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--auth-border);
}

/* A second "send me a code" choice under the first, on the two-factor page. */
.challenge-alt { margin-top: 8px; }

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 10.5px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8.75px 14px;
    border: 1px solid var(--auth-border);
    border-radius: 7px;
    background: #fff;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.social-btn:hover { background: var(--auth-section); border-color: #d1d5db; }

/* The icons keep their intrinsic size, as they do on HR's page. */
.social-btn img { display: block; }

.signup-prompt {
    margin: 0;
    text-align: center;
    font-size: 13.125px;
    color: var(--auth-muted);
}

.signup-prompt a,
.signup-prompt .link-button {
    color: var(--auth-link);
    font-size: inherit;
    line-height: inherit;
    font-weight: 500;
    text-decoration: none;
}

.signup-prompt a:hover,
.signup-prompt .link-button:hover { text-decoration: underline; }

.form-box hr { margin: 14px 0; border: 0; border-top: 1px solid var(--auth-border); }

/* --- Signup ---------------------------------------------------------------------------------- */

.name-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--auth-muted);
}

.hint--ok { color: #0f7b4f; }
.hint--bad { color: #b42318; }

@media (max-width: 440px) {
    .name-row { grid-template-columns: 1fr; gap: 0; }
}

/* --- Messages ------------------------------------------------------------------------------------ */

.alert {
    margin-bottom: 16px;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.45;
}

.alert-error { background: #fdecea; color: #b42318; }
.alert-success { background: #e7f6ee; color: #0f7b4f; }

.validation {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    color: #b42318;
}

.validation:empty,
.validation.validation-summary-valid { display: none; }

.validation ul { margin: 0; padding-left: 16px; }

/* Told, not hidden: a control the product does not have yet says so in place rather than
   navigating to a dead page. */
.not-built {
    margin: 10px 0 0;
    padding: 9px 12px;
    border-radius: 10px;
    background: #fdf3e2;
    color: #9a5b00;
    font-size: 12.5px;
    line-height: 1.45;
}

.not-built[hidden] { display: none !important; }

/* --- Narrow screens ------------------------------------------------------------------------------
   Below the split the illustration is the first thing to go: it is decoration, and a form the
   width of a phone matters more. */

@media (max-width: 860px) {
    .auth-container { width: 440px; }
    .left-form-box { display: none; }
    .loop-img { display: none; }

    .form-box {
        width: 100%;
        padding: 26px 24px 30px;
        border-radius: 32px;
    }

    .curve-img { opacity: 0.6; }
}

@media (max-width: 440px) {
    .auth-bg { padding: 20px 12px; }
    .form-box { padding: 22px 18px 26px; }
    .form-header { flex-wrap: wrap; gap: 8px; }
    .form-head .title { font-size: 19px; line-height: 38px; }
    .action { flex-wrap: wrap; }
}

/* --- Short screens --------------------------------------------------------------------------
   A laptop viewport is often under 750px tall once the browser chrome is counted, so the card
   tightens rather than filling the screen or scrolling. These mirror ZenflowHRâ€™s own height
   queries, with its rem values converted from a 14px root. */

@media (max-height: 750px) {
    .auth-bg { padding: 20px 16px; }
    .left-form-box { padding-top: 60px; padding-bottom: 60px; }
    .form-box { padding-top: 18px; padding-bottom: 14px; }
    .form-head { margin-bottom: 8px; }
    .form-head .title { line-height: 36px; }
    .submit { margin-top: 20px; margin-bottom: 10px; }
    .social-divider { margin: 7px 0; }
    .signup-prompt { margin-top: 0; margin-bottom: 0; }
    .form-box hr { margin: 7px 0; }
}

@media (max-height: 600px) {
    .auth-bg { padding: 12px 16px; }
    .left-form-box { padding-top: 36px; padding-bottom: 36px; }
    .form-box { padding-top: 10px; padding-bottom: 8px; }
    .form-head { margin-bottom: 4px; }
    .form-head .title { font-size: 18px; line-height: 28px; }
    .form-head .subtitle { margin-bottom: 0; font-size: 11.375px; }
    .submit { margin-top: 10px; margin-bottom: 4px; }
    .social-divider { margin: 3.5px 0; }
    .inputfield { margin-bottom: 4px; }
    .inputfield input[type="text"],
    .inputfield input[type="email"],
    .inputfield input[type="password"],
    .inputfield input[type="tel"] { height: 36px; }
    .form-box hr { margin: 3.5px 0; }
    .signup-prompt { margin-top: 0; margin-bottom: 0; font-size: 11.375px; }
    .loop-img { top: -12%; }
}

@media (prefers-reduced-motion: reduce) {
    .action-button .button__icon-svg,
    .action-button .button__icon-svg--copy,
    .checkbox-wrapper .cbx > svg path,
    .action-button,
    .inputfield input,
    .rmb input[type="checkbox"]::after { transition: none; }

    .checkbox-wrapper .cbx input:checked + label { animation: none; background: var(--auth-cyan); }
}
