.hide {
    display: none !important;
}

.stoolchecker {
    background-color: #e9f8ff;
    border-radius: 1.5rem;
    padding: 2rem 1.5rem;
    max-width: 1300px; /* TODO: consider 640px */
    margin: 0 auto;
    box-sizing: border-box;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.cmp-stoolchecker__tool-title {
    color: #001489;
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 1rem;
    text-align: center;
}

.cmp-stoolchecker {
    align-items: center;
    background-color: #e9f8ff;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    position: relative;
}

.cmp-stoolchecker__image {
    width: 100%;
    max-width: 36rem;
    height: 280px;
    flex-shrink: 0;
    overflow: hidden;
}

.cmp-stoolchecker__image .cmp-image {
    width: 100%;
    height: 100%;
}

.cmp-stoolchecker__image .cmp-image__image {
    width: 100%;
    margin: 0;
    height: 100% !important;
    object-fit: contain;
    display: block;
}

.cmp-stoolchecker__image .cmp-image__image.has-user-image {
    object-fit: cover;
    border-radius: 1rem;
}

.cmp-image__image {
    max-width: 100%;
    width: auto;
}

.cmp-stoolchecker__form {
    width: 100%;
    max-width: 36rem;
    min-width: 0;
}

.cmp-stoolchecker--form-view .cmp-stoolchecker__image {
    display: none;
}

.cmp-stoolchecker--form-view .cmp-stoolchecker__form {
    max-width: 36rem;
}

.cmp-stoolchecker--form-view .cmp-stoolchecker__form--group {
    padding: 0;
    margin-top: 0;
}

.cmp-stoolchecker__form--group {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding: 0;
    box-sizing: border-box;
}

.cmp-title__text {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -.01rem;
    line-height: 1.5rem;
    color: #001489;
    margin: 0 0 0.25rem;
}

.cmp-text p {
    color: #001489;
    font-size: 0.875rem;
    margin: 0 0 0.5rem;
}

.cmp-smartfields__form-group {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 0.625rem;
}

.cmp-smartfields__label {
    color: #001489;
    font-size: 0.95rem;
    font-weight: 700;
}

legend.cmp-smartfields__label {
    padding-left: 0.5rem;
}

.cmp-smartfields-calendar,
.cmp-smartfields__input,
.cmp-smartfields-dropdown__select {
    width: 100%;
    min-height: 3rem;
    padding: 0.875rem 1rem;
    border: 1px solid #95b8cc;
    border-radius: 0.75rem;
    background: #fff;
    color: #001489;
    font-size: 1rem;
    box-sizing: border-box;
    cursor: pointer;
}

.cmp-smartfields-calendar {
    text-transform: uppercase;
}

.cmp-smartfields-calendar:focus,
.cmp-smartfields__input:focus,
.cmp-smartfields-dropdown__select:focus {
    outline: 2px solid #95b8cc;
    outline-offset: 1px;
}

.cmp-smartfields-dropdown__select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23000c51' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 5rem;
}

.cmp-stoolchecker__consent-error {
    display: flex;
    justify-content: flex-start;
    margin-top: 0.375rem;
}

.cmp-smartfields-radio__group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border: 0;
    margin: 0 0 0 -0.5rem;
    padding: 0;
}

.cmp-smartfields-radio__group > div,
.cmp-smartfields-checkbox {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    color: #001489;
}

.cmp-smartfields-checkbox{
    display: block;
}

.cmp-smartfields-checkbox:hover{
   background-color: #f0f3fe;;
}


.cmp-smartfields-radio__group > div {
    padding: 0.25rem 0.5rem;
    cursor: pointer;
}

.cmp-smartfields-radio__label,
.cmp-smartfields-checkbox__label {
    color: #001489;
    cursor: pointer;
    margin-bottom: 0;
    font-size: 0.875rem;
}

.cmp-smartfields-checkbox__label a {
    color: #001489;
    font-weight: 350;
    text-decoration: underline;
}

.cmp-smartfields-checkbox__label p {
    color: #001489;
    font-size: 0.875rem;
    margin: 0;
}

.cmp-smartfields-radio__input {
    appearance: none;
    -webkit-appearance: none;
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid #001489;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
    transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
}

.cmp-smartfields-radio__input:checked {
    background-color: #001489;
    border-color: #001489;
    box-shadow: inset 0 0 0 3px #fff;
}

.cmp-smartfields-checkbox input {
    margin: 0;
    cursor: pointer;
}

.cmp-smartfields-radio__group > div:hover {
    background-color: #f0f4fa;
    border-radius: 0.25rem;
}


.cmp-smartfields-checkbox {
    align-items: flex-start;
    padding: 0.25rem 0;
    line-height: 1.4;
}

