@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,wght@0,400;0,600;1,500&family=Karla:wght@400;500;700&display=swap');

*,
*::before,
*::after {
    scrollbar-width: none;
    /* touch-action: manipulation; */
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --cream: #FBF6EF;
    --paper: #FFFFFB;
    --ink: #3A2A2F;
    --ink-soft: #6B5B60;
    --rose: #D98B95;
    --rose-deep: #C06E7A;
    --sage: #8AA37D;
    --sage-deep: #6B8560;
    --gold: #C9A15A;
    --shadow: 0 10px 30px rgba(58, 42, 47, 0.08);
}

/* parte del media query */

@media (max-width: 464px) {
    .timer_c>div {
        flex: 0 0 calc(50% - 8px);
    }
}

body {
    background-color: var(--cream);
    margin: 0;
    min-height: 100dvh;
}

h1,
h2,
h3 {
    font-family: 'Fraunces', serif;
    font-weight: 900;
    margin: 0;
}

.timer_main_c {
    background: transparent;
    color: var(--ink);
    font-family: 'Karla', sans-serif;
    display: flex;
    flex-direction: column;
    position: relative;
    text-align: center;
    width: 100%;
    min-height: 100dvh;
    overflow-x: hidden;
}

.background_glow {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 15% 15%, rgba(217, 139, 149, 0.14), transparent 55%), radial-gradient(ellipse at 85% 85%, rgba(138, 163, 125, 0.16), transparent 55%);
    transition: background 1.2s ease;
}

/* section del countdown */
.countdown_c {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 40px 24px;
    width: 100%;
    min-height: 100dvh;
    box-sizing: border-box;
    z-index: 1;
}

.countdown_c.scompare_container {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.6s ease-in-out, transform 0.6s ease-in-out;
}

/* animazioni petali e fiori che cadono (credo) */
.cascata_fiori_c {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    /* z-index: 1; */
}

.fiore_cadente {
    position: absolute;
    top: -10%;
    animation: caduta_fiori linear infinite;
    opacity: 0.7;
}

@keyframes caduta_fiori {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.8;
    }

    90% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(110vh) translateX(var(--drift)) rotate(360deg);
        opacity: 0;
    }
}

#petali_container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.petalo {
    position: absolute;
    top: -10%;
    width: 20px;
    height: 20px;
    background: var(--rose);
    border-radius: 15px 0px 15px 0px;
    opacity: 0.8;
    animation: cade_petalo linear forwards;
}

@keyframes cade_petalo {
    0% {
        transform: translateY(0) rotate(0deg) scale(0.8);
        opacity: 0.9;
    }

    100% {
        transform: translateY(115vh) rotate(360deg) scale(1);
        opacity: 0;
    }
}

.svg_fiore {
    width: 70px;
    height: 70px;
    margin-bottom: 20px;
    animation: a_c_fiore 6s ease-in-out infinite;
    transform-origin: bottom center;
}

@keyframes a_c_fiore {

    0%,
    100% {
        transform: rotate(-3deg);
    }

    50% {
        transform: rotate(3deg);
    }
}

#msg_timer_up {
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.75em;
    color: var(--sage-deep);
    font-weight: 700;
    margin-bottom: 12px;
}

.container_timer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: auto;
    box-sizing: border-box;
}

.msg_inside_timer {
    font-size: clamp(1.8rem, 4.5vw, 2.6rem);
    line-height: 1.25;
    max-width: 22ch;
    margin: 0 auto 44px auto;
    font-family: 'Fraunces', serif;
    font-weight: 600;
}

.msg_inside_timer em {
    font-style: italic;
    font-weight: 500;
    color: var(--rose-deep);
}

