/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

/* Container principale con flexbox per gestire l'ordine degli elementi */
#tlk_test_header_container {
    display: flex;
    flex-direction: column;
    text-align: center;
}

/* Mobile first: step indicator sopra il testo */
.tlk_test_step_indicator_container {
    order: 1;
}

.tlk_test_step_indicator_container .stepper-item::after,
.tlk_test_step_indicator_container .stepper-item::before {
    top: 15px;
}

.tlk_test_step_indicator_container .stepper-item .step-counter {
    width: 30px;
    height: 30px;
}

.showOnDesktopGrid {
    display: none;
}

.tlk_test_text_container {
    order: 2;
    margin-top: 2rem;
    margin: 0 0.5rem;
}

.tlk_test_text_container h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}


.tlk_test_text_container h2 {
    margin-bottom: 1rem;
}

.tlk_test_inlinebuttons {
    display: inline-block;
    margin: 2rem 0.5rem;
    width: 45%;
    cursor: pointer;
    text-transform: uppercase;
}

.tlk_test_previous {
    background-color: white;
    color: black;
    text-align: center;
    font-size: 0;
    height: 16px;
    position: relative;
}

.tlk_test_previous::before{
    content: '';
    font-size: 12px;
    background-image: url('data:image/svg+xml;utf8,<svg width="29" height="16" viewBox="0 0 29 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.792891 7.29289C0.402367 7.68342 0.402367 8.31658 0.792891 8.70711L7.15685 15.0711C7.54738 15.4616 8.18054 15.4616 8.57107 15.0711C8.96159 14.6805 8.96159 14.0474 8.57107 13.6569L2.91421 8L8.57107 2.34315C8.96159 1.95262 8.96159 1.31946 8.57107 0.928932C8.18054 0.538408 7.54738 0.538408 7.15685 0.928932L0.792891 7.29289ZM28.5 8V7L1.5 7V8V9L28.5 9V8Z" fill="black"/></svg>');
        width: 29px;
    height: 16px;
    display: block;
    background-size: cover;
    background-repeat: no-repeat;
    top: -3px;
    position: absolute;
}


.funnel_test_step select {
 appearance: none; /* Disable the default arrow */
    -webkit-appearance: none; /* For WebKit-based browsers */
    -moz-appearance: none; /* For Firefox */
    width: 100%;
    font-size: 16px;
    border-radius: 4px;
    background-image: url('data:image/svg+xml;utf8,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 9L12 15L18 9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" stroke="currentColor"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 20px;
    cursor: pointer;
}

#tlk_test_allergie_selector {
    margin: 0 1.5rem;
    text-align: left;
}

.tlk_test_allergia {
    display: inline-block;
    width: 100%;
    border-bottom: 1px solid black;
    padding-bottom: 0.2rem;
    padding-top: 0.8rem;
    cursor: pointer;
}

.tlk_test_allergia .tlk_test_allergia_img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    margin-right: 1rem;
    display: inline-block   ;
}

.tlk_test_allergia .tlk_test_allergia_name {
    display: inline-block;
    vertical-align: middle;
    font-size: 1.2rem;
    line-height: 1rem;
}


.tlk_test_allergia.selected .tlk_test_allergia_name {
    font-weight: 400;
}

.tlk_test_allergia .selector_circle {
    width: 15px;
    height: 15px;
    border: 2px solid black;
    border-radius: 50%;
    vertical-align: middle;
    float: right;
    margin-top: 5px;
}

.tlk_test_allergia.selected .selector_circle {
    background-color: black;
}

.tlk_funnel_goal {
    margin: 1rem;
}

.tlk_funnel_goal_button {
    border-radius: 10px;
    background-image: var(--background);
    background-size: cover;
    background-position: center center;
    padding: 2rem;
    margin-top: 1rem;
    cursor: pointer;
}

.tlk_funnel_goal_button_img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    display: block;
    margin: 0 auto 0.5rem auto;
}

.tlk_funnel_goal_title {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
    text-align: center;
    margin-top: 1rem;
    line-height: 1rem;
}

