/* ============================================
   Hope Bible - Bíblia Esperança
   Design: Formal, elegante, profissional
   ============================================ */

:root, [data-theme="dark"] {
    --color-bg: #0a0e14;
    --color-bg-card: #111820;
    --color-bg-elevated: #151d28;
    --color-bg-input: #1a2234;
    --color-primary: #c9a227;
    --color-primary-hover: #d4af37;
    --color-accent: #5b7a9e;
    --color-text: #e8ecf0;
    --color-text-muted: #8b95a5;
    --color-border: #2a3544;
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-subtle: 0 2px 12px rgba(0,0,0,0.2);
    --shadow-card: 0 2px 8px rgba(0,0,0,0.2);
    --space-section: 3rem;
    --space-card: 1.5rem;
}

/* Tema claro */
[data-theme="light"] {
    --color-bg: #f5f6f8;
    --color-bg-card: #ffffff;
    --color-bg-elevated: #ffffff;
    --color-bg-input: #e8ecf0;
    --color-primary: #b8860b;
    --color-primary-hover: #c9a227;
    --color-accent: #4a6a8e;
    --color-text: #1a1d24;
    --color-text-muted: #5a6578;
    --color-border: #d1d8e0;
    --shadow: 0 4px 24px rgba(0,0,0,0.08);
    --shadow-subtle: 0 2px 12px rgba(0,0,0,0.06);
    --shadow-card: 0 2px 8px rgba(0,0,0,0.06);
}

[data-theme="light"] body {
    background-image:
        linear-gradient(180deg, rgba(255,255,255,0.5) 0%, transparent 30%),
        radial-gradient(ellipse 50% 30% at 50% 0%, rgba(184, 134, 11, 0.04), transparent);
}

[data-theme="light"] .header {
    background: rgba(245, 246, 248, 0.97);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    background-image: 
        linear-gradient(180deg, rgba(17, 24, 32, 0.5) 0%, transparent 30%),
        radial-gradient(ellipse 50% 30% at 50% 0%, rgba(201, 162, 39, 0.06), transparent);
    color: var(--color-text);
    line-height: 1.65;
    min-height: 100vh;
    letter-spacing: 0.01em;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 14, 20, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-subtle);
    padding-top: env(safe-area-inset-top, 0);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--color-text);
    transition: transform 0.2s;
}
.logo:hover { transform: scale(1.02); }

.logo-img { height: 40px; width: auto; }
.logo-fallback { display: flex; align-items: center; gap: 0.6rem; }

.logo-icon {
    font-size: 1.75rem;
    color: var(--color-primary);
    font-weight: 400;
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.logo-text strong { 
    color: var(--color-primary);
}

.logo-sub {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-left: 0.35rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.nav { display: flex; align-items: center; gap: 1.5rem; }

.nav-link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
}

.nav-user { display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0; }
.nav-avatar, .nav-avatar-inicial { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.nav-avatar-inicial { display: inline-flex; background: var(--color-primary); color: var(--color-bg); font-weight: 600; font-size: 0.9rem; align-items: center; justify-content: center; }
.nav-user-nome { font-weight: 600; font-size: 0.9rem; color: var(--color-text); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-link:hover, .nav-link.active { 
    color: var(--color-primary);
    background: rgba(201, 162, 39, 0.1);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Preferências - seletor de tema compacto */
.prefs-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    margin-right: 0.5rem;
}
.prefs-bar-sm .prefs-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.prefs-btns {
    display: flex;
    gap: 0.2rem;
}
.prefs-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s;
}
.prefs-btn:hover { background: rgba(201, 162, 39, 0.15); border-color: var(--color-primary); color: var(--color-primary); }
.prefs-btn.active { background: var(--color-primary); border-color: var(--color-primary); color: #0a0e14; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.5rem;
    border-radius: var(--radius);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s;
    text-decoration: none;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--color-primary);
    color: #0a0e14;
    box-shadow: var(--shadow-subtle);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    box-shadow: 0 4px 16px rgba(201, 162, 39, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.btn-outline:hover {
    background: rgba(201, 162, 39, 0.1);
    color: var(--color-primary-hover);
}

.btn-sm { padding: 0.45rem 1.1rem; font-size: 0.9rem; }
.btn-lg { padding: 1rem 2.25rem; font-size: 1.1rem; }
.btn-block { width: 100%; }

/* Carrossel */
.hero-carousel {
    position: relative;
    height: 70vh;
    min-height: 500px;
    overflow: hidden;
}

.carousel { position: relative; height: 100%; }

.carousel-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease;
}

.carousel-slide.active { opacity: 1; z-index: 1; }

.carousel-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(5,8,16,0.9) 0%, rgba(5,8,16,0.5) 50%, transparent 100%);
}

