/* =====================================================================
   Registros Arthur & Vitória — Design System
   Casamento elegante + rede social fotográfica nostálgica (~2015)
   ===================================================================== */

:root {
    --color-bg: #faf6f1;
    --color-surface: #ffffff;
    --color-champagne: #f4ebe1;
    --color-champagne-dark: #e6d3c2;
    --color-bordo: #6d2030;
    --color-bordo-dark: #521824;
    --color-bordo-soft: #8a3040;
    --color-text: #2a2320;
    --color-text-soft: #6b5f57;
    --color-text-faint: #a3968b;
    --color-border: #ecdfd0;
    --color-danger: #b3453f;
    --color-success: #4f7a5a;
    --shadow-sm: 0 1px 3px rgba(43, 30, 22, 0.06);
    --shadow-md: 0 4px 16px rgba(43, 30, 22, 0.08);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --header-height: 56px;
    --bottom-nav-height: 64px;
}

/* Paleta fixa (off-white + bordô), igual em qualquer dispositivo —
   uma identidade de casamento não deve mudar com o tema do sistema. */

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

.icon {
    width: 1.3em; height: 1.3em;
    display: inline-block; vertical-align: -0.22em;
    flex-shrink: 0;
}
.icon-lg { width: 2.2rem; height: 2.2rem; }
.icon-xl { width: 3rem; height: 3rem; }

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: calc(var(--bottom-nav-height) + 12px);
    overflow-x: hidden;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 12px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container { max-width: 600px; margin: 0 auto; padding: 0 16px; }

/* ---------- Cabeçalho ---------- */
.app-header {
    position: sticky; top: 0; z-index: 20;
    height: var(--header-height);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
}
.app-header .brand {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: .02em;
}
.app-header .brand .amp { color: var(--color-bordo); font-style: italic; }
.app-header .header-action {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; background: var(--color-champagne); border: none; cursor: pointer;
}

/* ---------- Home ---------- */
.home-screen {
    min-height: calc(100vh - var(--bottom-nav-height));
    display: flex; flex-direction: column; align-items: center;
    text-align: center; padding: 32px 20px 20px;
}
.home-hero { margin: auto 0; display: flex; flex-direction: column; align-items: center; }
.home-monogram { width: 92px; height: auto; margin-bottom: 18px; opacity: .92; }
.home-screen .names { font-size: 2rem; margin-bottom: 6px; }
.home-screen .tagline { color: var(--color-text-soft); margin-bottom: 32px; max-width: 320px; }
.home-actions { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 14px; }

.home-secondary { width: 100%; max-width: 340px; padding-top: 18px; }
.btn-quiet {
    width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 13px 16px; border-radius: var(--radius-lg);
    background: var(--color-surface); border: 1px solid var(--color-border);
    color: var(--color-text-faint); font-size: .88rem; font-weight: 600; cursor: pointer;
}
.btn-quiet .icon { width: 1.1rem; height: 1.1rem; }
.btn-quiet:active { background: var(--color-champagne); }
.home-secondary-hint { font-size: .72rem; color: var(--color-text-faint); margin-top: 8px; }

