:root {
    --color-primary: #0284c7;
    --color-primary-dark: #0369a1;
    --color-primary-light: #e0f2fe;
    --color-accent: #0ea5e9;
    --color-success: #10b981;
    --bg-light: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --text-primary: #0f172a;
    --text-muted: #475569;
    --border-light: #e2e8f0;
    --border-active: #0284c7;
    --font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 24px -4px rgba(14, 165, 233, 0.12);
    --shadow-lg: 0 16px 36px -8px rgba(15, 23, 42, 0.12);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    height: 100%;
    width: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    min-height: 100dvh;
    width: 100%;
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
    background-color: var(--bg-light);
    color: var(--text-primary);
    overflow-x: hidden;
    overflow-y: auto;
}

body.light-mode {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Top Navigation Bar */
.top-nav-bar {
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-light);
    padding: 0.65rem 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 200;
}

.nav-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.nav-brand-title {
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    color: var(--text-primary);
}

.nav-brand-sub {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--color-primary);
    text-transform: uppercase;
}

/* Main Container Wrapper */
.app-main-wrapper {
    width: 100%;
    max-width: 520px;
    padding: 0.65rem 0.85rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    box-sizing: border-box;
}

/* Doctor Header Profile */
.doctor-top-header {
    width: 100%;
    padding: 0.25rem 0.35rem;
}

.doctor-top-badge {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.doctor-avatar-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.doctor-top-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-primary);
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.25);
}

.avatar-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 11px;
    height: 11px;
    background-color: var(--color-success);
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
    animation: onlinePulse 2s infinite ease-in-out;
}

@keyframes onlinePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.18); opacity: 0.8; }
}

.doctor-top-text {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
}

.doctor-name-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.doctor-top-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

.verified-badge {
    color: var(--color-primary);
    display: inline-flex;
    align-items: center;
}

.verified-badge .material-symbols-outlined {
    font-size: 18px;
    font-weight: 700;
}

.doctor-top-sub {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0;
}

/* Quiz Card Frame */
.quiz-card-box {
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 1.35rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Progress Bar & Navigation Header */
.progress-header {
    position: relative;
    width: 100%;
    z-index: 100;
    padding: 0.75rem 1.1rem 0.5rem;
    background-color: #ffffff;
    border-bottom: 1px solid #f1f5f9;
}

.progress-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 0.45rem;
}

.btn-step-back {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.65rem;
    border: 1px solid var(--border-light);
    border-radius: 0.6rem;
    background-color: #f8fafc;
    color: var(--text-muted);
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.btn-step-back .material-symbols-outlined {
    font-size: 14px;
    font-weight: 800;
}

.btn-step-back:hover:not(:disabled) {
    background-color: #f1f5f9;
    color: var(--text-primary);
    border-color: #cbd5e1;
}

.btn-step-back:active:not(:disabled) {
    transform: scale(0.95);
}

.btn-step-back:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    border-color: #f1f5f9;
    background-color: #ffffff;
}

.progress-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.progress-step-tag {
    color: var(--color-primary);
    font-weight: 800;
}

.progress-percent {
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
    padding: 0.15rem 0.45rem;
    border-radius: 0.4rem;
    font-size: 0.72rem;
    font-weight: 800;
}

.progress-bar-track {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
    background-color: #e2e8f0;
}

.progress-bar-fill {
    height: 100%;
    width: 10%;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-accent) 100%);
    border-radius: 999px;
    transition: width var(--transition-normal);
}

/* Quiz Viewport & Slider */
.quiz-viewport {
    width: 100%;
    min-height: 400px;
    overflow: hidden;
    position: relative;
    background-color: #ffffff;
}

.quiz-slider {
    display: flex;
    width: 100%;
    height: 100%;
    transition: transform var(--transition-normal);
    will-change: transform;
}

.quiz-screen {
    width: 100%;
    flex: 0 0 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding: 1.25rem 1rem 1.25rem;
    overflow-y: auto;
    background-color: #ffffff;
    box-sizing: border-box;
}

