/* ========================================================
   DESIGN SYSTEM - ABA DA EMILLY (ESTÉTICA COOL / PRE-TEEN)
   Inspirado em apps de hábitos modernos, Duolingo e interfaces gamer
   ======================================================== */

.emilly-body {
    background-color: #F8FAFC;
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(139, 92, 246, 0.05) 0px, transparent 50%);
    min-height: 100vh;
    color: #0F172A;
}

/* ========================================================
   1. HEADER & HUD DE GAMIFICAÇÃO
   ======================================================== */

.emilly-header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid #E2E8F0;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 14px 24px;
    box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.06);
}

.header-container {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

/* Informações do Perfil */
.profile-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar-wrapper {
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
}

.profile-avatar {
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #06B6D4 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: #FFFFFF;
    box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.4);
    border: 2px solid #FFFFFF;
    transition: transform 0.2s ease;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-wrapper:hover .profile-avatar {
    transform: scale(1.05) rotate(-2deg);
}

.avatar-edit-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.avatar-wrapper:hover .avatar-edit-badge {
    opacity: 1;
}

.online-indicator {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 14px;
    height: 14px;
    background-color: #10B981;
    border: 2px solid #FFFFFF;
    border-radius: 50%;
}

.profile-texts {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-tag-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gamer-tag {
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    color: #6366F1;
    background: #EEF2FF;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.8px;
    border: 1px solid #E0E7FF;
}

.level-pill-mini {
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    color: #0891B2;
    background: #ECFEFF;
    padding: 2px 8px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    border: 1px solid #CFFAFE;
}

.profile-texts h1 {
    font-size: 1.45rem;
    font-weight: 800;
    color: #0F172A;
    line-height: 1.2;
}

.profile-subtitle {
    font-size: 0.88rem;
    color: #64748B;
    font-weight: 500;
}

/* HUD Gamification (Streak + XP) */
.gamification-hud {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Streak Flame Card (Estilo Duolingo) */
.hud-streak-card {
    background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
    border: 1.5px solid #FDBA74;
    padding: 8px 16px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.12);
    cursor: default;
    transition: transform 0.2s ease;
}

.hud-streak-card:hover {
    transform: translateY(-2px);
}

.streak-icon {
    font-size: 1.6rem;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(234, 88, 12, 0.3));
    animation: flamePulse 2s ease-in-out infinite;
}

@keyframes flamePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15) rotate(4deg); }
}

.streak-details {
    display: flex;
    flex-direction: column;
}

.streak-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 900;
    color: #C2410C;
    line-height: 1.1;
}

.streak-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #EA580C;
    letter-spacing: 0.4px;
}

/* XP Card & Level Progress */
.hud-xp-card {
    background: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    padding: 10px 18px;
    border-radius: 16px;
    min-width: 210px;
    box-shadow: 0 4px 16px -2px rgba(99, 102, 241, 0.1);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hud-xp-card.pulse {
    transform: scale(1.06);
    border-color: #818CF8;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.xp-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.xp-icon-badge {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    color: #FFFFFF;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.xp-numbers {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.xp-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    color: #0F172A;
    line-height: 1;
}

.xp-unit {
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    color: #6366F1;
}

.xp-level-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.xp-level-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.xp-current-level {
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    color: #4F46E5;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.xp-needed {
    font-size: 0.68rem;
    font-weight: 600;
    color: #94A3B8;
}

.xp-progress-track {
    width: 100%;
    height: 6px;
    background-color: #F1F5F9;
    border-radius: 9999px;
    overflow: hidden;
}

.xp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366F1 0%, #06B6D4 100%);
    border-radius: 9999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========================================================
   2. NAVEGAÇÃO PRINCIPAL EM ABAS
   ======================================================== */

.emilly-nav {
    max-width: 1120px;
    width: 100%;
    margin: 18px auto 8px;
    padding: 0 24px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.emilly-nav::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    flex: 1 0 auto;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #FFFFFF;
    border-radius: 14px;
    border: 1.5px solid #E2E8F0;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #64748B;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: all 0.2s ease;
    white-space: nowrap;
    scroll-snap-align: start;
    user-select: none;
}

.nav-tab .nav-icon {
    font-size: 1.15rem;
}

.nav-tab:hover {
    color: #4F46E5;
    border-color: #C7D2FE;
    transform: translateY(-2px);
}

.nav-tab.active {
    background: #FFFFFF;
    color: #4F46E5;
    border-color: #6366F1;
    box-shadow: 0 4px 14px -2px rgba(99, 102, 241, 0.2);
}

/* ========================================================
   3. CONTEÚDO PRINCIPAL & FILTROS
   ======================================================== */

.emilly-main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 16px 24px 60px;
    flex: 1;
}

