﻿:root {
    --green-200: hsl(148, 38%, 91%);
    --green-600: hsl(169, 82%, 27%);
    --green-900: hsl(139, 89%, 5%);
    --red: hsl(0, 66%, 54%);
    --white: hsl(0, 0%, 100%);
    --grey-500: hsl(186, 15%, 59%);
    --grey-900: hsl(187, 24%, 22%);
}

html {
    font-size: 16px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
}

@font-face {
    font-family: 'Karla';
    src: url('./assets/fonts/Karla-VariableFont_wght.ttf');
    font-weight: 400 700;
    font-stretch: 25% 151%;
}

body {
    font-family: Karla, sans-serif;
    display: flex;
    min-height: 100vh;
    min-width: 100vw;
    justify-content: center;
    align-items: center;
    background-color: var(--green-200);
}

h1 {
    margin-bottom: 2rem;
}

main {
    width: clamp(15rem, 80%, 40rem);
    gap: 1rem;
    padding: 1rem;
    background-color: var(--white);
    border-radius: 0.8rem;
}

.contact-form {
    margin: auto;
}

fieldset {
    border: 0;
}

.name, .email, .message {
    width: 100%;
    border: 0.15rem solid var(--grey-900);
    border-radius: 0.3rem;
}
.name:hover, .email:hover, .message:hover {
    border-color: var(--green-600);
}
.name, .email {
    margin-top: 0.3rem;
    height: 2.5rem;
}

.message {
    margin-top: 0.3rem;
    height: 5rem;
    resize: none;
}

#submit-btn {
    width: 100%;
    border: 0;
    border-radius: 0.2rem;
    height: 2.5rem;
    background-color: var(--green-600);
    color: var(--white);
    font-size: 1rem;
    cursor: pointer;
}

#submit-btn:active {
    background-color: var(--green-200);
}

#submit-btn:hover {
    background-color: var(--green-900);
}

.username {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}
.input-container {
    margin-bottom: 1.2rem;
}
.name-container {
    width: 100%;
}

.query-options {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    width: 100%;
    margin-top: 0.3rem;
}
/*
.query-options .enquiry {
    border: 0.15rem solid var(--grey-900);
    border-radius: 0.3rem;
    width: 100%;
    height: 2.5rem;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    gap: 1rem;
    align-items: center;
}*/

.query-type, .query-label, .consent-check, .consent-check-label {
    cursor: pointer;
}

.query-label {
    border: 0.15rem solid var(--grey-900);
    width: 100%;
    height: 2.5rem;
    border-radius: 0.3rem;
    padding: 0.4rem 0 0 1rem;
}

.query-label:hover {
    border-color: var(--green-600);
}

.error-message {
    display: none;
    color: var(--red);
    margin-top: 0.3rem; 
}

input[type='radio'] {
    appearance: none;
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    border: 0.1rem solid var(--grey-500);
    border-radius: 50%;
    background-color: var(--white);
    transition: all 0.3s;
    vertical-align: middle;
    margin-right: 0.5rem;
    margin-bottom: 0.1rem;
}

input[type='radio']:checked {
    border: 0;
    background-image: url("./assets/images/icon-radio-selected.svg");
    background-size: contain;
    background-repeat: no-repeat;
}

input[type='checkbox'] {
    appearance: none;
    width: 1.1rem;
    height: 1.1rem;
    cursor: pointer;
    border: 0.1rem solid var(--grey-500);
    border-radius: 0.2rem;
    background-color: var(--white);
    transition: all 0.3s;
    vertical-align: middle;
    margin-right: 0.5rem;
    margin-bottom: 0.2rem;
}

input[type='checkbox']:checked{
    border: 0;
    background-image: url("./assets/images/icon-checkbox-check.svg");
    background-size: contain;
    background-repeat: no-repeat;
}

.radio-selected {
    border-color: var(--green-600);
    background-color: var(--green-200);
}

.focus, .active, .positive {
    border-color: var(--green-600);
}

.error {
    border-color: var(--red);
}

/*toast style*/
.toast {
    position: fixed;
    top: 1rem;
    left: 50%;
    max-width: 25rem;
    background-color: var(--grey-900);
    padding: 1.5rem;
    border-radius: 0.5rem;
    z-index: 3; /*make sure it stay on top*/
    animation: slideDown 0.3s ease-in-out forwards, fadeOut 0.5s ease-in-out forwards 2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.8rem;
    color: var(--white);
}

.toast-header {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
}

.toast-icon {
    width: 1.5rem;
    height: 1.5rem;
}

@keyframes slideDown {
    0% {
        transform: translateX(-50%) translateY(-10%);
    }
    100% {
        transform: translateX(-50%) translateY(10%);
    }
}

@keyframes fadeOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
    }
}

/*screen resize style*/
@media screen and (width >= 53rem) {
    .username {
        display: flex;
        flex-direction: row;
        gap: 2rem;
    }

    .query-options {
        display: flex;
        flex-direction: row;
        gap: 2rem;
    }
}
