/* ==========================================================================
   Calculadora do Período Fértil — estilos
   Identidade: saúde/clínica moderna, azul-petróleo + rosa/lilás (fertilidade),
   cartão flutuante com sombra suave, calendário com período fértil e ovulação
   ========================================================================== */
:root {
    --primaria: #015d81;
    --primaria-escura: #01415c;
    --primaria-clara: #e6f3f8;
    --verde-check: #05ab42;
    --fertil: #6366f1;
    --fertil-bg: #eef0fd;
    --ovulacao: #e46ab7;
    --ovulacao-bg: #fcecf7;
    --texto-principal: #0f2733;
    --texto-secundario: #5b7480;
    --borda: #dde5ea;
    --fundo-secao: #f6fafb;
    --fundo-card: #ffffff;
    --sombra-card: 0 20px 45px -22px rgba(210, 212, 213, 0.28);
    --sombra-suave: 0 4px 14px -6px rgba(1, 65, 92, 0.14);
    --raio-sm: 10px;
    --raio-md: 16px;
    --raio-lg: 22px;
}

/* ======= CARTÃO PRINCIPAL ======= */
.calculadora-fertil {
    position: relative;
    max-width: 100%;
    margin: 32px auto 20px;
    padding: 40px 32px 32px;
    background: var(--fundo-card);
    border-radius: var(--raio-lg);
    box-shadow: var(--sombra-card);
    font-family: 'Rubik', Helvetica, Arial, sans-serif;
    color: rgb(61, 61, 61);
    overflow: hidden;
}

.calculadora-fertil::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primaria), var(--ovulacao));
}

.calculadora-fertil::after {
    content: "❤";
    position: absolute;
    top: 20px;
    right: 28px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--ovulacao);
    background: var(--ovulacao-bg);
    border-radius: 50%;
}

.calculadora-fertil h2 {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: rgb(61, 61, 61);
    margin-bottom: 24px;
    padding-right: 54px;
    text-align: left !important;
}

.calculadora-fertil h2::after {
    content: "";
    display: block;
    width: 42px;
    height: 4px;
    margin-top: 10px;
    border-radius: 999px;
    background: var(--ovulacao);
}

/* ======= INPUTS (sobrepõe os estilos inline do HTML) ======= */
.calculadora-fertil label {
    color: rgb(61, 61, 61);
    font-weight: 600 !important;
    font-size: 0.85rem !important;
}

.calculadora-fertil input[type="date"],
.calculadora-fertil select {
    height: auto !important;
    padding: 13px 14px !important;
    border: 1.5px solid var(--borda) !important;
    border-radius: var(--raio-sm) !important;
    background: var(--fundo-secao);
    font-size: 0.95rem !important;
    font-weight: 600;
    color: rgb(61, 61, 61);
    font-family: inherit;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.calculadora-fertil select {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9' fill='none'><path d='M1 1L7 7L13 1' stroke='%235b7480' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px !important;
}

.calculadora-fertil input[type="date"]:hover,
.calculadora-fertil select:hover {
    border-color: #b7cdd6 !important;
}

.calculadora-fertil input[type="date"]:focus,
.calculadora-fertil select:focus {
    outline: none;
    border-color: var(--primaria) !important;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(61, 61, 61, );
}

/* ======= BOTÃO CALCULAR ======= */
.calculadora-fertil .flex.justify-center {
    justify-content: center;
    margin-top: 10px;
}

.calculadora-fertil button {
    background: linear-gradient(135deg, var(--primaria), var(--primaria-escura)) !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    box-shadow: var(--sombra-suave);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease !important;
}

.calculadora-fertil button:active {
    transform: translateY(0);
    filter: brightness(0.95);
}

/* ==========================================================================
   Resultado
   ========================================================================== */
.resultado {
    display: none;
    margin-top: 20px;
    padding-top: 20px;
    background: transparent;
    border-radius: 0;
    border-top: 1px dashed var(--borda);
    animation: entrar .4s ease both;
}

@keyframes entrar {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

.topo {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.check {
    width: 46px;
    height: 46px;
    background: var(--verde-check);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
    flex-shrink: 0;
    box-shadow: 0 6px 16px -6px rgba(22, 163, 74, 0.5);
}

.topo>div>span {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgb(61, 61, 61);
}

.resultado h2 {
    font-size: 1.05rem !important;
    line-height: 1.4 !important;
    font-weight: 600;
    color: var(--primaria-escura) !important;
    margin-top: 4px !important;
}

.texto {
    font-size: 14px;
    color: rgb(61, 61, 61);
    line-height: 1.6;
    margin-top: 14px;
    background: var(--fundo-secao);
    border-radius: var(--raio-sm);
    padding: 14px 16px;
}

.texto b {
    color: var(--texto-principal);
}

/* ======= CALENDÁRIO ======= */
.calendario-box {
    background: var(--fundo-card);
    margin-top: 18px;
    border-radius: var(--raio-md);
    border: 1px solid var(--borda);
    padding: 16px;
}

.mes {
    text-align: center;
    font-size: 1rem !important;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-transform: capitalize;
    color: rgb(61, 61, 61);
    margin-bottom: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--texto-secundario) !important;
}

td {
    height: 42px;
    text-align: center;
    font-size: 0.88rem !important;
    font-weight: 600;
    color: var(--texto-principal);
    position: relative;
    border-radius: 8px;
}

.fertil {
    background: var(--fertil-bg);
    color: var(--fertil);
}

.fertil::after {
    content: "💧";
    display: block;
    font-size: 9px;
    line-height: 1;
    margin-top: 2px;
}

.ovulacao {
    background: var(--ovulacao-bg);
    color: var(--ovulacao);
    font-weight: 800;
}

.ovulacao::after {
    content: "❤️";
    display: block;
    font-size: 9px;
    line-height: 1;
    margin-top: 2px;
}

.legendaspan {
    margin-top: 14px;
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.82rem !important;
}

.legendaspan span {
    border-radius: 10px;
    padding: 6px 12px;
    font-weight: 400;
}

/* ======= RESPONSIVO ======= */
@media (max-width: 728px) {
    .calculadora-fertil {
        margin: 0;
        border-radius: 10px;
        padding: 30px 20px 24px;
        max-width: 100%;
    }

    .check {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }

    .resultado h2 {
        font-size: 0.92rem !important;
        margin: 4px 0 0 !important;
    }

    .texto {
        font-size: 0.88rem !important;
    }

    .mes {
        font-size: 0.9rem !important;
    }

    td {
        height: 40px;
        font-size: 0.8rem !important;
    }

    th {
        font-size: 0.72rem !important;
    }

    .legendaspan {
        font-size: 12px;
    }
}

/* ======= ACESSIBILIDADE ======= */
.calculadora-fertil button:focus-visible,
.calculadora-fertil input:focus-visible,
.calculadora-fertil select:focus-visible {
    outline: 3px solid var(--primaria);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .resultado {
        animation: none !important;
        transition: none !important;
    }
}