:root {
    --bg-dark: #0f172a;
    /* Azul muito escuro (slate-900) */
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    /* Quase branco (slate-50) */
    --text-secondary: #94a3b8;
    /* Cinza azulado claro (slate-400) */
    --primary-color: #3b82f6;
    /* Azul serene (blue-500) */
    --primary-color-hover: #2563eb;
    /* Azul mais escuro (blue-600) */
    --whatsapp-green: #25D366;
    --blob-1: #0ea5e9;
    /* Sky blue (sky-500) */
    --blob-2: #10b981;
    /* Emerald green (emerald-500) */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

/* Background Animations */
.background-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    opacity: 0.3;
    border-radius: 50%;
    animation: float 20s infinite ease-in-out alternate;
}

.blue-blob {
    background: var(--blob-1);
    width: 40vw;
    height: 40vw;
    top: -10vw;
    left: -10vw;
}

.green-blob {
    background: var(--blob-2);
    width: 35vw;
    height: 35vw;
    bottom: -10vw;
    right: -10vw;
    animation-delay: -10s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(10vw, 10vh) scale(1.2);
    }
}

/* Circular Progress */
.score-circle {
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
}

/* Container */
.app-container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.app-header {
    text-align: center;
    margin: 1rem 0 2rem 0;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.05em;
}

.highlight {
    color: var(--primary-color);
}

.app-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.selection-counter-wrapper {
    position: sticky;
    top: 15px;
    z-index: 100;
    text-align: center;
    margin-bottom: 2rem;
    pointer-events: none;
}

.selection-counter {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(59, 130, 246, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    display: inline-block;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s;
    pointer-events: auto;
}

.selection-counter.success {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(37, 211, 102, 0.5);
    color: var(--whatsapp-green);
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.2);
}

.highlight-text {
    font-weight: 800;
    color: var(--primary-color);
}

.selection-counter.success .highlight-text {
    color: var(--whatsapp-green);
}

/* Icon visibility */
.mobile-icon {
    display: none;
}

.desktop-icon {
    display: inline;
}

/* Glassmorphism Card */
#quiz-section,
.score-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all 0.4s ease;
}

.hidden {
    display: none !important;
}

/* Checkboxes */
.checkbox-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.phrase-label {
    display: flex;
    align-items: flex-start;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.phrase-label:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.phrase-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    margin-right: 1rem;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
    margin-top: 2px;
}

.phrase-label input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.phrase-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 16px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.phrase-label.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.phrase-text {
    font-size: 1.05rem;
    line-height: 1.5;
    user-select: none;
    padding-top: 2px;
}

/* Buttons */
.primary-btn {
    width: 100%;
    padding: 1.2rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.primary-btn:hover {
    background-color: var(--primary-color-hover);
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.secondary-btn {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    justify-content: center;
    align-items: center;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.tertiary-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.tertiary-btn:hover {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.1) 100%);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.15);
}

.tertiary-btn:active {
    transform: scale(0.98);
}

/* Results Section */
.score-card {
    text-align: center;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.book-recommendation {
    margin: 2rem 0;
}

.book-cover {
    max-width: 200px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    margin: 0 auto 1.5rem;
    display: block;
}

.result-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 1rem 0 2rem;
    line-height: 1.5;
}

/* Detected Flags */
.detected-flags {
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.detected-flags h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.detected-flags ul {
    list-style: none;
}

.detected-flags li {
    margin-bottom: 0.8rem;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.4;
}

.detected-flags li::before {
    content: '🧠';
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 0.9rem;
}

.detected-flags strong {
    color: var(--primary-color);
}

/* CTA Box */
.cta-box {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(16, 185, 129, 0.1) 100%);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.cta-box h3 {
    color: #fff;
    margin-bottom: 0.5rem;
}

.cta-box p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.book-btn {
    display: inline-block;
    background: #fff;
    color: #000;
    text-decoration: none;
    padding: 1rem 2rem;
    border-radius: 30px;
    font-weight: 800;
    transition: all 0.3s;
}

.book-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

/* WhatsApp Share */
.whatsapp-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--whatsapp-green);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.whatsapp-btn:hover {
    background-color: #1ebe5d;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.3);
}

.text-btn {
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 12px;
    font-family: inherit;
    font-weight: 600;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 0.5rem;
}

.percentage {
    fill: #fff;
    font-family: inherit;
    font-size: 10px;
    font-weight: 800;
    text-anchor: middle;
}

.text-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.app-footer {
    text-align: center;
    margin-top: 2rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
}

.app-footer .disclaimer {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* Toast Notification (Popup) */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    z-index: 9999;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    opacity: 0;
    pointer-events: none;
}

.toast-container.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-content {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--primary-color);
    box-shadow: 0 10px 30px rgba(59, 130, 246, 0.2);
    padding: 1rem 1.5rem;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: white;
    font-weight: 600;
}

.toast-icon {
    color: var(--primary-color);
}

/* Glossary Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    display: flex !important;
}

.modal-content {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.5rem;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.hidden .modal-content {
    transform: translateY(30px);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close-btn:hover {
    color: white;
}

.modal-content h2 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.modal-content p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal-link {
    display: inline-block;
    color: #fff;
    text-decoration: underline;
    font-weight: 600;
}

.modal-link:hover {
    color: var(--primary-color);
}

.term-link {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 4px;
    transition: color 0.2s;
}

.term-link:hover {
    color: var(--primary-color);
}

/* Email Modal specific */
.text-center {
    text-align: center;
}

.email-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.email-input {
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s;
}

.email-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.1);
}

.privacy-notice {
    font-size: 0.75rem !important;
    opacity: 0.7;
    margin-bottom: 0 !important;
}

.privacy-notice a {
    color: var(--primary-color);
    text-decoration: underline;
}

@media (max-width: 600px) {
    .app-container {
        padding: 1rem;
    }

    .app-header h1 {
        font-size: 1.8rem;
    }

    .mobile-icon {
        display: inline-block;
        font-size: 2.2rem;
        margin-bottom: 0.2rem;
        line-height: 1;
    }

    .desktop-icon {
        display: none;
    }

    .selection-counter-wrapper {
        top: 10px;
        margin-bottom: 1.5rem;
    }

    .selection-counter {
        font-size: 0.85rem;
        padding: 0.6rem 1rem;
    }

    .primary-btn,
    .whatsapp-btn,
    .secondary-btn,
    .tertiary-btn {
        font-size: 0.95rem;
        padding: 0.8rem 1rem;
    }

    .toast-content {
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
        width: max-content;
        max-width: 95vw;
        box-sizing: border-box;
        justify-content: center;
        text-align: center;
    }
}