:root {
  --bg: #f1f3f6;          /* cinza claro */
  --surface: #ffffff;
  --navy: #1b2a4a;        /* azul-marinho */
  --navy-2: #2a3d66;
  --navy-soft: #e6eaf2;
  --orange: #f07f2f;      /* laranja dos botões e detalhes */
  --orange-dark: #d96a1c;
  --orange-soft: #fdeee2;
  --ink: #1f2937;
  --muted: #6b7488;
  --line: #e2e6ee;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(27, 42, 74, .06), 0 8px 24px rgba(27, 42, 74, .07);
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.55 "Nunito", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { color: var(--navy); line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; } h3 { font-size: 1.15rem; }
a { color: var(--orange-dark); }

/* Cabeçalho */
header { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; background: var(--navy); color: #fff; }
header h1 { margin: 0; font-size: 1.25rem; color: #fff; }
header h1 a { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.logo { width: 30px; height: 30px; border-radius: 10px; background: var(--orange); display: grid; place-items: center; font-size: 16px; }
#who { display: flex; align-items: center; gap: 12px; font-size: .95rem; }
#who a { color: #fff; opacity: .8; text-decoration: none; } #who a:hover { opacity: 1; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-weight: 800; text-transform: uppercase; }

main { max-width: 920px; margin: 0 auto; padding: 28px 16px 80px; }
.card { background: var(--surface); border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow); }

/* Formulários e botões */
label { font-size: .9rem; font-weight: 700; color: var(--navy); }
input, textarea, select { font: inherit; width: 100%; margin: 6px 0 14px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fafbfc; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-soft); background: #fff; }
input[type=file] { padding: 10px; background: var(--navy-soft); border-style: dashed; cursor: pointer; }
button { font: inherit; font-weight: 700; padding: 11px 20px; border-radius: 999px; border: none; cursor: pointer; background: var(--orange); color: #fff; transition: background .15s, transform .1s; }
button:hover { background: var(--orange-dark); } button:active { transform: scale(.98); }
button.ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--line); }
button.ghost:hover { border-color: var(--navy); background: var(--navy-soft); }
button.small { padding: 6px 14px; font-size: .85rem; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); font-size: .92rem; }
.error { color: #c0392b; font-weight: 600; }

/* Login */
.auth { display: grid; grid-template-columns: 1.1fr 1fr; max-width: 860px; margin: 40px auto; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.auth-hero { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 48px 40px; position: relative; overflow: hidden; }
.auth-hero h2 { color: #fff; font-size: 2rem; margin: 0 0 12px; }
.auth-hero p { opacity: .85; margin: 0; }
.auth-hero::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; background: var(--orange); opacity: .9; }
.auth-hero .examples { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.auth-hero .examples span { background: rgba(255,255,255,.12); padding: 6px 12px; border-radius: 999px; font-size: .88rem; }
.auth-form { padding: 44px 36px; }
.auth-form h2 { margin-top: 0; }

/* Início */
.hello { margin: 0 0 4px; font-size: 1.7rem; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; margin: 32px 0 14px; }
.section-title h2 { margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.trail-card { display: block; color: inherit; text-decoration: none; background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s; }
.trail-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(27,42,74,.08), 0 14px 32px rgba(27,42,74,.12); }
.cover { height: 140px; background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%) center/cover no-repeat; display: grid; place-items: center; color: #fff; font-size: 2.6rem; font-weight: 800; position: relative; }
.cover .badge { position: absolute; top: 12px; left: 12px; }
.trail-body { padding: 16px 18px 18px; }
.trail-body b { color: var(--navy); font-size: 1.08rem; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--navy); }
.badge.shared { background: var(--orange); color: #fff; }
.new-trail { border: 2px dashed var(--line); box-shadow: none; background: transparent; }

/* Relembrar */
.rewind { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; }
.rewind h2 { color: #fff; margin-top: 0; display: flex; align-items: center; gap: 10px; }
.rewind h2::before { content: "✦"; color: var(--orange); }
.rewind a { color: #ffb782; }
.rewind-item { padding: 14px 0; border-top: 1px solid rgba(255,255,255,.12); }
.rewind-item:first-of-type { border-top: none; padding-top: 0; }
.rewind-item small { display: block; color: #ffb782; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; font-size: .75rem; }

/* Trilha */
.trail-head { position: relative; overflow: hidden; }
.trail-head::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--orange); }
.trail-head h2 { margin: 0 0 6px; font-size: 1.8rem; }
details summary { cursor: pointer; font-weight: 700; color: var(--navy); margin-top: 8px; }
details ul { list-style: none; padding: 0; } details li { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }

.tag { display: inline-block; background: var(--orange-soft); color: var(--orange-dark); border-radius: 999px; padding: 2px 12px; font-size: .85rem; font-weight: 700; margin: 2px 6px 2px 0; cursor: pointer; transition: background .15s; }
.tag:hover { background: #fbdcc4; }

.timeline { position: relative; margin-left: 10px; padding-left: 30px; }
.timeline::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 3px; background: var(--navy-soft); }
.year { position: relative; display: inline-block; margin: 26px 0 12px -48px; padding: 4px 14px; border-radius: 999px; background: var(--navy); color: #fff; font-weight: 800; font-size: .9rem; }
.memory { position: relative; }
.memory::before { content: ""; position: absolute; left: -38px; top: 26px; width: 14px; height: 14px; border-radius: 50%; background: var(--orange); border: 3px solid var(--bg); box-shadow: 0 0 0 2px var(--orange); }
.memory .date { font-size: .82rem; font-weight: 800; color: var(--orange-dark); text-transform: uppercase; letter-spacing: .04em; }
.memory h3 { margin: 2px 0 6px; }
.media { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin-top: 12px; }
.media img, .media video { width: 100%; height: 200px; object-fit: cover; border-radius: 12px; display: block; background: var(--navy-soft); }
.media .file { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 12px; background: var(--navy-soft); color: var(--navy); text-decoration: none; font-weight: 600; }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

@media (max-width: 680px) {
  .auth { grid-template-columns: 1fr; margin: 0 auto; }
  .auth-hero { padding: 32px 24px; } .auth-hero h2 { font-size: 1.6rem; }
  .auth-form { padding: 28px 24px; }
  header { padding: 12px 16px; }
  #who .name { display: none; }
}

/* Sino de notificações */
.bell-wrap { position: relative; }
.bell { position: relative; background: transparent; color: #fff; padding: 6px; border-radius: 50%; display: grid; place-items: center; }
.bell:hover { background: rgba(255,255,255,.12); }
.bell-badge { position: absolute; top: -2px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--orange); color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--navy); }
.bell-badge[hidden] { display: none; }
.bell-panel { position: absolute; right: -60px; top: 46px; width: min(380px, calc(100vw - 24px)); max-height: 70vh; overflow-y: auto; background: var(--surface); color: var(--ink); border-radius: 16px; box-shadow: 0 12px 40px rgba(27,42,74,.25); z-index: 20; }
.bell-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); color: var(--navy); position: sticky; top: 0; background: var(--surface); }
button.link { background: none; color: var(--orange-dark); padding: 0; font-size: .85rem; font-weight: 700; }
button.link:hover { background: none; text-decoration: underline; }
.notif { display: flex; gap: 12px; padding: 12px 16px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); font-size: .93rem; line-height: 1.4; }
.notif:hover { background: var(--bg); }
.notif.unread { background: var(--orange-soft); }
.notif.unread b { color: var(--navy); }
.notif-icon { font-size: 1.3rem; }
a.avatar { text-decoration: none; opacity: 1 !important; }

/* Lembretes e preferências */
.reminder-box { background: var(--bg); border-radius: 14px; padding: 14px 16px; margin-top: 4px; }
.reminder-box select { max-width: 340px; }
label.check { display: flex; align-items: center; gap: 10px; margin-top: 8px; cursor: pointer; }
label.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--orange); }
@media (max-width: 680px) {
  .bell-panel { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; }
}