.filter-header {
    margin-bottom: 20px;
    position: relative;
    width: 100%;
    max-width: 100%;
}

.category-filters-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    display: block;
}

.category-filters-wrapper::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 8px;
    width: 42px;
    background: linear-gradient(to right, rgba(248, 250, 252, 0) 0%, rgba(248, 250, 252, 0.95) 100%);
    pointer-events: none;
    z-index: 5;
    border-top-right-radius: 9999px;
    border-bottom-right-radius: 9999px;
}

.category-filters {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap; /* Impede que quebre linhas */
    gap: 8px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 44px 10px 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    box-sizing: border-box;
}

.category-filters::-webkit-scrollbar {
    display: none;
}

.category-btn {
    flex: 0 0 auto; /* Impede encolhimento, garantindo scroll lateral livre */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    min-height: 44px; /* Acessibilidade Mobile Touch Target */
    background: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    border-radius: 9999px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    scroll-snap-align: start;
    transition: all 0.2s ease;
    user-select: none;
}

.category-btn:hover {
    border-color: #A5B4FC;
    color: #4F46E5;
    transform: translateY(-1px);
}

.category-btn.active {
    background: #4F46E5;
    color: #FFFFFF;
    border-color: #4F46E5;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

/* Seções e Banners */
.section-banner {
    background: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.section-banner h2 {
    font-size: 1.3rem;
    font-weight: 800;
    color: #0F172A;
    margin-bottom: 4px;
}

.section-banner p {
    font-size: 0.9rem;
    color: #64748B;
}

.rewards-xp-pill {
    background: #EEF2FF;
    border: 1px solid #C7D2FE;
    padding: 8px 16px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #4F46E5;
    font-size: 0.9rem;
    font-family: 'Outfit', sans-serif;
}

.rewards-xp-pill strong {
    font-weight: 800;
    font-size: 1.1rem;
}

/* ========================================================
   4. CARDS DE MISSÕES / TAREFAS
   ======================================================== */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
}

.task-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.05);
    border: 1.5px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: visible;
}

.task-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px -4px rgba(99, 102, 241, 0.12);
    border-color: #C7D2FE;
}

/* Efeito Glow Dourado/Roxo ao Concluir Tarefa */
.task-card.task-card-success-glow {
    border-color: #F59E0B;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.35), 0 12px 28px rgba(99, 102, 241, 0.22);
    transform: scale(1.02);
    animation: successCardPulse 1.6s ease forwards;
}

@keyframes successCardPulse {
    0% { transform: scale(1); }
    30% { transform: scale(1.03); }
    70% { transform: scale(1.01); }
    100% { transform: scale(1); }
}

/* Chip Flutuante "+XP" subindo e sumindo */
.floating-xp-badge {
    position: absolute;
    right: 20px;
    bottom: 24px;
    background: linear-gradient(135deg, #F59E0B 0%, #EF4444 100%);
    color: #FFFFFF;
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 1.05rem;
    padding: 6px 14px;
    border-radius: 9999px;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.45);
    pointer-events: none;
    z-index: 50;
    animation: floatUpAndFade 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes floatUpAndFade {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.7);
    }
    20% {
        opacity: 1;
        transform: translateY(-15px) scale(1.15);
    }
    70% {
        opacity: 0.95;
        transform: translateY(-40px) scale(1.05);
    }
    100% {
        opacity: 0;
        transform: translateY(-65px) scale(0.9);
    }
}

.task-top {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
}