.cmp-smartfields-checkbox__label p {
    margin: 0;
}

.cmp-smartfields__mandatory {
    color: #c0392b;
}

.cmp-smartfields__require-error {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #c0392b;
    display: none;
}

.cmp-smartfields__form-group.has-error .cmp-smartfields__require-error {
    display: block;
}

.cmp-smartfields__form-group.has-error .cmp-smartfields__label,
.cmp-smartfields__form-group.has-error legend.cmp-smartfields__label {
    color: #c0392b;
}

.cmp-smartfields__form-group.has-error .cmp-smartfields-radio__label {
    color: #c0392b;
}

.cmp-smartfields__form-group.has-error .cmp-smartfields-radio__input {
    border-color: #c0392b;
}

.cmp-smartfields__form-group.has-error .cmp-smartfields-checkbox__label {
    color: #c0392b;
}

.cmp-smartfields__form-group.has-error .cmp-smartfields-calendar,
.cmp-smartfields__form-group.has-error .cmp-smartfields__input,
.cmp-smartfields__form-group.has-error .cmp-smartfields-dropdown__select {
    border-color: #c0392b;
    color: #c0392b;
    outline: none;
}

.cmp-smartfields__form-group.has-error .cmp-smartfields-checkbox__input {
    border-color: #c0392b;
}

.cmp-smartfields__form-group.has-error .cmp-smartfields-checkbox__label a {
    color: #c0392b;
}

.cmp-stoolchecker--validation .cmp-smartfields__require-error {
    display: block;
}

.cmp-smartfields-calendar::-webkit-datetime-edit-text,
.cmp-smartfields-calendar::-webkit-datetime-edit-month-field,
.cmp-smartfields-calendar::-webkit-datetime-edit-day-field,
.cmp-smartfields-calendar::-webkit-datetime-edit-year-field {
    color: #001489;
}

.cmp-smartfields-calendar:not([value]):not(:focus)::-webkit-datetime-edit {
    color: #95b8cc;
}

.cmp-smartfields__form-group.has-error .cmp-smartfields-calendar::-webkit-datetime-edit-text,
.cmp-smartfields__form-group.has-error .cmp-smartfields-calendar::-webkit-datetime-edit-month-field,
.cmp-smartfields__form-group.has-error .cmp-smartfields-calendar::-webkit-datetime-edit-day-field,
.cmp-smartfields__form-group.has-error .cmp-smartfields-calendar::-webkit-datetime-edit-year-field {
    color: #c0392b;
}

.cmp-smartfields__form-group.has-error .cmp-smartfields-calendar:not(:focus)::-webkit-datetime-edit {
    color: #c0392b;
}

.cmp-stoolchecker__actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cmp-stoolchecker button:not(.cmp-stoolchecker__reupload),
.cmp-stoolchecker__upload-button,
.button .cmp-button {
    align-items: center;
    appearance: none;
    background-color: #95b8cc;
    border: 2px solid transparent;
    border-radius: 2rem;
    box-shadow: 0 4px 14px rgba(149, 184, 204, 0.45);
    color: #fff;
    cursor: pointer !important;
    display: flex;
    flex-direction: row;
    font-size: 1.25rem;
    font-weight: 600;
    gap: .5rem;
    justify-content: center;
    letter-spacing: .015rem;
    line-height: 1rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color .3s ease-in-out, transform .2s ease-in-out, box-shadow .2s ease-in-out;
}

.cmp-stoolchecker__reset{
    align-items: center;
    background-color: #001489;
    border: 2px solid transparent;
    border-radius: .5rem;
    color: #fff;
    display: flex;
    flex-direction: row;
    font-size: .75rem;
    font-weight: 350;
    gap: .5rem;
    justify-content: center;
    letter-spacing: .015rem;
    line-height: 1rem;
    padding: 1rem 1.25rem;
    text-decoration: none;
    text-transform: uppercase;
    transition: .3s ease-in-out;
    cursor: pointer !important;
}

.cmp-stoolchecker__reset:hover {
    background-color: #5a84d8;
    cursor: pointer !important;
}

.cmp-stoolchecker button:hover:not(.cmp-stoolchecker__reupload),
.cmp-stoolchecker__upload-button:hover,
.cmp-stoolchecker__continue-button:hover,
.button .cmp-button:hover {
    background-color: #7aa3bc;
    box-shadow: 0 6px 18px rgba(149, 184, 204, 0.55);
    cursor: pointer !important;
    transform: scale(1.02);
}