.carousel-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 5rem 2rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.carousel-content h1 {
    font-family: var(--font-display);
    font-size: clamp(2.75rem, 6vw, 4.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: white;
    text-shadow: 0 4px 30px rgba(0,0,0,0.6);
    animation: fadeInUp 0.8s ease;
}

.carousel-content p {
    font-size: 1.35rem;
    color: rgba(255,255,255,0.95);
    margin-bottom: 1.5rem;
    max-width: 550px;
    animation: fadeInUp 0.8s ease 0.2s both;
}

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

.carousel-dots {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 0.6rem;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: all 0.3s;
}

.carousel-dot:hover, .carousel-dot.active {
    background: var(--color-primary);
    transform: scale(1.2);
}

.carousel-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    z-index: 10;
    display: flex;
    justify-content: space-between;
    padding: 0 1rem;
    pointer-events: none;
}

.carousel-prev, .carousel-next {
    pointer-events: auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.carousel-prev:hover, .carousel-next:hover {
    background: rgba(201, 162, 39, 0.25);
    border-color: var(--color-primary);
}

/* Hero padrão */
.hero-default {
    position: relative;
    height: 55vh;
    min-height: 420px;
    background: linear-gradient(165deg, #0f1620 0%, #151d2a 50%, #0a0e14 100%);
    background-image: 
        linear-gradient(180deg, rgba(201, 162, 39, 0.06) 0%, transparent 40%);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5,8,16,0.2);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 850px;
    margin: 0 auto;
    padding: 5rem 2rem;
    text-align: center;
}

.hero-content h1 {
    font-family: var(--font-display);
    font-size: clamp(2.25rem, 4.5vw, 3.5rem);
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--color-text);
    letter-spacing: 0.02em;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.hero-desc {
    font-size: 1.05rem !important;
    margin-bottom: 2rem !important;
    color: var(--color-text-muted) !important;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Sections - apresentação webapp */
.section {
    padding: var(--space-section) 1.5rem;
    position: relative;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 0.5rem;
}

.section-header {
    margin-bottom: 2rem;
}

.section-title {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-text);
    position: relative;
    display: inline-block;
    letter-spacing: 0.02em;
    line-height: 1.3;
}
.section-title::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), transparent);
    border-radius: 2px;
}

.section-desc {
    color: var(--color-text-muted);
    margin-bottom: 0;
    font-size: 1rem;
    line-height: 1.6;
    max-width: 560px;
}

/* Versículo do Dia */
.versiculo-dia { background: rgba(0,0,0,0.2); }

.versiculo-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem 2rem;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
}
.versiculo-card::before {
    content: '"';
    position: absolute;
    top: 1rem;
    left: 1.5rem;
    font-size: 4rem;
    font-family: var(--font-display);
    color: rgba(201, 162, 39, 0.2);
    line-height: 1;
}

.versiculo-card .ref,
.versiculo-card a.ref-link {
    font-size: 1rem;
    color: var(--color-primary);
    margin-bottom: 1rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}
.versiculo-card a.ref-link {
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
}
.versiculo-card a.ref-link:hover {
    text-decoration: underline;
}

.versiculo-card .texto {
    font-family: var(--font-display);
    font-size: 1.4rem;
    line-height: 1.9;
    font-style: italic;
    position: relative;
    z-index: 1;
}

.videos-dia {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
    margin-top: 2rem;
}

/* Leitor */
.leitor-section { background: rgba(0,0,0,0.15); }

.leitor-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}
.leitor-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
.leitor-actions .tts-rate {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}
.select.select-sm {
    padding: 0.45rem 0.8rem;
    font-size: 0.9rem;
}

.select {
    padding: 0.75rem 1.25rem;
    background: var(--color-bg-input);
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.95rem;
    min-width: 160px;
    transition: all 0.2s;
}
.select:hover, .select:focus {
    border-color: var(--color-primary);
    outline: none;
}

.leitor-content {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
}

@media (max-width: 950px) {
    .leitor-content { grid-template-columns: 1fr; }
}

