/* 
==================================================
    MODAL
==================================================
*/

.project-form-modal {
    position: fixed;
    inset: 0;
    margin: auto;

    width: min(46rem, calc(100vw - 2rem));
    max-height: 85vh;

    padding: 0;
    border: none;

    background: transparent;
    color: inherit;

    overflow: hidden;
}

.project-form-modal::backdrop {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
}

.project-form-modal__backdrop {
    position: fixed;
    inset: 0;

    border: none;
    background: transparent;
}

.project-form-modal__content {
    position: relative;

    width: 100%;
    max-height: 85vh;

    padding: 2.25rem;

    overflow-y: auto;
    scrollbar-width: none;

    background: rgb(14, 14, 18);

    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 2rem;

    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.45);
}

.project-form-modal__content::-webkit-scrollbar {
    display: none;
}


/* 
==================================================
    HEADER
==================================================
*/

#add-project-modal-title {
    margin: 1rem 3rem 2rem 0;

    font-family: var(--serif);
    font-size: clamp(2.2rem, 1rem + 4vw, 3.4rem);
    font-weight: normal;
    line-height: 0.95;
    letter-spacing: -0.04em;

    color: var(--ink);
}

.project-form-modal__close {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;

    width: 2.4rem;
    height: 2.4rem;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;
    border: none;
    border-radius: 50%;

    background: transparent;
    color: var(--ink);

    font: inherit;
    font-size: 1.6rem;
    line-height: 1;

    cursor: pointer;

    transition:
        background-color 180ms ease,
        color 180ms ease,
        transform 180ms ease;
}

.project-form-modal__close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent-base);
    transform: rotate(5deg);
}


/* 
==================================================
    FORM LAYOUT
==================================================
*/

.project-form {
    width: 100%;

    margin: 0;
    padding: 0;

    background: none;
    border: none;
    border-radius: 0;
}

.form-group {
    margin-bottom: 1.4rem;
}


/* 
==================================================
    FORM LABELS
==================================================
*/

.form-group label {
    display: block;

    margin-bottom: 0.55rem;

    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;

    color: var(--ink);
}


/* 
==================================================
    FORM INPUTS
==================================================
*/

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;

    padding: 0.9rem 1rem;

    font: inherit;
    font-size: 0.95rem;

    color: var(--ink);
    background: rgba(255, 255, 255, 0.035);

    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 0.9rem;

    outline: none;

    transition:
        background-color 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.28);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--accent-base);
    background: rgba(255, 255, 255, 0.055);

    box-shadow: 0 0 0 3px color-mix(
        in srgb,
        var(--accent-base) 16%,
        transparent
    );
}

.form-group textarea {
    min-height: 8rem;
    resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}


/* 
==================================================
    FORM ERRORS
==================================================
*/

.form-error {
    margin: 0.45rem 0 0;

    font-size: 0.8rem;
    line-height: 1.4;

    color: #ff7777;
}


/* 
==================================================
    FORM ACTIONS
==================================================
*/

.project-form-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;

    margin-top: 2rem;
    padding-top: 1.5rem;

    border-top: 1px solid rgba(255, 255, 255, 0.08);
}


/* 
==================================================
    MOBILE
==================================================
*/

@media (max-width: 600px) {
    .project-form-modal {
        width: calc(100vw - 1rem);
        max-height: calc(100vh - 1rem);
    }

    .project-form-modal__content {
        max-height: calc(100vh - 1rem);

        padding: 1.5rem;

        border-radius: 1.25rem;
    }

    #add-project-modal-title {
        margin-bottom: 1.5rem;

        font-size: clamp(2rem, 10vw, 2.8rem);
    }

    .project-form-modal__actions {
        flex-direction: column-reverse;
    }

    .project-form-modal__actions .button {
        width: 100%;
    }
}