// ===== STEPPED FORM
// ================================================================================

$primary: $blue;
$secondary: $cyan;
$white: #fff;
$black: #000;

form.stepped {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 1050px;
    margin: 48px auto;
    color: $primary;
    padding: 0 10px 20px;
    z-index: 1;

    @include bp($bp-col12) {
        background: #f3f3f3;
        box-shadow: 0 4px 15px rgba(black, 0.1);
        padding: 0 35px 35px;
    }

    .disclaimer {
        font-size: 10px;
    }

    .form-title {
        padding: 18px 0;
        width: 100%;
        background-color: $primary;
        display: block;
        text-align: center;
        margin-bottom: 24px;
        border-top-left-radius: 5px;
        border-top-right-radius: 5px;
        @include bp($bp-col12) {
            width: calc(100% + 70px);
        }
        .primary {
            display: inline-block;
            text-transform: capitalize;
            color: $white;
            font-size: 24px;
            margin-bottom: 18px;
            @include bp($bp-col12) {
                font-size: 32px;
            }
        }
        .intro {
            color: $white;
            padding: 0;
        }
    }

    .form-row {
        width: 100%;
        margin-bottom: 20px;

        &.hidden {
            display: none;
        }
        &.hidden.reveal {
            display: block;
        }
        &:last-of-type {
            margin-bottom: 0;
        }

        // 50/50 split rows
        &.split {
            display: flex;
            margin-bottom: 8px;

            > .form-row {
                margin-bottom: 0;
            }

            .form-row:not(:last-of-type) {
                margin-right: 12px;
            }
        }

        // Floated labels
        &.floated {
            position: relative;
            margin-bottom: 8px;

            label {
                position: absolute;
                top: 14px;
                left: 20px;
                font-weight: 400;
                text-transform: uppercase;
                margin: 0;
                transition: top 0.2s, font-size 0.2s;
            }

            // Active label state
            &.active {
                label {
                    font-size: 11px;
                    top: 4px;
                }
            }
        }

        // Error styles
        &.error {
            > label,
            .label,
            select {
                color: red;
            }
            .radio .inner-radio {
                label {
                    border-color: red;
                    i {
                        background-color: red;
                    }
                }
            }
        }

        &.range {
            margin-bottom: 0;
        }

        &.state-field {
            label {
                pointer-events: none;
            }
        }

        &.button {
            text-align: center;
            margin: auto;
            display: flex;
            align-items: center;
            justify-content: center;
            border: none;
            &:hover {
                background-color: transparent;
            }
            .next-step,
            .prev-step {
                background-color: $secondary;
                cursor: pointer;
                color: $white;
                padding: 6px 24px;
                border-radius: 5px;
                transition: all 0.3s ease;
                &:hover {
                    background-color: darken($secondary, 15%);
                }
            }
            .final-step {
                background-color: $primary;
                cursor: pointer;
                color: $white;
                padding: 6px 24px;
                border-radius: 5px;
                transition: all 0.3s ease;
                outline: none;
                border: none;
                font: italic 24px/26px "Baskervville";
                &:hover {
                    background-color: darken($primary, 15%);
                }
                &[disabled] {
                    background-color: $grey-dark;
                    opacity: 0.5;
                    cursor: default;
                    .lds-dual-ring {
                        display: inline-block;
                    }
                }

                .lds-dual-ring {
                    display: none;
                    width: 20px;
                    height: 20px;
                }
                .lds-dual-ring:after {
                    content: " ";
                    display: block;
                    width: 16px;
                    height: 16px;
                    margin: 8px;
                    margin-top: 0;
                    border-radius: 50%;
                    border: 4px solid #fff;
                    border-color: #fff transparent #fff transparent;
                    animation: lds-dual-ring 1.2s linear infinite;
                }
                @keyframes lds-dual-ring {
                    0% {
                        transform: rotate(0deg);
                    }
                    100% {
                        transform: rotate(360deg);
                    }
                }
            }
        }

        &.row-radio {
            margin-bottom: 12px;

            @include bp($bp-col12) {
                text-align: center;
            }
        }
    }

    // Radio
    .radio {
        display: flex;
        flex-direction: column;
        .inner-radio {
            display: flex;
            width: 100%;
            margin: 8px 0;
            input {
                appearance: none;
                &:checked {
                    + label {
                        background-color: $primary;
                        color: $white;
                        i {
                            opacity: 1;
                        }
                    }
                }
            }
            label {
                border: 1px solid #93a1ba;
                display: flex;
                align-items: center;
                justify-content: flex-start;
                width: 100%;
                transition: all 300ms ease;
                cursor: pointer;
                margin: 0;
                border-radius: 5px;
                i {
                    padding: 12px;
                    background-color: $primary;
                    opacity: 0.5;
                    color: $white;
                    margin-right: 18px;
                    font-size: 22px;
                    border-right: 1px solid transparent;
                }

                &:hover {
                    background-color: $primary;
                    color: $white;
                    i {
                        opacity: 1;
                    }
                }
            }
        }
        input[type="radio"] {
            display: block;
            visibility: visible;
            pointer-events: all;
            position: static;

            // &:checked {
            //     + label {
            //         background: none;
            //         color: $black;
            //     }
            // }
        }
        label {
            width: auto;
            height: auto;
            background: none;
            display: block;
            color: $black;
            font-size: 16px;
            margin-left: 12px;
        }
    }

    // General input and textarea style
    .input {
        background-color: #e6e4e4;
    }

    .btn {
        width: auto;
        margin: 10px auto 0 auto;
    }

    .steps-slider {
        max-width: 100%;

        .step {
            outline: none;
            max-width: 100%;

            .step-index {
                text-align: center;
                span {
                    display: inline-block;
                    border: 2px solid $cyan;
                    border-radius: 50%;
                    padding: 8px;
                    font-size: 14px;
                    width: 20px;
                    height: 20px;
                    color: $cyan;
                }
            }
            .step-title {
                text-align: center;
                padding: 0;
                margin: 12px 0;
            }
        }
    }

    // Completion handling
    .msg {
        width: 100%;
    }
}