.versiculo-refs { font-size: 0.8rem; margin-top: 0.25rem; }
.versiculo-refs .ref-link { color: var(--color-primary, #1d4ed8); margin-right: 0.5rem; text-decoration: none; }
.versiculo-refs .ref-link:hover { text-decoration: underline; }
.versiculo-palavras { font-size: 0.8rem; margin-top: 0.2rem; color: #64748b; }
.palavra-tooltip { cursor: help; border-bottom: 1px dotted #94a3b8; }
.observacao-box {
    margin-bottom: 1.25rem;
    padding: 1.25rem;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    border-left: 4px solid var(--color-primary);
}
.observacao-box h4 { margin-bottom: 0.75rem; font-size: 0.95rem; }
.observacao-box textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    background: var(--color-bg-input);
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    min-height: 100px;
}
.observacao-box textarea:focus {
    border-color: var(--color-primary);
    outline: none;
}
.observacao-box textarea::placeholder { color: var(--color-text-muted); }

.versiculos-container {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: 2rem;
    min-height: 350px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
}

.versiculo-item {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: background 0.2s;
    border-radius: 8px;
}
.versiculo-item:hover { background: rgba(201, 162, 39, 0.06); }

.versiculo-item:last-child { border-bottom: none; }

.versiculo-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.35rem;
    background: rgba(201, 162, 39, 0.15);
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: 4px;
    margin-right: 0.7rem;
}

.versiculo-texto {
    font-family: var(--font-display);
    font-size: 1.2rem;
    line-height: 1.85;
}

.video-card {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.25rem;
    border: 1px solid var(--color-border);
    transition: box-shadow 0.2s;
}
.video-card:hover {
    box-shadow: var(--shadow);
}

.video-card h4 {
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.video-card .embed {
    aspect-ratio: 16/9;
    width: 100%;
}

.video-card .embed iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Histórias Bíblicas - apresentação dinâmica */
.historias-section { background: rgba(0,0,0,0.12); }

.historias-picker {
    max-width: 680px;
    margin: 0 auto;
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.historias-toolbar {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.historias-search-wrap {
    position: relative;
}

.historias-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    opacity: 0.6;
    pointer-events: none;
}

.historias-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 2.5rem;
    background: var(--color-bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--color-text);
    font-size: 0.95rem;
    transition: border-color 0.2s, background 0.2s;
}

.historias-input:focus {
    border-color: var(--color-primary);
    background: var(--color-bg-elevated);
    outline: none;
}

.historias-input::placeholder { color: var(--color-text-muted); }

.historias-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255,255,255,0.1);
    color: var(--color-text-muted);
    font-size: 1.2rem;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, background 0.2s;
}

.historias-clear.visible {
    opacity: 1;
    pointer-events: auto;
}

.historias-clear:hover {
    background: var(--color-primary);
    color: #fff;
}

.historias-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.historias-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.historias-expand-btns {
    display: flex;
    gap: 0.35rem;
}

.historia-expand-btn {
    padding: 0.35rem 0.65rem;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.historia-expand-btn:hover {
    color: var(--color-primary);
    border-color: rgba(201, 162, 39, 0.5);
}

.historias-count {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.historia-filtro {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 20px;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.historia-filtro:hover {
    color: var(--color-text);
    border-color: rgba(201, 162, 39, 0.4);
}

.historia-filtro.active {
    background: rgba(201, 162, 39, 0.15);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.historias-lista {
    max-height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.historias-lista::-webkit-scrollbar { width: 6px; }
.historias-lista::-webkit-scrollbar-track { background: transparent; }
.historias-lista::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 3px; }
.historias-lista::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

.historia-grupo {
    border-bottom: 1px solid var(--color-border);
}
.historia-grupo:last-child { border-bottom: none; }

.historia-grupo-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s;
}

.historia-grupo-header:hover {
    background: rgba(201, 162, 39, 0.06);
}

.historia-grupo-livro { flex: 1; }

.historia-grupo-count {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 500;
    padding: 0.15rem 0.5rem;
    background: rgba(91, 122, 158, 0.15);
    border-radius: 10px;
}

.historia-grupo-chevron {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    transition: transform 0.2s;
}

.historia-grupo.expanded .historia-grupo-chevron {
    transform: rotate(90deg);
}

.historia-grupo-itens {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    padding: 0 0.75rem 0.75rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease-out;
}

.historia-grupo.expanded .historia-grupo-itens {
    max-height: 2000px;
}

.historias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
}

.historia-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    border: 1px solid transparent;
    background: rgba(255,255,255,0.02);
    width: 100%;
    text-align: left;
    font-family: inherit;
    color: inherit;
}

.historia-item:hover,
.historia-item:focus {
    background: rgba(201, 162, 39, 0.1);
    border-color: rgba(201, 162, 39, 0.4);
    outline: none;
}

.historia-item:active {
    transform: scale(0.98);
}

.historia-item-titulo {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--color-text);
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}

.historia-item-ref {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    padding: 0.15rem 0.4rem;
    background: rgba(91, 122, 158, 0.12);
    border-radius: 4px;
    font-weight: 500;
}

.historias-lista-flat .historias-flat-wrap {
    padding: 0.5rem;
}

.historias-empty {
    padding: 2rem 1.5rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.historia-box {
    background: var(--color-bg-card);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    border: 1px solid var(--color-border);
}

/* Planos */
.planos-section { background: rgba(0,0,0,0.2); }

/* Download App - PWA */
.download-app-section {
    background: linear-gradient(180deg, rgba(17, 24, 32, 0.6) 0%, rgba(10, 14, 20, 0.9) 100%);
    border-top: 1px solid var(--color-border);
}
.download-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin: 1.5rem 0;
}
.download-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.75rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-text);
    text-decoration: none;
    transition: all 0.2s;
    min-width: 180px;
    justify-content: center;
}
.download-badge:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-elevated);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.download-badge-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.download-badge-icon svg {
    width: 32px;
    height: 32px;
    color: var(--color-primary);
}
.download-badge-text {
    font-weight: 600;
    font-size: 1rem;
}
.download-hint {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.5;
}
@media (max-width: 480px) {
    .download-badges { flex-direction: column; align-items: center; }
    .download-badge { width: 100%; max-width: 280px; }
}