/* Pop-up de revelação da memória */
.reveal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(27, 42, 74, 0); backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); transition: background .4s, backdrop-filter .4s, -webkit-backdrop-filter .4s; }
.reveal-backdrop.open { background: rgba(27, 42, 74, .55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.reveal-backdrop.closing { opacity: 0; transition: opacity .25s; }
.reveal-card { position: relative; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border-radius: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.35); opacity: 0; transform: translateY(24px) scale(.94); transition: opacity .45s ease, transform .55s cubic-bezier(.2, .9, .3, 1.2); }
.reveal-backdrop.open .reveal-card { opacity: 1; transform: none; }
.reveal-close { position: absolute; top: 12px; right: 12px; z-index: 3; width: 36px; height: 36px; padding: 0; border-radius: 50%; background: rgba(255,255,255,.85); color: var(--navy); font-size: 1rem; }
.reveal-close:hover { background: #fff; }
.reveal-kicker { position: absolute; top: 16px; left: 16px; z-index: 3; background: var(--orange); color: #fff; font-weight: 800; font-size: .85rem; padding: 6px 14px; border-radius: 999px; box-shadow: 0 4px 14px rgba(240,127,47,.4); }
.reveal-stage { position: relative; overflow: hidden; aspect-ratio: 4 / 3; background: var(--navy); cursor: pointer; }
.reveal-stage img, .reveal-stage video, .reveal-placeholder { width: 100%; height: 100%; object-fit: cover; display: block; filter: blur(28px) saturate(1.3); transform: scale(1.15); transition: filter 1.6s ease, transform 1.8s cubic-bezier(.2, .8, .2, 1); }
.reveal-placeholder { display: grid; place-items: center; background: linear-gradient(135deg, var(--navy), var(--navy-2) 60%, var(--orange)); }
.reveal-placeholder span { color: #fff; font-size: 4.5rem; font-weight: 800; letter-spacing: .02em; }
.reveal-veil { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #fff; font-weight: 800; font-size: 1.05rem; text-shadow: 0 2px 12px rgba(0,0,0,.4); transition: opacity .6s; }
.reveal-veil span { font-size: 2.4rem; color: #ffb782; animation: pulse 1.2s ease-in-out infinite; }
.reveal-stage::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%); transform: translateX(-120%); pointer-events: none; }
.revealed .reveal-stage img, .revealed .reveal-stage video, .revealed .reveal-placeholder { filter: none; transform: none; }
.revealed .reveal-veil { opacity: 0; pointer-events: none; }
.revealed .reveal-stage::after { animation: shine 1.2s ease .2s; }
.reveal-body { padding: 22px 24px 24px; }
.reveal-body > * { opacity: 0; transform: translateY(10px); transition: opacity .5s, transform .5s; }
.revealed .reveal-body > * { opacity: 1; transform: none; }
.revealed .reveal-body > :nth-child(2) { transition-delay: .5s; }
.revealed .reveal-body > :nth-child(1) { transition-delay: .4s; }
.revealed .reveal-body > :nth-child(n+3) { transition-delay: .65s; }
.reveal-body h2 { margin: 4px 0 8px; font-size: 1.6rem; }
.reveal-body .date { font-size: .82rem; font-weight: 800; color: var(--orange-dark); text-transform: uppercase; letter-spacing: .04em; }
a.btn { display: inline-block; font-weight: 700; padding: 11px 20px; border-radius: 999px; background: var(--orange); color: #fff; text-decoration: none; }
a.btn:hover { background: var(--orange-dark); }
@keyframes pulse { 50% { transform: scale(1.25); opacity: .7; } }
@keyframes shine { to { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) {
  .reveal-card, .reveal-stage img, .reveal-stage video, .reveal-placeholder, .reveal-body > * { transition-duration: .01s !important; }
  .revealed .reveal-stage::after, .reveal-veil span { animation: none; }
}

/* Áudio: botão de som, notas de voz e gravador */
.sound-toggle { position: absolute; right: 14px; bottom: 14px; z-index: 3; width: 44px; height: 44px; padding: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(27, 42, 74, .72); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.sound-toggle:hover { background: var(--navy); }
.sound-toggle.on { background: var(--orange); }
.voice-note { display: flex; align-items: center; gap: 12px; margin: 10px 0; padding: 10px 14px; border-radius: 14px; background: var(--navy-soft); }
.voice-icon { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--orange); font-size: 1.1rem; }
.voice-note audio, .audio-card audio, .recorder audio { width: 100%; height: 40px; }
.audio-card { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--navy-soft); grid-column: 1 / -1; }
.audio-card > div { flex: 1; min-width: 0; } .audio-card small { color: var(--muted); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recorder { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: -4px 0 14px; padding: 12px 14px; border-radius: 14px; border: 1.5px dashed var(--line); }
.recorder .row { width: 100%; flex-wrap: nowrap; } .recorder audio { flex: 1; }
#rec-btn.recording { background: #c0392b; color: #fff; border-color: #c0392b; }
.rec-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #c0392b; animation: pulse 1s ease-in-out infinite; vertical-align: middle; }
[hidden] { display: none !important; }
