/* Custom styles to match your brand */
body {
    background-color: #DFEEE2;
    color: #405449;
    font-family: 'Inter', sans-serif;
    transition: background-image 0.5s ease-in-out;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

body.bg-image-active {
    background-image: linear-gradient(rgba(223, 238, 226, 0.85), rgba(223, 238, 226, 0.85)), url('images/fondo1.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.font-fraunces {
    font-family: 'Fraunces', serif;
    font-weight: 800;
}

#quiz-container {
    width: 100%;
    max-width: 64rem;
    margin: 0 auto;
    text-align: center;
}

.btn {
    width: 100%;
    max-width: 24rem;
    background-color: #405449;
    color: #DFEEE2;
    border: 3px solid #314037;
    border-radius: 9999px;
    padding: 0.75rem 1.5rem;
    font-family: 'Fraunces', serif;
    font-weight: 800;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: inline-block;
}

.btn:hover:not(:disabled) {
    transform: scale(1.05);
    border-color: #cde4d3;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.option-btn {
    width: 100%;
    max-width: 28rem;
    text-align: center;
    background-color: #405449;
    color: #DFEEE2;
    border: 3px solid #314037;
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    font-family: 'Fraunces', serif;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    margin: 0 auto;
}

.option-btn:hover {
    transform: scale(1.03);
    border-color: #cde4d3;
}

.option-btn.selected {
    transform: scale(1.03);
    background-color: #DFEEE2;
    color: #405449;
    border-color: #405449;
    border-width: 4px;
    box-shadow: 0 0 20px rgba(64, 84, 73, 0.5);
    font-weight: 900;
}

.category-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: transform 300ms ease-in-out;
}

.category-circle .icon-container {
    width: 7rem;
    height: 7rem;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    border: 2px solid transparent;
    transition: background-color 300ms, border-color 300ms;
}

.category-circle:hover .icon-container {
    background-color: #cde4d3;
}

.category-circle .icon {
    font-size: 2.5rem;
    line-height: 1;
}

.category-circle .category-name {
    font-family: 'Fraunces', serif;
    font-weight: 800;
    font-size: 0.875rem;
    background-color: #405449;
    color: #DFEEE2;
    padding: 0.25rem 1rem;
    border-radius: 9999px;
    transition: background-color 300ms, color 300ms;
}

.category-circle:hover .category-name {
    background-color: #cde4d3;
    color: #405449;
}

.category-circle.selected .icon-container {
    background-color: #cde4d3;
    border-color: #405449;
}

.category-circle.selected .category-name {
    background-color: #cde4d3;
    color: #405449;
}

#category-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    max-width: 48rem;
    margin: 0 auto;
    padding: 0 1rem;
}

#options-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 32rem;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 768px) {
    body {
        padding: 2rem;
    }

    .category-circle .icon-container {
        width: 8rem;
        height: 8rem;
    }

    .category-circle .icon {
        font-size: 3rem;
    }

    .category-circle .category-name {
        font-size: 1rem;
    }

    #category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
}

.quiz-step {
    display: none;
}

.product-card {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: left;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.product-card .product-name {
    font-family: 'Fraunces', serif;
    font-weight: 800;
    font-size: 1.25rem;
    color: #405449;
}

.product-card .product-description {
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    color: #314037;
    font-size: 0.95rem;
}

.product-card .product-link {
    display: inline-block;
    background-color: #405449;
    color: #DFEEE2;
    padding: 0.5rem 1.5rem;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.2s;
}

.product-card .product-link:hover {
    transform: scale(1.05);
}

.text-input {
    width: 100%;
    max-width: 28rem;
    padding: 1rem;
    border: 2px solid #405449;
    border-radius: 0.75rem;
    background-color: white;
    font-size: 1rem;
    color: #405449;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    display: block;
}

.text-input::placeholder {
    color: #405449;
    opacity: 0.6;
}

#email-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 32rem;
    margin: 0 auto;
    padding: 0 1rem;
}

#recommendations-container {
    max-width: 600px;
    margin: 2rem auto 0;
    padding: 0 1rem;
}

.hidden {
    display: none !important;
}

#loading-spinner {
    width: 4rem;
    height: 4rem;
    border: 4px solid #405449;
    border-style: dashed;
    border-radius: 9999px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.back-button {
    display: block;
    margin: 2.5rem auto 0;
    font-size: 1.125rem;
    opacity: 0.8;
    background: none;
    border: none;
    color: #405449;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.back-button:hover {
    opacity: 1;
}

/* Format Preference Cards */
.format-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background-color: white;
    border: 3px solid #405449;
    border-radius: 1rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    position: relative;
}

.format-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    border-color: #cde4d3;
}

.format-card.selected {
    background-color: #cde4d3;
    border-color: #405449;
    border-width: 4px;
}

.format-icon {
    font-size: 3rem;
    flex-shrink: 0;
    line-height: 1;
}

.format-content {
    flex: 1;
    text-align: left;
}

.format-title {
    font-family: 'Fraunces', serif;
    font-weight: 800;
    font-size: 1.25rem;
    color: #405449;
    margin: 0 0 0.5rem 0;
}

.format-description {
    font-size: 0.95rem;
    color: #314037;
    margin: 0;
    line-height: 1.4;
}

.format-checkmark {
    font-size: 2rem;
    color: #405449;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
    flex-shrink: 0;
}

.format-card.selected .format-checkmark {
    opacity: 1;
}

/* Responsive typography */
@media (max-width: 640px) {
    .font-fraunces {
        font-size: 1.75rem !important;
    }

    h1.font-fraunces {
        font-size: 1.75rem !important;
    }

    h2.font-fraunces {
        font-size: 1.5rem !important;
    }

    body {
        padding: 0.75rem;
    }

    .btn {
        font-size: 1rem;
        padding: 0.625rem 1.25rem;
    }

    .option-btn {
        font-size: 0.95rem;
        padding: 0.875rem 1rem;
    }

    .category-circle .icon-container {
        width: 6rem;
        height: 6rem;
    }

    .category-circle .icon {
        font-size: 2rem;
    }

    #category-grid {
        gap: 1.5rem;
        padding: 0 0.5rem;
    }

    .format-card {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1.25rem;
    }

    .format-icon {
        font-size: 2.5rem;
    }

    .format-content {
        text-align: center;
    }

    .format-title {
        font-size: 1.125rem;
    }

    .format-description {
        font-size: 0.875rem;
    }

    .format-checkmark {
        position: absolute;
        top: 1rem;
        right: 1rem;
        font-size: 1.5rem;
    }
}

@media (min-width: 768px) {
    h1.font-fraunces {
        font-size: 3rem !important;
    }

    h2.font-fraunces {
        font-size: 2.25rem !important;
    }
}