/* Publicidade - slots rotativos */
.pub-slot {
    margin: 1.5rem 0;
    padding: 1rem;
    background: var(--color-bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    text-align: center;
}
.pub-slot a { text-decoration: none; color: inherit; display: block; }
.pub-slot .pub-img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }
.pub-slot .pub-titulo {
    margin: 0.75rem 0 0.25rem;
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-primary);
    line-height: 1.3;
}
.pub-slot .pub-desc { margin: 0.5rem 0 0; font-size: 0.9rem; color: var(--color-text-muted); }
.pub-slot .pub-video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}
.pub-slot .pub-video-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-sm);
}
.pub-slot-footer { margin-top: 0; margin-bottom: 1rem; }

/* Pub carrossel (múltiplas publicidades) */
.pub-carousel-wrap { position: relative; }
.pub-carousel-slides {
    display: grid;
    min-height: 80px;
}
.pub-carousel-slide {
    grid-area: 1/1;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
}
.pub-carousel-slide.active {
    opacity: 1;
    visibility: visible;
}
.pub-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.pub-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-border);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.pub-carousel-dot:hover, .pub-carousel-dot.active {
    background: var(--color-primary);
    transform: scale(1.2);
}

.planos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.plano-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    border: 1px solid var(--color-border);
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    position: relative;
    overflow: hidden;
}
.plano-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-hover));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.plano-card:hover {
    border-color: rgba(201, 162, 39, 0.4);
    box-shadow: var(--shadow-card);
}

.plano-card h3 {
    color: var(--color-text);
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
    font-weight: 600;
    font-family: var(--font-display);
}

.plano-card p {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.plano-card .dias {
    display: inline-block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    padding: 0.2rem 0.6rem;
    background: rgba(91, 122, 158, 0.15);
    border-radius: 4px;
    font-weight: 500;
}

/* Leitores em Destaque */
.hall-fame-header {
    margin-bottom: 1.25rem;
}
.hall-fame-title {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    color: var(--color-primary);
    font-weight: 700;
}
.hall-fame-subtitle {
    margin: 0 0 0.5rem 0;
    font-size: 0.95rem;
    color: var(--color-text);
    font-weight: 400;
}
.hall-fame-desc {
    margin: 0;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}
.hall-fame-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.hall-fame-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: border-color 0.2s;
}
.hall-fame-card:hover {
    border-color: rgba(201, 162, 39, 0.3);
}
.hall-fame-rank {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    min-width: 1.5rem;
    text-align: center;
}
.hall-fame-avatar-wrap {
    position: relative;
    flex-shrink: 0;
}
.hall-fame-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-primary);
}
.hall-fame-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-elevated);
    color: var(--color-primary);
    font-weight: 700;
    font-size: 1.1rem;
}
.hall-fame-info {
    flex: 1;
    min-width: 0;
}
.hall-fame-nome {
    display: block;
    color: var(--color-text);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.hall-fame-stats {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 0.15rem;
}

/* Busca */
.busca-section { background: rgba(0,0,0,0.15); }

.busca-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    max-width: 600px;
}

