:root {
    --bg-dark: #0f111a;
    --card-bg: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #f8f9fa;
    --text-secondary: #adb5bd;
    --primary-red: #ec407a;
    --primary-red-hover: #d81b60;
    --whatsapp-green: #25D366;
    --blob-1: #ec407a;
    --blob-2: #f06292;
}

* {
    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;
    /* overflow-x: hidden removed to fix sticky positioning */
    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.4;
    border-radius: 50%;
    animation: float 20s infinite ease-in-out alternate;
}

.red-blob {
    background: var(--blob-1);
    width: 40vw;
    height: 40vw;
    top: -10vw;
    left: -10vw;
}

.purple-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);
    }
}

/* 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-red);
}

.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;
    /* Let clicks pass through empty space */
}

.selection-counter {
    background: rgba(15, 17, 26, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 51, 102, 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;
    /* Re-enable clicks on the box itself */
}

.selection-counter.success {
    background: rgba(15, 17, 26, 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-red);
}

.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: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.phrase-label {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    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;
}

.phrase-label input[type="checkbox"]:checked {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
}

.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-red);
    box-shadow: 0 0 15px rgba(255, 51, 102, 0.2);
}

.phrase-text {
    font-size: 1.05rem;
    line-height: 1.4;
    user-select: none;
    padding-top: 2px;
}

/* Buttons */
.primary-btn, .whatsapp-btn, .secondary-btn, .text-btn {
    width: 100%;
    padding: 1rem;
    border-radius: 20px; /* More rounded */
    font-size: 1.1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.primary-btn {
    background-color: var(--primary-red);
    color: white;
    border: none;
}

.primary-btn:hover {
    background-color: var(--primary-red-hover);
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(236, 64, 122, 0.3);
}

.whatsapp-btn {
    background-color: var(--whatsapp-green);
    color: white;
    border: none;
    margin-bottom: 1rem;
}

.whatsapp-btn:hover {
    background-color: #1ebe5d;
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(37, 211, 102, 0.3);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.02);
}

.text-btn {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.text-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.02);
}

.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);
    }
}

/* Circular Progress */
.score-circle {
    width: 150px;
    height: 150px;
    margin: 0 auto 1.5rem;
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 80%;
    max-height: 250px;
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 3.8;
}

.circle {
    fill: none;
    stroke-width: 2.8;
    stroke-linecap: round;
    transition: stroke-dasharray 1.5s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.5s ease;
}

.percentage {
    fill: #fff;
    font-family: inherit;
    font-size: 10px;
    font-weight: 800;
    text-anchor: middle;
}

.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: 0;
    position: relative;
}

.detected-flags strong {
    color: var(--primary-red);
}

/* CTA Box */
.cta-box {
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.1) 0%, rgba(138, 43, 226, 0.1) 100%);
    border: 1px solid rgba(255, 51, 102, 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);
}

/* Handled in main buttons section */

.app-footer {
    text-align: center;
    margin-top: 2rem;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.85rem;
}

.disclaimer-small {
    margin-top: 0.5rem;
    font-size: 0.7rem;
    opacity: 0.6;
    max-width: 450px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.4;
}

/* 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, 17, 26, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 2px solid #ff0000;
    box-shadow: 0 10px 30px rgba(255, 0, 0, 0.3);
    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-red);
}

/* Glossary Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 17, 26, 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;
    /* Override the default hidden display none so opacity animates */
}

.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: #fff;
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.modal-emoji {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.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-red);
}

.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-red);
}

/* 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-red);
    background: rgba(255, 255, 255, 0.1);
}

.sharing-buttons-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.share-btn-instagram, .share-btn-whatsapp, .share-btn-copy {
    width: 100%;
    padding: 1rem;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    border: none;
    transition: all 0.3s;
    color: white;
}

.share-btn-instagram {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.share-btn-whatsapp {
    background-color: #25D366;
}

.share-btn-copy {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.share-btn-instagram:hover, .share-btn-whatsapp:hover, .share-btn-copy:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.privacy-notice {
    font-size: 0.75rem !important;
    opacity: 0.7;
    margin-bottom: 0 !important;
    line-height: 1.4;
}

@media (max-width: 600px) {
    .app-container {
        padding: 1rem;
    }

    .app-header h1 {
        font-size: 1.6rem;
        /* Reduzido para não quebrar */
    }

    .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;
        /* Previne quebras de linha nos botões */
        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;
    }
}