@import url('styles.css');

section[data-page="contact-form"] {
    flex-grow: 1;
    display: flex;
    flex-direction: row;
    justify-content: space-evenly;
    align-items: center;
}

form {
    width: 40%;
    border: calc(2*var(--border-width,1px)) solid var(--border-color,#121313);
    border-radius: 16px;
    padding-inline: calc(2*var(--width-spacing-unit,1.6dvw));
    padding-block: calc(2*var(--height-spacing-unit,1.6dvh));
    display: flex;
    flex-direction: column;
    gap: calc(2*var(--height-spacing-unit,1.6dvh));

    label {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: calc(0.6*var(--height-spacing-unit,1.6dvh));
    }

    fieldset {
        border: none;
        display: flex;
        flex-direction: column;
        gap: calc(0.8*var(--height-spacing-unit,1.6dvh));
        padding: 0;

        legend {
            margin-block: calc(1*var(--height-spacing-unit,1.6dvh));
        }

        div {
            display: flex;
            flex-direction: row;
            gap: calc(1*var(--width-spacing-unit,1.6dvw));
        }

        legend {
            padding: 0;
        }
    }

    input[type="text"], input[type="email"], textarea {
        padding: calc(0.5*var(--height-spacing-unit,1.6dvh));
        border: var(--border-width,0.5px) solid var(--border-color,#121313);
        font-size: var(--font-size-base,1rem);
        font-family: inherit;
    }

    input[type="submit"] {
        padding: calc(var(--height-spacing-unit,1.6dvh)) calc(1*var(--width-spacing-unit,1.6dvw));
        font-size: var(--font-size-base,1rem);
        font-family: inherit;
        background-color: transparent;
        border: var(--border-width,0.5px) solid var(--border-color,#121313);
    }

    input[type="submit"]:not([disabled]):hover {
        background-color: var(--primary-color,#282787);
        color: var(--text-color-white,#E5E5E5);
        font-family: inherit;
        font-weight: 500;
        cursor: pointer;
        transition: background-color 0.2s ease;
    }
    
    textarea:focus:placeholder-shown, input:focus:placeholder-shown, textarea:focus, input:focus {
        outline: 2px solid var(--primary-color,rgba(189, 218, 134, 0.8));
        border-radius: 2px;
        border: none;
    }

    input:invalid {
        outline-color: var(--system-error-color);
    }

    output {
        display: flex;
        align-items: center;
        gap: 4px;
        height: 1rem;
    }

    #char-limit {
        font-size: 0.9rem;
        color: #555;
        transition: color 0.2s ease;
    }

    #char-limit.warning {
        color: var(--system-error-color);
        font-weight: bold;
    }
}
