/* Project request form */

.project-form{
    position:relative;
    max-width:600px;
    margin:44px auto 0;
    padding:36px;
    border:1px solid rgba(255,255,255,.08);
    border-radius:var(--radius);
    background:rgba(16,16,16,.82);
    -webkit-backdrop-filter:blur(14px);
    backdrop-filter:blur(14px);
    box-shadow:var(--shadow);
    text-align:left;
    scroll-margin-top:110px;
}

.project-form__body{
    display:grid;
    gap:22px;
    transition:opacity .35s ease, filter .35s ease;
}

/* Sending and sent: the form stays visible but inactive */

.project-form.is-sending .project-form__body{
    opacity:.6;
    pointer-events:none;
}

.project-form.is-sent .project-form__body{
    opacity:.12;
    filter:blur(3px);
    pointer-events:none;
    user-select:none;
}

/* Labels */

.project-form__label{
    display:block;
    margin-bottom:10px;
    padding:0;
    color:var(--gray);
    font-size:14px;
    letter-spacing:.01em;
}

.project-form__field{
    display:block;
}

/* Channel switch */

.project-form__channel{
    margin:0;
    padding:0;
    border:0;
    min-width:0;
}

.project-form__switch{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:4px;
    padding:4px;
    border:1px solid rgba(255,255,255,.1);
    border-radius:999px;
    background:var(--bg);
}

.project-form__switch label{
    position:relative;
    cursor:pointer;
}

.project-form__switch input{
    position:absolute;
    inset:0;
    margin:0;
    opacity:0;
    cursor:pointer;
}

.project-form__switch span{
    display:flex;
    align-items:center;
    justify-content:center;
    height:44px;
    border-radius:999px;
    color:var(--gray);
    font-size:15px;
    font-weight:500;
    transition:background .3s ease, color .3s ease;
}

.project-form__switch input:checked + span{
    background:var(--text);
    color:var(--bg);
}

.project-form__switch input:focus-visible + span{
    outline:2px solid var(--accent);
    outline-offset:2px;
}

@media (hover:hover){

    .project-form__switch input:not(:checked):hover + span{
        color:var(--text);
    }
}

/* Inputs */

.project-form input[type="email"],
.project-form input[type="text"],
.project-form textarea{
    display:block;
    box-sizing:border-box;
    width:100%;
    min-width:0;
    padding:15px 18px;
    border:1px solid rgba(255,255,255,.12);
    border-radius:14px;
    background:var(--bg);
    color:var(--text);
    font:inherit;
    font-size:16px;
    line-height:1.5;
    transition:border-color .25s ease, box-shadow .25s ease;
}

.project-form textarea{
    min-height:128px;
    resize:vertical;
}

.project-form input::placeholder,
.project-form textarea::placeholder{
    color:rgba(184,184,184,.55);
}

@media (hover:hover){

    .project-form input[type="email"]:hover,
    .project-form input[type="text"]:hover,
    .project-form textarea:hover{
        border-color:rgba(255,255,255,.22);
    }
}

.project-form input:focus,
.project-form textarea:focus{
    outline:none;
    border-color:var(--accent);
    box-shadow:0 0 0 3px rgba(79,140,255,.22);
}

.project-form .is-invalid,
.project-form .is-invalid:focus{
    border-color:var(--danger);
    box-shadow:0 0 0 3px rgba(255,107,107,.18);
}

/* Captcha */

.project-form .smart-captcha{
    min-height:102px;
    border-radius:14px;
    overflow:hidden;
}

/* Alert above the button */

.project-form__alert{
    display:flex;
    gap:12px;
    align-items:flex-start;
    padding:14px 16px;
    border:1px solid rgba(255,107,107,.4);
    border-radius:14px;
    background:rgba(255,107,107,.1);
    color:var(--text);
    font-size:15px;
    line-height:1.55;
    animation:formAlertIn .35s cubic-bezier(.22,1,.36,1);
}

.project-form__alert[hidden]{
    display:none;
}

.project-form__alert::before{
    content:"!";
    flex-shrink:0;
    display:flex;
    align-items:center;
    justify-content:center;
    width:22px;
    height:22px;
    margin-top:1px;
    border-radius:50%;
    background:var(--danger);
    color:var(--bg);
    font-size:13px;
    font-weight:700;
}

@keyframes formAlertIn{
    from{
        opacity:0;
        transform:translateY(-6px);
    }
    to{
        opacity:1;
        transform:none;
    }
}

/* Submit */

.cta .project-form .button{
    margin:0;
}

.project-form__submit{
    width:100%;
}

.project-form__submit:disabled{
    cursor:default;
}

.project-form.is-sending .project-form__submit::before{
    content:"";
    width:18px;
    height:18px;
    border:2px solid currentColor;
    border-right-color:transparent;
    border-radius:50%;
    animation:formSpin .8s linear infinite;
}

@keyframes formSpin{
    to{
        transform:rotate(360deg);
    }
}

/* Notes under the button */

.cta .project-form__note{
    margin:0;
    max-width:none;
    color:var(--gray);
    font-size:13px;
    line-height:1.6;
    text-align:center;
}

.cta .project-form__note + .project-form__note{
    margin-top:-14px;
}

.project-form__note a{
    color:var(--text);
    text-decoration:underline;
    text-decoration-color:rgba(255,255,255,.3);
    text-underline-offset:3px;
    transition:text-decoration-color .3s ease;
}

.project-form__note a:hover{
    text-decoration-color:var(--text);
}

/* Success panel over the inactive form */

.project-form__success{
    position:absolute;
    inset:0;
    z-index:2;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:16px;
    padding:36px;
    text-align:center;
    outline:none;
    animation:formSuccessIn .5s cubic-bezier(.22,1,.36,1);
}

.project-form__success[hidden]{
    display:none;
}

.project-form__success-icon{
    display:flex;
    align-items:center;
    justify-content:center;
    width:64px;
    height:64px;
    border:1px solid rgba(74,222,128,.45);
    border-radius:50%;
    background:rgba(74,222,128,.12);
    color:var(--success);
    box-shadow:0 0 40px rgba(74,222,128,.2);
}

.project-form__success-title{
    margin-top:4px;
    font-size:26px;
    font-weight:600;
    letter-spacing:-.02em;
}

.cta .project-form__success-text{
    margin:0;
    max-width:360px;
    color:var(--gray);
    font-size:16px;
    line-height:1.6;
}

.cta .project-form .project-form__again{
    width:auto;
    height:50px;
    margin-top:8px;
    padding:0 26px;
    font-size:15px;
}

@keyframes formSuccessIn{
    from{
        opacity:0;
        transform:scale(.96);
    }
    to{
        opacity:1;
        transform:none;
    }
}

/* Mobile */

@media (max-width:576px){

    .project-form{
        margin-top:36px;
        padding:22px 18px;
    }

    .project-form__body{
        gap:18px;
    }

    .project-form__success{
        padding:24px 18px;
    }

    .project-form__success-title{
        font-size:22px;
    }
}

@media (prefers-reduced-motion:reduce){

    .project-form__alert,
    .project-form__success{
        animation:none;
    }

    .project-form.is-sending .project-form__submit::before{
        animation-duration:2.4s;
    }
}
