/* Pages with a white form band and small buttons
   (account, signin, signup, confirm, delete, forgot, reset, update, findfriends).
   Each page sets its own top / height / offsets in its <style>. */

.formFormat {
    position: relative;
    left: 40%;
    color: blue;
    font-family: Arial;
    font-weight: bold;
    display: inline-flex;
}

.formBackground {
    position: absolute;
    width: 2000px;
    left: -700px;
    background-color: white;
}

.mainButton {
    border-radius: 6px;
    border: none;
    color: black;
    font-weight: bold;
    position: relative;
    display: inline-flex;
    text-decoration: none;
    top: 30px;
    width: 130px;
    height: 30px;
    line-height: 2.5rem;
    justify-content: center;
    align-items: center;
}

.greeting {
    position: relative;
    font-family: Arial;
    color: black;
}

/* left message | label | input | right message
   the left column is a fixed width so the fields don't move when a left message appears */
.fieldForm {
    display: grid;
    grid-template-columns: 300px max-content max-content 1fr;
    column-gap: 10px;
    row-gap: 20px;
    align-items: center;
    justify-items: start;
}

    /* each label starts a new row, whether or not the previous row had a message */
    .fieldForm label {
        grid-column: 2;
    }

    .fieldForm > .greeting,
    .fieldForm > .mainButton {
        grid-column: 2 / -1;
    }

/* centered under the label + input columns. width: 0 keeps the row from widening
   those columns, min-width fills them back; when the buttons are wider than the
   columns they overhang evenly on both sides */
.buttonRow {
    grid-column: 2 / 4;
    width: 0;
    min-width: 100%;
    display: flex;
    justify-content: center;
    gap: 20px;
}

    .buttonRow > button {
        flex-shrink: 0;
    }

.fieldMsg {
    display: flex;
    align-items: center;
    font-family: Arial;
    font-weight: initial;
    color: red;
}

    /* connector line from the input to the text */
    .fieldMsg::before {
        content: "";
        flex-shrink: 0;
        width: 60px;
        height: 2px;
        margin-right: 8px;
        background-color: currentColor;
    }

    .fieldMsg.ok {
        color: rgb(151, 205, 70);
    }

    /* mirrored: sits in the left column, line points right toward the field.
       must come before its label in the HTML so it lands on the same row */
    .fieldMsg.left {
        grid-column: 1;
        justify-self: end;
        flex-direction: row-reverse;
        text-align: right;
    }

        .fieldMsg.left::before {
            margin-right: 0;
            margin-left: 8px;
        }

    /* spans two rows; the bracket touches both inputs */
    .fieldMsg.pair {
        grid-row: span 2;
        align-self: stretch;
    }

        .fieldMsg.pair::before {
            width: 20px;
            height: calc(50% + 10px); /* 10px = half the row-gap */
            margin-right: 0;
            background: none;
            border: 2px solid currentColor;
            border-left: none;
        }

        /* line between the bracket and the text */
        .fieldMsg.pair::after {
            content: "";
            order: 1;
            flex-shrink: 0;
            width: 40px;
            height: 2px;
            margin: 0 8px 0 0;
            background-color: currentColor;
        }

        .fieldMsg.pair span {
            order: 2;
        }

        .fieldMsg.pair.left::before {
            margin-left: 0;
            border-left: 2px solid currentColor;
            border-right: none;
        }

        .fieldMsg.pair.left::after {
            margin: 0 0 0 8px;
        }