.screen-content {
    width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: flex-start;
    animation: fadeIn 0.35s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.quiz-title {
    font-size: 1.35rem;
    line-height: 1.28;
    font-weight: 800;
    text-align: center;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 0.1rem;
}

.quiz-subtitle {
    font-size: 0.88rem;
    line-height: 1.45;
    text-align: center;
    color: var(--text-muted);
    margin-top: -0.2rem;
    margin-bottom: 0.2rem;
}

/* Options Grids */
.options-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem; 
    width: 100%;
    margin-top: 0.15rem;
}

.option-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.15rem; 
    border-radius: 1.05rem;
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
    position: relative;
    background-color: #ffffff;
    border: 2px solid var(--border-light);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    -webkit-tap-highlight-color: transparent;
}

.option-card *,
.btn-continue *,
.btn-step-back * {
    pointer-events: none;
}

.option-card:hover {
    transform: translateY(-1px);
    background-color: var(--bg-card-hover);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.option-card:active {
    transform: scale(0.985);
}

.option-card.selected {
    border-color: var(--color-primary) !important;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
    box-shadow: 0 0 0 3.5px rgba(2, 132, 199, 0.18);
}

/* Square Cards Grid (Step 1 - Idade) */
.options-grid-square {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem; 
    width: 100%;
    margin-top: 0.25rem;
}

.option-card-square {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 0.6rem;
    border-radius: 1.05rem;
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
    background-color: #ffffff;
    border: 2px solid var(--border-light);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.option-card-square:hover {
    transform: translateY(-2px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.option-card-square:active {
    transform: scale(0.96);
}

.option-card-square.selected {
    border-color: var(--color-primary) !important;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%) !important;
    box-shadow: 0 0 0 3.5px rgba(2, 132, 199, 0.22);
}

.square-img-box {
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 80px;
    border-radius: 0.75rem;
    overflow: hidden;
    margin-bottom: 0.5rem; 
    border: 1px solid var(--border-light);
    background-color: #f8fafc;
    position: relative;
}

.square-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-fast);
}

.option-card-square:hover .square-img-box img {
    transform: scale(1.06);
}

.square-option-label {
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-primary);
    padding: 0.1rem 0;
}

@media (min-width: 400px) {
    .square-option-label {
        font-size: 0.9rem;
    }
}

.option-label {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.35;
}

.option-indicator {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.option-card.selected .option-indicator {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
    color: #ffffff;
}

.option-indicator::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ffffff;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.option-card.selected .option-indicator::after {
    opacity: 1;
}

/* Feature List (Steps 6, 7, 8) */
.feature-list {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
}

.feature-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.95rem;
    border-radius: 0.95rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%);
    border: 1px solid rgba(2, 132, 199, 0.18);
    border-left: 4px solid var(--color-primary); 
    box-shadow: var(--shadow-sm); 
    cursor: default; 
    user-select: none;
}

.feature-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 50%; 
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: var(--color-primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.28);
}

.feature-icon-box .material-symbols-outlined {
    font-size: 20px;
}

.feature-title {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
}

/* Before / After Comparison Box (Step 5) */
.before-after-comparison-box {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0;
    max-width: 440px;
    margin: 0 auto;
}

.comparison-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.comparison-badge {
    padding: 0.25rem 0.85rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.badge-antes {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.badge-depois {
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
    border: 1px solid rgba(2, 132, 199, 0.3);
}

.comparison-img-circle {
    width: 100%;
    max-width: 150px;
    aspect-ratio: 1 / 1;
    border-radius: 50%; 
    overflow: hidden;
    position: relative;
    border: 3px solid var(--color-primary);
    box-shadow: 0 8px 22px rgba(2, 132, 199, 0.22);
    background-color: #ffffff;
    transition: transform var(--transition-fast);
}

.comparison-item:hover .comparison-img-circle {
    transform: scale(1.04);
}

.comparison-img-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.disclaimer-text {
    font-size: 0.72rem;
    text-align: center;
    color: var(--text-muted);
    margin-top: -0.25rem;
}

.result-immediate-tag {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 0.9rem;
    border-radius: 0.85rem;
    background-color: var(--color-primary-light);
    color: var(--color-primary-dark);
    font-size: 0.88rem;
    font-weight: 800;
    margin: 0.15rem 0;
    border: 1px solid rgba(2, 132, 199, 0.25);
    letter-spacing: 0.02em;
}

/* Primary Glow Button */
.btn-primary-glow {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.25rem;
    border-radius: 0.95rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 800;
    border: none;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.35);
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.btn-primary-glow:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(2, 132, 199, 0.45);
}

.btn-primary-glow:active {
    transform: scale(0.98);
}

/* Step 9 (Analisando Checklist Sequence) */
.analyzing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1.5rem 0.85rem;
    gap: 1.2rem;
    width: 100%;
}