.tlk_funnel_goal_description {
    display: block;
    margin-top: 1rem;
    line-height: 1rem;
    margin-bottom: 3rem;
    text-align: center;
}

.tlk_funnel_legalese_container {
    margin: 0 2rem;
    text-align: left;
}

.tlk_test_funnel_input_container {
    margin: 2rem auto;
    width: 80%;
}

.tlk_funnel_test_error {
    color: red;
    font-weight: bold;
    display: block;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.funnel_test_step.loading::after {
  height: 3em;
  width: 3em;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -0.5em;
  margin-top: -0.5em;
  display: block;
  content: "";
  animation: spin 1s infinite linear;
  background: url("./loader.svg") center center;
  background-size: cover;
  line-height: 1;
  text-align: center;
  z-index: 10;
}

.funnel_test_step.loading::before{
    content:"";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 5;
}

/* Desktop: testo sopra step indicator */
@media (min-width: 768px) {
    .tlk_test_text_container {
        order: 1;
    }
    
    .tlk_test_step_indicator_container {
        order: 2;
    }

    .tlk_test_step_indicator_container .stepper-item::after,
    .tlk_test_step_indicator_container .stepper-item::before {
        top: 20px;
    }

    .tlk_test_step_indicator_container .stepper-item .step-counter {
        width: 40px;
        height: 40px;
    }

    .tlk_test_previous {
        background-color: black;
        color: white;
        text-align: center;
        font-size: 12px;
        height: auto;
    }   

    .tlk_test_previous::before {
        content: none;
    }

    .showOnDesktopGrid {
        display: grid;
        padding-bottom: 4rem;
    }

    .tlk_test_funnel_box_selector {
        cursor: pointer;
        border: 2px solid black;
        padding: 1rem;
        text-align: center;
        font-size: 1.2rem;
        border-radius: 10px;
        transition: background 0.3s, color 0.3s, font-weight 0.3s;
        width: 80%;
        margin: 0 auto;
    }

    .tlk_test_funnel_box_selector.active, .tlk_test_funnel_box_selector:hover {
        background: linear-gradient(to bottom, black, #333);
        color: white;
        font-weight: 400;
    }

    h2.tlk_test_funnel_box_title {
        font-size: 1.5rem;
        margin: 1rem 0 0.5rem 0;
        text-align: center;
    }

    #tlk_funnel_send,
    .tlk_funnel_goto {
        max-width: 200px;
        text-transform: uppercase;
        cursor: pointer;
    }

    #tlk_test_allergie_selector {
        display: grid;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 1rem;
        text-align: center;
    }

    .tlk_test_allergia {
        width: auto;
        border: none;
        border-radius: 10px;
        text-align: center;
        background: linear-gradient(to bottom, black, #333);
        color: white;
        text-transform: uppercase;
    }

    .tlk_test_allergia .selector_circle {
        display: none;
    }

    .tlk_test_allergia .tlk_test_allergia_img {
        display: block;
        margin: 1rem auto 2rem auto;
    }

    .tlk_test_allergia .tlk_test_allergia_name {
        font-size: 1rem;
        line-height: 1.2rem;
        padding-bottom: 2rem;
    }
    
    .tlk_test_allergia.selected {
        background: #d4af37;
        color: black;
    }

    .tlk_test_allergia .tlk_test_allergia_img {
        background-color: black;
        border-radius: 50%;
    }

    .step_4 h2.tlk_test_funnel_box_title {
        margin-top: 2rem;
        margin-bottom: 3rem;
    }

    .tlk_funnel_goalsContainer {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1rem;
    }
    
    .tlk_funnel_goal_button {
        padding-top: 6rem;
        padding-bottom: 4rem;
    }

    .tlk_funnel_goal_title {
        margin-top: 4rem;
    }

    .tlk_test_text_container h1 {
        font-size: 2.4rem;
        margin-top: 5rem;
    }
    .tlk_test_text_container h2 {
        font-size: 1.5rem;
    }
}