.task-icon-box {
    width: 48px;
    height: 48px;
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.task-details {
    flex: 1;
    min-width: 0;
}

.task-category-tag {
    display: inline-flex;
    margin-bottom: 6px;
    max-width: 100%;
}

.task-details h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0F172A;
    margin-bottom: 4px;
    line-height: 1.35;
    word-break: break-word;
    overflow-wrap: break-word;
}

.task-details p {
    font-size: 0.86rem;
    color: #64748B;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
}

.task-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #F1F5F9;
    gap: 10px;
    flex-wrap: wrap;
}

.xp-pill-badge {
    background: #EEF2FF;
    color: #4F46E5;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 6px 12px;
    border-radius: 9999px;
    border: 1px solid #E0E7FF;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.3px;
    min-height: 36px;
}

/* Botão Concluir Moderno */
.btn-action-task {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 0.92rem;
    padding: 10px 18px;
    min-height: 44px; /* Acessibilidade Mobile: Mínimo 44px */
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-complete-ready {
    background: #10B981;
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-complete-ready:hover {
    background: #059669;
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.btn-complete-ready:active {
    transform: scale(0.97);
}

.btn-reading-action {
    background: linear-gradient(135deg, #0891B2 0%, #06B6D4 100%);
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.25);
}

.btn-reading-action:hover {
    filter: brightness(1.08);
    transform: scale(1.03);
}

.btn-pending-review {
    background: #FFFBEB;
    color: #B45309;
    border: 1px solid #FDE68A;
    cursor: not-allowed;
    opacity: 0.9;
}

.btn-task-done-today {
    background: #F1F5F9;
    color: #64748B;
    border: 1px solid #E2E8F0;
    cursor: not-allowed;
    font-weight: 700;
}

.btn-task-limit-reached {
    background: #ECFDF5;
    color: #047857;
    border: 1px solid #A7F3D0;
    cursor: not-allowed;
    font-weight: 800;
}

/* Badge de Tarefa Repetível / Contador Diário */
.task-repeat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #F0FDF4;
    color: #15803D;
    border: 1px solid #BBF7D0;
    font-family: 'Outfit', sans-serif;
    font-size: 0.76rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.2px;
}

.task-repeat-badge.limit-reached {
    background: #FEF3C7;
    color: #B45309;
    border-color: #FDE68A;
}

.task-repeat-badge.no-limit {
    background: #EFF6FF;
    color: #1D4ED8;
    border-color: #BFDBFE;
}

/* ========================================================
   5. CARDS DE RECOMPENSAS
   ======================================================== */

.reward-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 2px 8px -2px rgba(15, 23, 42, 0.05);
    border: 1.5px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.reward-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px -4px rgba(6, 182, 212, 0.15);
}

.reward-card.can-afford {
    border-color: #06B6D4;
    background: linear-gradient(180deg, #FFFFFF 0%, #F0FDFA 100%);
}

.reward-unlocked-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    background: #CCFBF1;
    color: #0F766E;
    border: 1px solid #99F6E4;
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 9999px;
    letter-spacing: 0.4px;
}

.reward-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 14px;
}

.reward-icon {
    font-size: 2.8rem;
    margin-bottom: 8px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.08));
}

.reward-header h3 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0F172A;
    margin-bottom: 4px;
}

.reward-header p {
    font-size: 0.86rem;
    color: #64748B;
}

.reward-progress-box {
    margin: 10px 0 16px;
}

.reward-progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748B;
    margin-bottom: 6px;
}

.reward-progress-text .ready {
    color: #0D9488;
    font-weight: 800;
}

.reward-progress-track {
    height: 8px;
    background: #E2E8F0;
    border-radius: 9999px;
    overflow: hidden;
}

.reward-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366F1 0%, #06B6D4 100%);
    border-radius: 9999px;
    transition: width 0.5s ease;
}

