.form-wrapper {
    border: 1px solid var(--gray100);
    box-shadow: 0 4px 24px 0 #CBD5E066;

    h1 {
        font-weight: 700;
        font-size: 20px;
        line-height: 30px;
        letter-spacing: 0;
        color: var(--gray600);
        padding-bottom: 8px;
    }

    h2 {
        font-weight: 500;
        font-size: 14px;
        line-height: 21px;
        letter-spacing: 0;
        color: var(--gray600);
    }
}

a {
    font-weight: 700;
    font-size: 14px;
    line-height: 21px;
    letter-spacing: 0;
    color: var(--purple400);
    padding-left: 2px;

    &:hover {
        text-decoration: underline;
        color: var(--purple200);
    }
}

.sign-form {
    display: flex;
    flex-direction: column;
    gap: 16px;

    .form-group {
        display: flex;
        flex-direction: row;
        gap: 16px;
        /*max-width: 396px;*/
        width: 100%;
    }

    /* The paired rows (First/Last name, Password/Repeat) have to SHARE the row, not each ask for
       all of it. Two form-items at width:100% only fit because flex shrinks them — and a flex item's
       default min-width:auto stops that shrink at its content's intrinsic width, which here is the
       input's own size=20 (~176px). Two of those plus the 16px gap needs 368px, and the card gives
       382px: it fit by 14px, with nothing to spare. Any of a narrower card, a longer placeholder, a
       different font or a zoomed browser spent that and pushed the right-hand field out through the
       card's edge. flex-basis 0 makes them split whatever the row actually has; min-width:0 is what
       lets them. */
    .form-group > .form-item { flex: 1 1 0; min-width: 0; }
}

/* Same reason, one level down: the input is a flex item of .form-item (and of .password-wrapper),
   so its own min-width:auto would hold the floor even once the column can shrink. */
.form-item input,
.password-wrapper input { min-width: 0; }

.form-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    /*max-width: 396px;*/
    width: 100%;

    label {
        font-weight: 500;
        font-size: var(--text-xs);
        line-height: var(--font-line-height-5);
        letter-spacing: var(--tracking-wide);
        color: var(--gray600);

        .required {
            margin-left: 2px;
        }

        .additional {
            color: var(--gray400);
            margin-left: 2px;
        }
    }
}

input {
    border-radius: 10px;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #E2E8F0;
    outline: none;
    transition: border-color 0.3s;
}

input::placeholder {
    color: #94A3B8;
    letter-spacing: 1px;
    font-weight: 500;
}

input:focus {
    border-color: var(--purple)
}

.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrapper input {
    flex: 1;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translate(0, -50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray300);
    font-size: 20px;
}

.submit-button {
    padding: 10px 20px;
    font-size: 14px;
    letter-spacing: 1px;
    font-weight: 500;
    color: #fff;
    background: var(--purple);
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.submit-button:hover {
    background: #5537b2;
}

/* Content */
.preview-description h1 {
    font-weight: 600;
    font-size: 32px;
    line-height: 48px;
    letter-spacing: 0;
    color: var(--gray600)
}

.preview-description p {
    font-weight: 500;
    font-size: 14px;
    line-height: 21px;
    letter-spacing: 0;
    color: var(--gray400);
}

/* ============================================================
   Mobile login (APP-526) — ≤767px.
   Desktop layout unchanged. On phones the gradient/banner panel
   fills the viewport as the background; the login card sits
   centered on top, with the logo + heading visible behind it.
   ============================================================ */
@media (max-width: 767px) {
    /* Full-bleed: drop the outer frame padding so the banner reaches the edges. */
    .login-frame { padding: 0; }

    /* Positioning context that fills the viewport. */
    .login-row {
        position: relative;
        min-height: 100vh;
        min-height: 100dvh;
    }

    /* Banner panel (last child of the row) → full-bleed gradient background. */
    .login-row > *:last-child {
        position: absolute;
        inset: 0;
        z-index: 0;
        border-radius: 0;
        padding: 24px;
        overflow: hidden;
    }

    /* Hide the decorative "pages example" art (last block of the banner) on phones;
       the design keeps only the logo + heading + gradient behind the card. */
    .login-row > *:last-child > div:last-child {
        display: none;
    }

    /* Form column → overlay on top of the gradient, card anchored to the lower area
       so the logo + heading stay fully visible above it (per APP-526 mockup). */
    .login-row .login-form-col {
        position: absolute;
        inset: 0;
        z-index: 1;
        background: transparent;
        display: flex;
        align-items: flex-end;
        justify-content: center;
        padding: 16px 24px 40px;
        overflow-y: auto;
    }

    /* The card must be opaque so the gradient can't show through the form. */
    .login-row .login-form-col .form-wrapper {
        max-width: 460px;
        width: 100%;
        background: #fff;
    }
}