.btn-big {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 18px 20px; border-radius: var(--radius-lg);
    font-size: 1.05rem; font-weight: 600; border: none; cursor: pointer;
    box-shadow: var(--shadow-sm);
}
.btn-big.primary { background: var(--color-bordo); color: #fff; }
.btn-big.champagne { background: var(--color-champagne); color: var(--color-text); border: 1px solid var(--color-champagne-dark); }
.btn-big .icon { width: 1.3rem; height: 1.3rem; }

/* ---------- Botões genéricos ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 20px; border-radius: var(--radius-md);
    font-size: .95rem; font-weight: 600; border: 1px solid transparent; cursor: pointer;
    min-height: 46px;
}
.btn-primary { background: var(--color-bordo); color: #fff; }
.btn-primary:active { background: var(--color-bordo-dark); }
.btn-outline { background: transparent; border-color: var(--color-border); color: var(--color-text); }
.btn-gold { background: var(--color-bordo); color: #fff; }
.btn-danger { background: transparent; color: var(--color-danger); border-color: var(--color-danger); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- Formulários ---------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: .88rem; font-weight: 600; color: var(--color-text-soft); }
.form-control {
    width: 100%; padding: 13px 14px; border-radius: var(--radius-sm);
    border: 1px solid var(--color-border); background: var(--color-surface);
    font-size: 1rem; color: var(--color-text);
}
.form-control:focus { outline: none; border-color: var(--color-bordo); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: .8rem; color: var(--color-text-faint); margin-top: 4px; }
.form-error { font-size: .85rem; color: var(--color-danger); margin-top: 4px; }
.auth-card {
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius-lg); padding: 28px 22px; margin-top: 24px;
}
.auth-switch { text-align: center; margin-top: 18px; font-size: .9rem; color: var(--color-text-soft); }
.auth-switch a { color: var(--color-bordo); font-weight: 600; }
.dev-credit {
    text-align: center; margin-top: 26px; padding-top: 16px;
    border-top: 1px solid var(--color-border);
    font-size: .68rem; letter-spacing: .06em; text-transform: uppercase;
    color: var(--color-text-faint);
}
.dev-credit a {
    color: var(--color-bordo); font-weight: 700; text-decoration: none;
    letter-spacing: .04em; margin-left: 2px;
}
.dev-credit a:hover { opacity: .75; }

.alert { padding: 12px 14px; border-radius: var(--radius-sm); font-size: .9rem; margin-bottom: 16px; }
.alert-error { background: #fbeceb; color: var(--color-danger); }
.alert-success { background: #eaf3ec; color: var(--color-success); }

/* ---------- Feed ---------- */
.feed-page { max-width: 600px; margin: 0 auto; }
.post-card {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 8px;
}
.post-card .post-head {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px;
}
.avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--color-champagne); color: var(--color-bordo);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .9rem; flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.post-author { font-weight: 600; font-size: .92rem; }
.post-time { font-size: .78rem; color: var(--color-text-faint); }
.post-photo-wrap { width: 100%; background: #eee; }
.post-photo-wrap img { width: 100%; height: auto; }
.post-actions { display: flex; align-items: center; gap: 16px; padding: 10px 14px 4px; }
.like-btn { background: none; border: none; cursor: pointer; padding: 0; line-height: 1; color: var(--color-text); }
.like-btn .icon { width: 1.5rem; height: 1.5rem; }
.like-btn.liked { color: var(--color-danger); }
.icon-action { color: var(--color-text); }
.icon-action .icon { width: 1.3rem; height: 1.3rem; }
.icon-action-btn { background: none; border: none; cursor: pointer; padding: 0; }
.post-likes { padding: 0 14px; font-weight: 600; font-size: .88rem; }
.post-caption { padding: 6px 14px 4px; font-size: .92rem; }
.post-caption .post-author { margin-right: 6px; }
.post-comments-link { padding: 2px 14px 14px; font-size: .85rem; color: var(--color-text-faint); }

.feed-loadmore { display: flex; justify-content: center; padding: 20px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--color-text-soft); }

/* ---------- Publicar ---------- */
.upload-picker {
    border: 2px dashed var(--color-border); border-radius: var(--radius-lg);
    padding: 40px 20px; text-align: center; cursor: pointer; background: var(--color-surface);
}
.upload-preview { width: 100%; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 16px; }
.upload-preview img { width: 100%; }
.progress-bar {
    height: 8px; border-radius: 8px; background: var(--color-champagne);
    overflow: hidden; margin: 10px 0;
}
.progress-bar-fill { height: 100%; background: var(--color-bordo); transition: width .2s ease; }
.consent-text { font-size: .8rem; color: var(--color-text-faint); margin: 14px 0; }

