/*----------- FORM STYLING --------------*/


form {
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem 1.5rem;
    background-color: #f8f8fd;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: var(--primary-font);
}

form fieldset {
    margin: 1rem 0;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: .5rem 2%;
}

form legend {
    color: var(--primary-color);
    padding: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
}

form label {
    display: block;
    padding-top: 1rem;
    color: #222222;
    font-size: 1rem;
}

form div {
    padding-top: 1rem;
    color: #222222;
    font-size: 1rem;
    font-weight: 600;
}

form .required {
    color: #6a0c0c;
    font-weight: bold;
}

form input[for="name"],
form input[type="text"],
form input[type="email"],
form input[type="tel"],
form input[type="number"],
form select,
form textarea {
    background-color: #eee;
    display: block;
    border: solid 1px #999;
    border-radius: 6px;
    padding: .75rem;
    color: #555;
    width: 100%;
    max-width: 500px;
}

form input[type="radio"],
form input[type="checkbox"] {
    margin-right: 6px;
}

form select {
    background-color: #eee;
    display: block;
    border: solid 1px #999;
    border-radius: 6px;
    padding: .75rem;
    color: #555;
    width: 100%;
    max-width: 500px;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

form select:invalid {
    /* color: #888; */
    /* color: #222222; */
    color: #555;
}


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


form textarea {
    min-height: 100px;
}

form input:required {
    border-right: solid 8px red;
}

form input:required:valid {
    border-right: solid 8px green;
}

.checkbox-row {
    display: flex;
    align-items: center;
    flex-direction: row;
    max-width: 500px;
    padding-top: 2rem;
    font-weight: lighter;
}

.checkbox-row label {
    margin: 0;
    padding-left: 0.5rem;
    line-height: 1;
    padding-top: 0;
}


/* ----------- SUBMIT BUTTON & REQUIRED ----------- */
form input[type="submit"] {
    border: none;
    background-image: linear-gradient(var(--primary-color), #312774);
    color: #fff;
    border-radius: 6px;
    padding: .8rem;
    width: 100%;
    max-width: 500px;
    margin-top: 1rem;
    box-shadow: 1px 1px 4px #999;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

form input[type="submit"]:hover,
form input[type="submit"]:focus {
    background-image: linear-gradient(#312774, var(--primary-color));
    color: #fff;
}

form input:required {
    border-right: solid 8px red;
}

form input:required:valid {
    border-right: solid 8px green;
}

/* ----------- RELATIONSHIP BATTERY SCORE BAR & FEEDBACK ----------- */
.battery-bar-container {
    width: 100%;
    max-width: 350px;
    margin: 2rem auto 1.3rem auto;
}

.battery-bar-bg {
    background: #e6e6fa;
    width: 100%;
    height: 36px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(72, 61, 139, 0.06);
    position: relative;
}

.battery-bar {
    height: 100%;
    width: 0;
    background: #36ba6b;
    border-radius: 18px 0 0 18px;
    transition: width 1s cubic-bezier(.37, .77, .29, .97);
    display: block;
}

.battery-bar.low {
    background: #ce4760;
}

.battery-bar.mid {
    background: #ffc107;
}

.battery-bar.high {
    background: #36ba6b;
}

/* ----------- IMPROVE SECTION FOR LOW SCORES ----------- */
.improve-section {
    display: none;
    margin-top: 1.4rem;
    background: #f8f8fd;
    padding: 1.3rem 1rem;
    border-radius: 1rem;
    text-align: center;
}

.improve-section.show {
    display: block;
}

.improve-section .book-link {
    display: inline-block;
    margin-top: 0.8rem;
    padding: 0.7rem 1.7rem;
    background: var(--primary-color);
    color: #fff;
    border-radius: 2rem;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.improve-section .book-link:hover,
.improve-section .book-link:focus {
    background: #483d8b;
}

/* ----------- FILL COUNT DISPLAY ----------- */

#score-output {
    font-size: 1.2rem;
    font-weight: bold;
    color: #483d8b;
    margin: 0.5rem auto;
    text-align: center;
}

.battery-message {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-top: 0.5rem;
    text-align: center;
}

.count-message {
    margin-top: 1.5rem;
    margin: 1.5rem auto;
    color: #483d8b;
    font-size: 1.08rem;
    text-align: center;
    font-style: italic;
}

.contact-form {
    background: #fff;
}