.cmp-stoolchecker__upload-button::after,
.cmp-stoolchecker__continue-button::after,
.cmp-stoolchecker__reset::after,
.result-button::after {
    background-image: url("../../assets/stool-images/btn_poop_icon.png");
    background-position: 50%;
    background-repeat: no-repeat;
    background-size: contain;
    content: "";
    display: inline-block;
    height: 2.5rem;
    width: 2.5rem;
}

.cmp-stoolchecker__reupload {
    background: none;
    border: none;
    cursor: pointer;
    color: #001489;
    font-size: 0.875rem;
    font-weight: 350;
    letter-spacing: -.01rem;
    line-height: 1.4rem;
    margin: 0;
    padding: 0;
    text-decoration: underline;
    transition: color .2s ease-in-out, opacity .2s ease-in-out;
}

.cmp-stoolchecker__reupload:hover {
    color: #5a84d8;
    opacity: 0.85;
}


.cmp-stoolchecker__image-error,
.cmp-stoolchecker__no-results {
    color: #c0392b;
    font-weight: 500;
    font-size: 0.875rem;
}

.cmp-stoolchecker__result {
    width: 100%;
    max-width: 36rem;
    text-align: center;
    background: transparent;
    border: none;
    padding: 0;
    box-sizing: border-box;
}

.stool-tracker-result-text {
    width: 100%;
    text-align: center;
}

.stool-tracker-result-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #001489;
    margin: 0 0 0.5rem;
    text-align: center;
}

.stool-tracker-result-content {
    color: #001489;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.6;
}

.stool-tracker-result-content p {
    margin: 0.25rem 0;
    text-align: center;
    color: #001489;
}

.stool-tracker-result-content strong {
    font-weight: 700;
    color: #001489;
}

.cmp-stoolchecker--result-view .cmp-stoolchecker__image {
    height: 200px;
}

.cmp-smartfields-checkbox__group {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.625rem;
}

.cmp-smartfields__input.cmp-smartfields-checkbox__input {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    min-height: unset;
    padding: 0;
    margin: 0;
    border: 2px solid #001489;
    border-radius: 0.25rem;
    background: transparent;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
    box-sizing: border-box;
}

.cmp-smartfields__input.cmp-smartfields-checkbox__input:checked {
    background-color: #001489;
    border-color: #001489;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6l3 3 5-5' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 75%;
}

.cmp-stoolchecker__loading {
    position: absolute;
    inset: 0;
    background: rgba(233, 248, 255, 0.92);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.cmp-stoolchecker__loading-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.cmp-stoolchecker__loading-text {
    color: #001489;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 0;
}

.loader {
    width: 2.5rem;
    height: 2.5rem;
    border: 4px solid rgba(0, 12, 81, 0.16);
    border-top-color: #001489;
    border-radius: 50%;
    animation: stool-spin 0.8s linear infinite;
}

@keyframes stool-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Focus visibility */
.cmp-stoolchecker__upload-button:focus-visible,
.cmp-stoolchecker__continue-button:focus-visible,
.cmp-stoolchecker button:focus-visible,
.cmp-stoolchecker__reset:focus-visible {
    outline: 2px solid #001489;
    outline-offset: 2px;
}

.cmp-smartfields-checkbox__input:focus-visible {
    outline: 2px solid #95b8cc;
    outline-offset: 2px;
}

.cmp-smartfields-radio__group > div:focus-within {
    outline: 2px solid #95b8cc;
    outline-offset: 2px;
    border-radius: 0.25rem;
}

.cmp-stoolchecker__reupload:focus-visible {
    outline: 2px solid #95b8cc;
    outline-offset: 2px;
    border-radius: 0.25rem;
}

@media (max-width: 767px) {
    .stoolchecker {
        padding: 2rem 1.5rem;
    }

    .cmp-stoolchecker {
        gap: 0.75rem;
    }

    .cmp-stoolchecker__image {
        height: 200px;
    }

    .cmp-stoolchecker button:not(.cmp-stoolchecker__reupload),
    .cmp-stoolchecker__reset,
    .cmp-stoolchecker__upload-button,
    .cmp-stoolchecker__continue-button,
    .button .cmp-button {
        font-size: 1rem;
        position: relative;
        padding-right: 4rem;
        justify-content: center;
        width: 100%;
        box-sizing: border-box;
    }

    .cmp-stoolchecker__upload-button::after,
    .cmp-stoolchecker__continue-button::after,
    .cmp-stoolchecker__reset::after,
    .result-button::after {
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        height: 2rem;
        width: 2rem;
    }

    .cmp-smartfields-radio__group {
        flex-direction: row;
        gap: 0.25rem;
    }
}

@supports (-webkit-touch-callout: none) {
    .cmp-smartfields-calendar {
        width: auto !important;
    }
}