.btn-redeem-action {
    width: 100%;
    padding: 10px 16px;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-redeem-active {
    background: linear-gradient(135deg, #06B6D4 0%, #0EA5E9 100%);
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.btn-redeem-active:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.btn-redeem-locked {
    background: #F1F5F9;
    color: #94A3B8;
    cursor: not-allowed;
    border: 1px solid #E2E8F0;
}

/* ========================================================
   6. EXTRATO & FECHAMENTOS (FINTECH STYLE)
   ======================================================== */

.statement-hero-card {
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    color: #FFFFFF;
    border-radius: 18px;
    padding: 24px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 28px -4px rgba(15, 23, 42, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.statement-hero-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #94A3B8;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 6px;
}

.statement-hero-val {
    font-family: 'Outfit', sans-serif;
    font-size: 2.4rem;
    font-weight: 900;
    color: #38BDF8;
    line-height: 1.1;
    margin-bottom: 4px;
}

.statement-hero-val strong {
    font-size: 1.3rem;
    color: #818CF8;
}

.statement-hero-sub {
    font-size: 0.85rem;
    color: #94A3B8;
}

.statement-hero-badge {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38BDF8;
    padding: 8px 16px;
    border-radius: 9999px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
}

.closures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.closure-card {
    background: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
}

.closure-card:hover {
    transform: translateY(-2px);
    border-color: #A7F3D0;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.1);
}

.closure-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.closure-date-tag {
    font-size: 0.82rem;
    font-weight: 700;
    color: #64748B;
}

.closure-paid-badge {
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
    padding: 3px 10px;
    border-radius: 9999px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.75rem;
    font-weight: 800;
}

.closure-amounts-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 12px;
    padding: 12px;
    background: #F8FAFC;
    border-radius: 12px;
}

.closure-xp-info strong {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 900;
    color: #4F46E5;
    display: block;
}

.closure-xp-info span {
    font-size: 0.75rem;
    color: #64748B;
}

.closure-money-info {
    text-align: right;
}

.closure-money-info strong {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 900;
    color: #059669;
    display: block;
}

.closure-money-info span {
    font-size: 0.75rem;
    color: #64748B;
}

.closure-obs-text {
    font-size: 0.85rem;
    color: #475569;
    margin-bottom: 14px;
    font-style: italic;
}

/* ========================================================
   7. HISTÓRICO & ATIVIDADES
   ======================================================== */

.history-container {
    background: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 12px;
    transition: background-color 0.15s ease;
}

.history-item:not(:last-child) {
    border-bottom: 1px solid #F1F5F9;
}

.history-item:hover {
    background-color: #F8FAFC;
}

.history-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.history-icon-badge {
    width: 40px;
    height: 40px;
    background: #F1F5F9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.history-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    color: #0F172A;
}

.history-date {
    font-size: 0.78rem;
    color: #94A3B8;
    margin-top: 2px;
}

.history-xp-amount {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 900;
}

.history-xp-amount.positive {
    color: #10B981;
}

.history-xp-amount.negative {
    color: #EF4444;
}

/* ========================================================
   8. MODAIS ESPECÍFICOS
   ======================================================== */

.reward-modal-box {
    text-align: center;
    max-width: 420px;
}

.modal-reward-icon {
    font-size: 3.5rem;
    margin-bottom: 8px;
}

.modal-reward-desc {
    color: #64748B;
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.modal-cost-card {
    background: #EEF2FF;
    border: 1px solid #C7D2FE;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #4F46E5;
    font-family: 'Outfit', sans-serif;
}

.modal-cost-val {
    font-size: 1.3rem;
    font-weight: 900;
}

/* Modal de Leitura & Extrato */
.reading-modal-box {
    max-width: 540px;
    padding: 0;
}

.reading-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px 14px;
    border-bottom: 1px solid #F1F5F9;
    background: #FFFFFF;
    flex-shrink: 0;
}

.reading-badge-icon {
    width: 44px;
    height: 44px;
    background: #ECFEFF;
    border: 1px solid #A5F3FC;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.book-progress-card {
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.book-progress-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.book-icon {
    font-size: 1.4rem;
}

.book-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-info strong {
    font-size: 0.95rem;
    color: #0F172A;
}

.book-info span {
    font-size: 0.75rem;
    color: #64748B;
}

.book-percent-badge {
    background: #EEF2FF;
    color: #4F46E5;
    font-family: 'Outfit', sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    padding: 2px 8px;
    border-radius: 6px;
}

.book-bar-track {
    width: 100%;
    height: 7px;
    background: #E2E8F0;
    border-radius: 9999px;
    overflow: hidden;
}

.book-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #0891B2 0%, #06B6D4 100%);
    border-radius: 9999px;
    transition: width 0.4s ease;
}

.reading-inputs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.reading-calc-card {
    background: linear-gradient(135deg, #ECFEFF 0%, #F0FDFA 100%);
    border: 1.5px solid #A5F3FC;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.calc-label {
    font-size: 0.8rem;
    color: #0E7490;
    display: block;
}

.calc-left strong {
    font-size: 1.05rem;
    color: #0891B2;
}

.calc-xp-badge {
    background: #0891B2;
    color: #FFFFFF;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 900;
    padding: 6px 14px;
    border-radius: 9999px;
    box-shadow: 0 4px 12px rgba(8, 145, 178, 0.3);
}

.reading-history-section {
    background: #F8FAFC;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 12px;
    max-height: 140px;
    overflow-y: auto;
}

.history-section-title {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #64748B;
    margin-bottom: 6px;
}

.book-sessions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.book-session-item {
    font-size: 0.82rem;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: 6px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-empty-text {
    font-size: 0.8rem;
    color: #94A3B8;
    text-align: center;
    padding: 10px;
}

/* ========================================================
   8.5 BANNER & EDITOR DE RESUMO DE LEITURA
   ======================================================== */

.reading-summary-banner {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    border: 1.5px solid #C7D2FE;
    border-radius: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 10px rgba(99, 102, 241, 0.08);
}

.summary-banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.summary-banner-icon {
    font-size: 2rem;
    background: #FFFFFF;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
    flex-shrink: 0;
}

.summary-banner-text h3 {
    font-size: 1.05rem;
    color: #1E1B4B;
    margin-bottom: 2px;
    font-weight: 800;
}

.summary-banner-text p {
    font-size: 0.84rem;
    color: #4338CA;
    line-height: 1.3;
}

.summary-banner-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Barra de Ferramentas do Editor */
.summary-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #F1F5F9;
    border: 1.5px solid #E2E8F0;
    border-bottom: none;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    padding: 6px 8px;
    flex-wrap: wrap;
}

.editor-tool-btn {
    background: #FFFFFF;
    border: 1px solid #CBD5E1;
    border-radius: 6px;
    padding: 4px 10px;
    min-height: 34px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.editor-tool-btn:hover {
    background: #EEF2FF;
    border-color: #818CF8;
    color: #4F46E5;
}

.editor-tool-btn:active, .editor-tool-btn.active {
    background: #4F46E5;
    color: #FFFFFF;
    border-color: #4F46E5;
}

.editor-toolbar-separator {
    width: 1px;
    height: 20px;
    background: #CBD5E1;
    margin: 0 4px;
}

/* Área Editável (Contenteditable) */
.summary-editor-area {
    min-height: 180px;
    max-height: 280px;
    overflow-y: auto;
    background: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    padding: 14px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #0F172A;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.summary-editor-area:focus {
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.summary-editor-area:empty:before {
    content: attr(data-placeholder);
    color: #94A3B8;
    pointer-events: none;
}

.summary-editor-area ul {
    margin-left: 20px;
    padding-left: 0;
}

.summary-editor-area li {
    margin-bottom: 4px;
}

/* Itens de Histórico de Resumos */
.my-summary-card {
    background: #F8FAFC;
    border: 1.5px solid #E2E8F0;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.2s ease;
}

.my-summary-card:hover {
    border-color: #CBD5E1;
    background: #FFFFFF;
}

.my-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.my-summary-book {
    font-size: 0.92rem;
    font-weight: 800;
    color: #0F172A;
    display: flex;
    align-items: center;
    gap: 6px;
}

.my-summary-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.my-summary-text-preview {
    font-size: 0.86rem;
    color: #475569;
    background: #FFFFFF;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    line-height: 1.45;
    max-height: 170px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overflow-wrap: anywhere;
}

/* Balão de Feedback dos Pais */
.summary-feedback-box {
    background: #EFF6FF;
    border: 1.5px solid #BFDBFE;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
}

.summary-feedback-box.rejected {
    background: #FFF1F2;
    border-color: #FECDD3;
}

.summary-feedback-header {
    font-size: 0.82rem;
    font-weight: 800;
    color: #1D4ED8;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-feedback-box.rejected .summary-feedback-header {
    color: #BE123C;
}

.summary-feedback-text {
    font-size: 0.92rem;
    font-weight: 600;
    color: #1E293B;
    line-height: 1.5;
    margin: 0;
}

/* Card de Desafio Bônus para Emilly */
.bonus-challenge-card {
    background: linear-gradient(135deg, #FEF9C3 0%, #FEF08A 100%);
    border: 2px solid #FACC15;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 4px 14px rgba(234, 179, 8, 0.2);
    position: relative;
    overflow: hidden;
}

.bonus-challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.bonus-challenge-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #854D0E;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bonus-challenge-badge {
    background: #EAB308;
    color: #FFFFFF;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.bonus-challenge-text {
    font-size: 0.92rem;
    font-weight: 700;
    color: #713F12;
    line-height: 1.45;
    margin: 0;
}

.bonus-challenge-btn {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: #FFFFFF;
    border: none;
    border-radius: 12px;
    padding: 10px 16px;
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.35);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.bonus-challenge-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(217, 119, 6, 0.45);
}

.bonus-challenge-status-sent {
    background: #ECFDF5;
    border: 1.5px solid #A7F3D0;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.86rem;
    font-weight: 700;
    color: #065F46;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bonus-challenge-status-done {
    background: #F0FDF4;
    border: 1.5px solid #86EFAC;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.88rem;
    font-weight: 800;
    color: #166534;
    display: flex;
    align-items: center;
    gap: 6px;
}


/* Modal de Avatar */
.avatar-modal-box {
    max-width: 440px;
    text-align: center;
}

.avatar-preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 18px;
}

.avatar-preview-large {
    width: 80px;
    height: 80px;
    border-radius: 22px;
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #06B6D4 100%);
    color: #FFFFFF;
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px -4px rgba(99, 102, 241, 0.4);
    border: 3px solid #FFFFFF;
    overflow: hidden;
}

.avatar-preview-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-preview-label {
    font-size: 0.78rem;
    color: #64748B;
    font-weight: 600;
}

.avatar-group-title {
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #94A3B8;
    letter-spacing: 0.5px;
    text-align: left;
    margin: 12px 0 8px;
}

.avatar-grid-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.avatar-opt-btn {
    height: 48px;
    border-radius: 12px;
    border: 2px solid transparent;
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.avatar-opt-btn.emoji {
    background: #F1F5F9;
    border-color: #E2E8F0;
    font-size: 1.4rem;
}

.avatar-opt-btn:hover {
    transform: scale(1.08);
}

.avatar-opt-btn.active {
    border-color: #0F172A;
    box-shadow: 0 0 0 2px #6366F1;
}

.avatar-upload-box {
    margin-top: 4px;
}

/* Modal Actions Gerais */
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-actions .btn {
    flex: 1;
}

/* Celebration Toast */
.celebration-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: #0F172A;
    color: #FFFFFF;
    padding: 14px 24px;
    border-radius: 9999px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 800;
    z-index: 9999;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.celebration-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast-xp-icon {
    font-size: 1.3rem;
    color: #06B6D4;
}

/* ========================================================
   9. RESPONSIVIDADE COMPLETA (MOBILE-FIRST)
   ======================================================== */

/* Tablet & Telas Médias (768px a 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .header-container {
        gap: 16px;
    }

    .cards-grid, .closures-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .gamification-hud {
        gap: 10px;
    }

    .hud-streak-card {
        padding: 8px 12px;
    }

    .hud-xp-card {
        padding: 8px 14px;
    }
}

/* Celular & Telas Pequenas (< 768px, incluindo 375px) */
@media (max-width: 767px) {
    .emilly-header {
        padding: 10px 14px;
        position: sticky;
        top: 0;
    }

    .header-container {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .profile-info {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .profile-avatar {
        width: 46px;
        height: 46px;
        font-size: 1.4rem;
        border-radius: 12px;
    }

    .profile-texts h1 {
        font-size: 1.15rem;
        line-height: 1.2;
        margin-bottom: 2px;
    }

    .profile-tag-row {
        gap: 6px;
        flex-wrap: wrap;
    }

    .gamer-tag, .level-pill-mini {
        font-size: 0.68rem;
        padding: 2px 6px;
    }

    .gamification-hud {
        display: flex;
        width: 100%;
        gap: 8px;
    }

    .hud-streak-card {
        flex: 1;
        padding: 8px 10px;
        min-width: 75px;
        gap: 6px;
    }

    .streak-fire-icon {
        font-size: 1.3rem;
    }

    .streak-info-text strong {
        font-size: 0.95rem;
    }

    .streak-info-text span {
        font-size: 0.62rem;
    }

    .hud-xp-card {
        flex: 2;
        padding: 8px 12px;
        gap: 8px;
    }

    .score-value {
        font-size: 1.45rem;
        line-height: 1;
    }

    .level-badge-pill {
        font-size: 0.68rem;
        padding: 2px 6px;
    }

    /* Navegação */
    .emilly-nav {
        padding: 0 14px;
        margin: 10px auto 4px;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-wrap: nowrap;
    }

    .emilly-nav::-webkit-scrollbar {
        display: none;
    }

    .nav-tab {
        flex: 0 0 auto; /* Não espreme as abas no mobile */
        min-height: 46px; /* Touch target */
        padding: 10px 14px;
        font-size: 0.88rem;
        gap: 6px;
        border-radius: 12px;
        white-space: nowrap;
    }

    .emilly-main {
        padding: 10px 14px 48px;
        width: 100%;
        max-width: 100%;
    }

    /* Banners e Filtros */
    .filter-header {
        margin-bottom: 16px;
        width: 100%;
        max-width: 100%;
    }

    .category-filters-wrapper {
        width: 100%;
        max-width: 100%;
    }

    .category-filters {
        padding: 4px 40px 10px 2px;
        gap: 6px;
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-wrap: nowrap;
    }

    .category-btn {
        flex: 0 0 auto;
        padding: 8px 14px;
        font-size: 0.84rem;
        min-height: 44px;
    }
    .section-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px;
        margin-bottom: 16px;
    }

    .section-banner h2 {
        font-size: 1.15rem;
    }

    .rewards-xp-pill {
        width: 100%;
        justify-content: center;
        padding: 8px 14px;
    }

    /* Grid de Cards: 1 COLUNA NO CELULAR */
    .cards-grid, .closures-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .task-card {
        padding: 16px;
        border-radius: 14px;
    }

    .task-top {
        gap: 10px;
        margin-bottom: 10px;
    }

    .task-icon-box {
        width: 42px;
        height: 42px;
        font-size: 1.4rem;
        border-radius: 10px;
    }

    .task-details h3 {
        font-size: 1rem;
        line-height: 1.35;
    }

    .task-details p {
        font-size: 0.82rem;
        line-height: 1.35;
    }

    .task-footer {
        margin-top: 10px;
        padding-top: 10px;
        gap: 8px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .btn-action-task {
        min-height: 44px;
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    /* Extrato / Fechamentos no Mobile */
    .statement-hero-card {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding: 16px;
    }

    .statement-actions-row {
        flex-direction: column;
        gap: 8px;
    }

    .closure-card {
        padding: 16px;
    }

    .closure-amounts-row {
        flex-direction: column;
        gap: 8px;
    }

    /* Modais no Mobile */
    .modal-content {
        width: 100%;
        max-width: 480px;
        border-radius: 18px;
        max-height: 88dvh;
        overflow: hidden;
        padding: 0;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-header,
    .reading-modal-header {
        padding: 14px 16px;
    }

    .modal-actions {
        padding: 12px 16px;
        flex-direction: column-reverse;
        gap: 8px;
    }

    .modal-actions .btn {
        width: 100%;
        min-height: 44px;
    }
}

/* ========================================================
   14. TELA DE ENTRADA POR PIN (LOGIN DA EMILLY)
   ======================================================== */

.pin-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    overflow-y: auto;
    background: #F8FAFC;
    background-image:
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.16) 0px, transparent 55%),
        radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.16) 0px, transparent 55%);
}

/* Some assim que a sessão é validada */
.pin-screen.hidden {
    display: none;
}

/* Enquanto a tela de PIN está ativa, o app fica escondido */
body.pin-locked > *:not(#pinScreen) {
    display: none !important;
}

.pin-card {
    width: 100%;
    max-width: 360px;
    margin: auto;
    background: #FFFFFF;
    border: 1.5px solid #E2E8F0;
    border-radius: 24px;
    padding: 28px 24px 24px;
    text-align: center;
    box-shadow: 0 20px 45px -12px rgba(15, 23, 42, 0.18);
}

.pin-logo {
    max-height: 46px;
    width: auto;
    margin-bottom: 14px;
}

.pin-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.6rem;
    font-weight: 900;
    color: #0F172A;
    margin: 0 0 4px;
}

.pin-subtitle {
    font-size: 0.95rem;
    color: #64748B;
    margin: 0 0 22px;
}

/* Bolinhas de progresso */
.pin-dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 14px;
}

.pin-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #FFFFFF;
    border: 2.5px solid #CBD5E1;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.pin-dot.filled {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    border-color: #6366F1;
    transform: scale(1.18);
}

.pin-error {
    min-height: 20px;
    margin: 0 0 12px;
    font-size: 0.86rem;
    font-weight: 700;
    color: #E11D48;
}

/* Tremida no PIN errado */
.pin-card.shake {
    animation: pinShake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes pinShake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-7px); }
    40%, 60% { transform: translateX(7px); }
}