.timer_c {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.casella_timer {
    background: var(--paper);
    border-radius: 18px;
    box-shadow: var(--shadow);
    padding: 22px 18px;
    min-width: 92px;
    border: 1px solid rgba(58, 42, 47, 0.06);
}

.casella_timer .n_timer {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    color: var(--rose-deep);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.casella_timer .n_timer.clock {
    animation: pulseNum 0.4s ease-in-out;
}

@keyframes pulseNum {
    0% {
        transform: translateY(-6px);
        opacity: 0.75;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.casella_timer .label {
    margin-top: 8px;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

.progress_bar {
    display: block;
    margin: 44px auto 0 auto;
    width: 100%;
    max-width: 420px;
    height: 6px;
    border-radius: 6px;
    background: rgba(138, 163, 125, 0.2);
    overflow: hidden;
}

.current_bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--sage), var(--rose));
    border-radius: 6px;
    transition: width 1s ease;
}

.msgSub {
    margin-top: 25px;
    font-size: 1rem;
    color: var(--ink-soft);
}

/* section timer finito */
.timer_finito_c {
    opacity: 0;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: absolute;
    width: 100%;
    min-height: 100dvh;
    box-sizing: border-box;
    transform: translateY(16px) scale(0.96);
    transition: opacity 1s ease-in-out, transform 1s ease-in-out;
}

.timer_finito_c.rivela_messaggio {
    display: flex !important;
    animation: entra_contenitore 0.8s ease-in-out forwards;
}

@keyframes entra_contenitore {
    0% {
        opacity: 0;
        transform: translateY(25px);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.gran_fiore_svg {
    width: 130px;
    height: 130px;
    margin: 0 auto 26px auto;
    opacity: 0;
    transform: scale(0.3) rotate(-25deg);
    transition: opacity 0.9s cubic-bezier(.34, 1.56, .64, 1), transform 0.9s cubic-bezier(.34, 1.56, .64, 1);
}

.gran_fiore_svg.sfiorisce {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.msg_t_f {
    font-size: clamp(1.8rem, 4.5vw, 2.6rem);
    line-height: 1.15;
    max-width: 22ch;
    margin: 0 auto 20px auto;
    color: var(--rose-deep);
}

.msgSub.timer_off {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: unset;
}

.timer_off_btn_c {
    margin-top: 32.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: fit-content;
    height: fit-content;
    border-radius: 100px;
}

.btn_t_o {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: var(--ink);
    -webkit-appearance: none;
    appearance: none;
    color: var(--cream);
    padding: 18px 44px;
    border-radius: 100px;
    border: none;
    font-family: 'Karia', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: var(--shadow);
    cursor: pointer;
    box-sizing: border-box;
    opacity: 0;
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    transform: translateY(10px);
    animation: btnIn 0.7s ease forwards 0.5s;
    background-clip: padding-box;
}

.btn_t_o:hover {
    background: var(--rose-deep);
}

.timer_off_btn_c:hover {
    transform: translateY(-1px);
    box-shadow: 0 24px 55px rgba(255, 141, 158, 0.35);
}

.btn_t_o svg {
    width: 1rem;
    height: 1rem;
}

.msg_sotto_btn {
    margin-top: 14px;
    font-size: 0.8rem;
    color: var(--ink-soft);
    opacity: 0;
    transform: translateY(10px);
    animation: btnIn 0.7s ease forwards 0.75s;
}

@keyframes btnIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* keyframes per nascondere il primo main e sostituirlo con il secondo */
.timer_main_c.mostra_main,
.main_app_c.mostra_main {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.timer_main_c.nascondi_main,
.main_app_c.nascondi_main {
    opacity: 0;
    pointer-events: none;
}

/* Parte del app main */
.timer_main_c,
.main_app_c {
    transition: all 0.6s ease-in-out;
    opacity: 0;
    pointer-events: none;
}

.main_app_c {
    background: transparent;
    color: var(--ink);
    font-family: 'Karla', sans-serif;
    width: 100%;
    min-height: 100dvh;
    overflow-y: auto;
}

.app {
    display: flex;
    flex-direction: column;
    position: relative;
    margin: 0 10%;
}

.progress_scroll {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 5px;
    background: rgba(138, 163, 125, 0.2);
    /* background: rgb(81 237 0); */
    z-index: 9999;
    pointer-events: none;
}

.progress_scroll .progress_scroll_fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--sage), var(--rose));
    transition: width 0.1s linear;
}

.app section {
    position: relative;
    z-index: auto;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 100px 0px;
    text-align: center;
}

#benvenuto_card {
    z-index: 1;
}

#benvenuto_card svg {
    width: 90px;
    height: 90px;
    margin-bottom: 27.5px;
    animation: fadeUp 1s ease forwards 0.2s;
}

#benvenuto_card p {
    margin-top: 20px;
    font-size: 1.1rem;
    color: var(--ink-soft);
    max-width: 40ch;
    animation: fadeUp 1s ease forwards 0.8;
}

#welc_eyebrown {
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.75em;
    color: var(--sage-deep);
    font-weight: 700;
    margin-bottom: 12px;
}

#benvenuto_card h1 span {
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    line-height: 1.08;
    max-width: 14ch;
    opacity: 0;
    animation: fadeUp 1s ease forwards 0.5s;
}

#benvenuto_card h1 span em {
    font-style: italic;
    font-weight: 500;
    color: var(--rose-deep);
}

#benvenuto_card h1 svg {
    width: clamp(1.5rem, 3vw, 3.5rem);
    height: clamp(1.5rem, 3vw, 3.5rem);
    margin: 0px;
}

.msg_welc_c {
    display: flex;
    flex-direction: column;
}

.msg_welc_c span #nome {
    font-style: italic;
    font-weight: 500;
    color: var(--rose-deep);
}

.inizia_btn {
    margin-top: 35px;
    padding: 16px 30px;
    border-radius: 100px;
    border: none;
    background: var(--ink);
    color: var(--cream);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: var(--shadow);
    cursor: pointer;
    opacity: 0;
    animation: fadeUp 1s ease forwards 1s;
    transition: transform 0.25s ease, background 0.25s ease;
}

.inizia_btn:hover {
    transform: translateY(-2.5px);
    background: var(--rose-deep);
    box-shadow: 0 24px 55px rgba(255, 141, 158, 0.35);
}

.dove_scrollare {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 5px;
    position: absolute;
    bottom: 34px;
    font-size: 0.75rem;
    color: var(--ink-soft);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0;
    animation: fadeUp 1s ease forwards 1.4s, fluttua 2.4s ease-in-out 1.4s infinite;
}

.dove_scrollare .freccia_giu {
    width: 0.75rem !important;
    height: 0.75rem !important;
    margin: unset !important;
}

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(18px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fluttua {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(6px);
    }
}

/* pannello di sviluppo di quella parte */
.sviluppo_in_corso {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: absolute;
    min-height: 100dvh;
    width: 100%;
    backdrop-filter: blur(5px);
}

/* div btn per indirizzarlo alla pagina per cui ricavo i dati */
#giveData {
    position: absolute;
    bottom: 40px;
    padding: 10px 18px;
    border-radius: 100px;
    border: none;
    background: var(--ink);
    color: var(--cream);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.25s ease;
}

#giveData:hover {
    transform: translateY(-2.5px);
    background: var(--rose-deep);
    box-shadow: 0 24px 55px rgba(255, 141, 158, 0.35);
}

/* switch background */
.switch_background {
    position: absolute;
    display: none;
}