/* ---------- Desafios ---------- */
.challenges-intro { padding: 20px 0 8px; }
.challenge-filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; margin-bottom: 6px; }
.chip {
    padding: 8px 14px; border-radius: 999px; background: var(--color-surface);
    border: 1px solid var(--color-border); font-size: .82rem; white-space: nowrap; cursor: pointer;
}
.chip.active { background: var(--color-text); color: #fff; border-color: var(--color-text); }

.challenge-card {
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius-lg); padding: 18px; margin-bottom: 14px;
}
.challenge-card .badge-row { display: flex; gap: 8px; margin-bottom: 10px; }
.badge { font-size: .72rem; padding: 4px 10px; border-radius: 999px; font-weight: 600; }
.badge-category { background: var(--color-champagne); color: var(--color-text); }
.badge-points { background: var(--color-bordo); color: #fff; }
.badge-difficulty-facil { background: #eaf3ec; color: var(--color-success); }
.badge-difficulty-medio { background: #fbf1e0; color: #9a6c1f; }
.badge-difficulty-dificil { background: #fbeceb; color: var(--color-danger); }
.challenge-card h3 { font-size: 1.1rem; margin-bottom: 6px; }
.challenge-card p { color: var(--color-text-soft); font-size: .92rem; }
.challenge-card .done-tag { font-size: .8rem; color: var(--color-success); font-weight: 600; display: flex; align-items: center; gap: 5px; }
.challenge-card .done-tag .icon { width: 1rem; height: 1rem; }
.random-cta .icon { width: 1.2rem; height: 1.2rem; }

.random-cta {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; margin: 6px 0 20px; padding: 14px; border-radius: var(--radius-lg);
    background: var(--color-champagne); border: 1px solid var(--color-champagne-dark);
    font-weight: 600; cursor: pointer;
}

.challenge-detail-hero { text-align: center; padding: 20px 0 8px; }
.challenge-success { text-align: center; padding: 40px 20px; }
.challenge-success .icon-xl { margin-bottom: 12px; }
.challenge-success .success-icon { color: var(--color-success); }
.heart-accent { color: var(--color-bordo); }

/* ---------- Galeria ---------- */
.gallery-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin-top: 10px;
}
.gallery-grid a { display: block; aspect-ratio: 1 / 1; overflow: hidden; background: #eee; }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; }

.lightbox {
    position: fixed; inset: 0; background: rgba(20,14,12,.95); z-index: 100;
    display: flex; align-items: center; justify-content: center; flex-direction: column;
}
.lightbox-stage {
    width: 100%; max-height: 78vh; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    touch-action: none;
}
.lightbox-stage img {
    max-width: 100%; max-height: 78vh; object-fit: contain;
    touch-action: none; user-select: none; -webkit-user-drag: none;
    cursor: zoom-in; will-change: transform;
}
.lightbox-close { position: absolute; top: 16px; right: 16px; background: none; border: none; color: #fff; cursor: pointer; z-index: 2; }
.lightbox-close .icon { width: 1.6rem; height: 1.6rem; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); background: none; border: none; color: #fff; cursor: pointer; padding: 10px; z-index: 2; }
.lightbox-nav .icon { width: 2rem; height: 2rem; }
.lightbox-actions .icon { width: 1.1rem; height: 1.1rem; }
.lightbox-prev { left: 8px; } .lightbox-next { right: 8px; }
.lightbox-actions { margin-top: 14px; display: flex; gap: 10px; }
.lightbox-hint { color: rgba(255,255,255,.55); font-size: .75rem; margin-top: 10px; }
@media (min-width: 601px) { .lightbox-hint { display: none; } }

/* ---------- Ranking ---------- */
.ranking-row {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius-md); margin-bottom: 8px;
}
.ranking-pos { width: 28px; text-align: center; font-weight: 700; color: var(--color-bordo); }
.ranking-name { flex: 1; font-weight: 600; }
.ranking-points { font-size: .85rem; color: var(--color-text-soft); }

/* ---------- Bottom Navigation ---------- */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    height: var(--bottom-nav-height);
    background: var(--color-surface); border-top: 1px solid var(--color-border);
    display: flex; max-width: 600px; margin: 0 auto;
}
.bottom-nav a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; font-size: .68rem; color: var(--color-text-faint);
}
.bottom-nav a.active { color: var(--color-bordo); font-weight: 600; }
.bottom-nav .nav-icon .icon { width: 1.4rem; height: 1.4rem; }

/* ---------- Perfil ---------- */
.profile-header { text-align: center; padding: 24px 0; }
.profile-avatar { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 12px; font-size: 1.8rem; }
.profile-stats { display: flex; justify-content: center; gap: 28px; margin-top: 16px; }
.profile-stat strong { display: block; font-size: 1.2rem; }
.profile-stat span { font-size: .78rem; color: var(--color-text-faint); }

/* ---------- Toast / feedback ---------- */
.toast {
    position: fixed; bottom: calc(var(--bottom-nav-height) + 14px); left: 50%; transform: translateX(-50%);
    background: var(--color-text); color: #fff; padding: 10px 18px; border-radius: 999px;
    font-size: .85rem; z-index: 200; box-shadow: var(--shadow-md);
}

/* ---------- Utilitários ---------- */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.text-center { text-align: center; }
.text-muted { color: var(--color-text-soft); }
.page-title { padding: 20px 0 4px; }
.page-subtitle { color: var(--color-text-soft); margin-bottom: 18px; }

@media (min-width: 601px) {
    body { background: var(--color-champagne); }
    .feed-page, .app-header, .bottom-nav { box-shadow: var(--shadow-md); }
}