.pin-dots.error .pin-dot.filled {
    background: #E11D48;
    border-color: #E11D48;
}

/* Teclado */
/* A altura da tecla é explícita (e não aspect-ratio) porque o card tem largura
   fixa: com 1/1 a tecla ficava ~98px de altura e o teclado estourava a tela
   em celular deitado ou com teclado virtual aberto. */
.pin-keypad {
    --pin-key-size: 64px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}

.pin-key {
    height: var(--pin-key-size);
    border: 1.5px solid #E2E8F0;
    border-radius: 18px;
    background: #FFFFFF;
    font-family: 'Outfit', sans-serif;
    font-size: 1.7rem;
    font-weight: 800;
    color: #0F172A;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease, background 0.15s ease, border-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.pin-key:hover {
    background: #F1F5F9;
    border-color: #C7D2FE;
}

.pin-key:active {
    transform: scale(0.93);
    background: #EEF2FF;
    border-color: #6366F1;
}

.pin-key:focus-visible {
    outline: 3px solid rgba(99, 102, 241, 0.45);
    outline-offset: 2px;
}

.pin-key-action {
    font-size: 1.35rem;
    color: #64748B;
    background: #F8FAFC;
}

.pin-key-empty {
    visibility: hidden;
}

.pin-keypad.disabled .pin-key {
    opacity: 0.5;
    pointer-events: none;
}