.input-busca {
    flex: 1;
    padding: 1rem 1.5rem;
    background: var(--color-bg-input);
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: 1.05rem;
    transition: all 0.2s;
}
.input-busca:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}
.input-busca::placeholder { color: var(--color-text-muted); }

.resultados-busca .resultado-item {
    background: var(--color-bg-card);
    padding: 1.25rem 1.5rem;
    margin-bottom: 0.75rem;
    border-radius: var(--radius);
    border-left: 4px solid var(--color-primary);
    border: 1px solid var(--color-border);
    border-left-width: 4px;
    transition: box-shadow 0.2s, background 0.2s;
}
.resultados-busca .resultado-item:hover {
    box-shadow: var(--shadow-subtle);
}
.resultados-busca .resultado-item-clicavel {
    cursor: pointer;
}
.resultados-busca .resultado-item-clicavel:hover {
    box-shadow: var(--shadow-subtle);
    background: var(--color-bg-hover, rgba(201, 162, 39, 0.08));
}

.resultados-busca .resultado-ref {
    font-size: 0.9rem;
    color: var(--color-primary);
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.resultados-busca .resultado-texto {
    font-family: var(--font-display);
    font-size: 1.05rem;
    line-height: 1.7;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active { display: flex; }

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    padding: 2.25rem;
    width: 100%;
    max-width: 400px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}
.modal-close:hover { color: var(--color-primary); }

.auth-form input {
    width: 100%;
    padding: 0.9rem 1.25rem;
    margin-bottom: 1rem;
    background: var(--color-bg-input);
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-size: 1rem;
    transition: border-color 0.2s;
}
.auth-form input:focus {
    border-color: var(--color-primary);
    outline: none;
}

.auth-switch {
    margin-top: 1.25rem;
    text-align: center;
    color: var(--color-text-muted);
}

.auth-switch a { color: var(--color-primary); text-decoration: none; font-weight: 600; }

/* Footer */
.footer {
    padding: 3rem 1.5rem;
    padding-bottom: calc(3rem + env(safe-area-inset-bottom, 0));
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--color-border);
    background: rgba(0,0,0,0.25);
}

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1.5rem 2rem;
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--color-border);
}

.footer-brand {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-primary);
    letter-spacing: 0.03em;
}

.footer-nav {
    display: flex;
    gap: 1.5rem;
}

.footer-nav a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-nav a:hover {
    color: var(--color-primary);
}

.footer-copy {
    font-size: 0.8rem;
    opacity: 0.85;
}

.footer-copy-link {
    color: inherit;
    text-decoration: none;
}

.footer-copy-link:hover {
    color: inherit;
    text-decoration: none;
}


/* Responsive - webapp em telemóvel */
@media (max-width: 768px) {
    .nav { display: none; }
    .nav.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-bg);
        padding: 1rem;
        border-bottom: 1px solid var(--color-border);
        gap: 0.25rem;
    }
    .nav.open .nav-link { padding: 0.6rem 1rem; }
    .nav.open .prefs-bar { margin-bottom: 0.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--color-border); }
    .menu-toggle { display: block; }
    .hero-actions { flex-direction: column; gap: 0.75rem; }
    .hero-actions .btn { min-width: 200px; }
    .logo-sub { display: none; }
    .hero-carousel, .hero-default { height: 55vh; min-height: 380px; }
    .section { padding: 2.5rem 1rem; }
    .section-title { font-size: 1.5rem; }
    .versiculo-card { padding: 1.5rem 1.25rem; }
    .versiculo-card .texto { font-size: 1.15rem; }
    .historias-picker { margin: 0 0.5rem; max-width: none; }
    .historias-lista { max-height: 45vh; }
    .historias-toolbar { padding: 0.6rem 0.75rem; }
    .historia-filtro { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
    .historias-actions { flex-direction: column; align-items: stretch; }
    .historias-expand-btns { justify-content: flex-end; }
    .historia-grupo-itens { grid-template-columns: 1fr; }
    .historias-grid { grid-template-columns: 1fr; }
    .leitor-controls { flex-wrap: wrap; gap: 0.75rem; }
    .leitor-controls .select { min-width: 0; flex: 1 1 140px; }
    .busca-box { flex-direction: column; }
    .busca-box .btn { width: 100%; }
    .planos-grid { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; gap: 1rem; }
}

@media (max-width: 480px) {
    .section { padding: 2rem 0.75rem; }
    .section-title { font-size: 1.35rem; }
    .historias-lista { max-height: 40vh; }
}