.analyzing-pulse-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
}

.analyzing-icon {
    font-size: 2.4rem;
}

.analyzing-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
}

.analyzing-checklist {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
    max-width: 380px;
    margin-top: 0.5rem;
    text-align: left;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.9rem;
    border-radius: 0.85rem;
    background-color: #f8fafc;
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-muted);
}

.checklist-item.active {
    background-color: var(--color-primary-light);
    border-color: rgba(2, 132, 199, 0.3);
    color: var(--color-primary-dark);
    box-shadow: var(--shadow-sm);
}

.checklist-item.done {
    background-color: #ecfdf5;
    border-color: rgba(16, 185, 129, 0.3);
    color: #065f46;
}

.item-status-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.item-status-icon .material-symbols-outlined {
    font-size: 18px;
}

.spinner-mini {
    width: 16px;
    height: 16px;
    border: 2.5px solid rgba(2, 132, 199, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spinRound 0.8s linear infinite;
}

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

/* Step 10 (Resultado & Profile Recap) */
.profile-summary-box {
    width: 100%;
    padding: 1rem;
    border-radius: 1.1rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%);
    border: 1.5px solid rgba(2, 132, 199, 0.25);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin: 0.2rem 0;
    text-align: left;
}

.summary-header-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.summary-details-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.summary-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text-primary);
}

.summary-chip-bullet {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--color-primary);
    flex-shrink: 0;
}

/* WhatsApp CTA Button */
.btn-whatsapp-cta {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%) !important;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35) !important;
    margin-top: 0.4rem;
    gap: 0.65rem;
    position: relative;
    overflow: hidden;
}

.btn-whatsapp-cta:hover {
    box-shadow: 0 12px 30px rgba(37, 211, 102, 0.5) !important;
    transform: translateY(-2px);
}

.btn-whatsapp-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(255, 255, 255, 0.18) 50%,
        transparent 100%
    );
    transform: rotate(30deg);
    animation: shineEffect 3.5s infinite;
}

@keyframes shineEffect {
    0% { transform: translateX(-100%) rotate(30deg); }
    30%, 100% { transform: translateX(100%) rotate(30deg); }
}

.whatsapp-icon-svg {
    fill: #ffffff;
    flex-shrink: 0;
}

/* Trust Badges Grid */
.trust-badges-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 0.4rem;
    flex-wrap: wrap;
}

.trust-badge-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
}

.trust-badge-item .material-symbols-outlined {
    font-size: 15px;
    color: var(--color-primary);
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes popIn {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(16px); }
    to { opacity: 1; transform: translateX(0); }
}

.quiz-screen:not(.active):not(:first-child) .animate-fade-in-down,
.quiz-screen:not(.active):not(:first-child) .animate-fade-in,
.quiz-screen:not(.active):not(:first-child) .animate-slide-up,
.quiz-screen:not(.active):not(:first-child) .animate-pop-in {
    opacity: 0;
}

.quiz-screen.active .animate-fade-in-down {
    animation: fadeInDown 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.quiz-screen.active .animate-fade-in {
    animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.quiz-screen.active .animate-slide-up {
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.quiz-screen.active .animate-pop-in {
    animation: popIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 { animation-delay: 0.06s !important; }
.delay-2 { animation-delay: 0.12s !important; }
.delay-3 { animation-delay: 0.18s !important; }
.delay-4 { animation-delay: 0.24s !important; }