.pin-help {
    font-size: 0.8rem;
    color: #94A3B8;
    margin: 0;
}

/* Telas baixas: encolhe em degraus para o teclado caber sem rolagem
   (celular deitado, tablet com capa, janela pequena) */
@media (max-height: 780px) {
    .pin-card { padding: 22px 20px 18px; }
    .pin-logo { max-height: 38px; margin-bottom: 10px; }
    .pin-title { font-size: 1.4rem; }
    .pin-subtitle { margin-bottom: 16px; font-size: 0.9rem; }
    .pin-keypad { --pin-key-size: 54px; gap: 10px; margin-bottom: 14px; }
    .pin-key { font-size: 1.5rem; border-radius: 15px; }
}

@media (max-height: 650px) {
    .pin-card { padding: 16px 18px 14px; }
    .pin-logo { max-height: 30px; margin-bottom: 6px; }
    .pin-title { font-size: 1.2rem; }
    .pin-subtitle { margin-bottom: 12px; font-size: 0.84rem; }
    .pin-dots { gap: 10px; margin-bottom: 10px; }
    .pin-dot { width: 13px; height: 13px; }
    .pin-error { min-height: 16px; margin-bottom: 8px; font-size: 0.8rem; }
    .pin-keypad { --pin-key-size: 46px; gap: 8px; margin-bottom: 10px; }
    .pin-key { font-size: 1.3rem; border-radius: 13px; }
    .pin-help { font-size: 0.74rem; }
}
