:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-alt: #0b1220;
  --border: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #10b981;
  --accent-hover: #059669;
  --accent-soft: rgba(16, 185, 129, 0.14);
  --danger: #f43f5e;
  --radius: 16px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  background: radial-gradient(circle at top, #172554 0%, var(--bg) 52%);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
}

.container { max-width: 1020px; margin: 0 auto; padding: 20px 18px 64px; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 18px; margin-bottom: 24px; gap: 16px; flex-wrap: wrap;
}

.brand { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; display: flex; align-items: center; gap: 10px; }
.brand-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); }

.nav-link {
  color: var(--text); text-decoration: none; border: 1px solid var(--border);
  padding: 9px 16px; border-radius: 999px; font-size: 0.9rem; font-weight: 600;
  background: rgba(30, 41, 59, 0.72); cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.nav-link:hover { border-color: var(--accent); background: rgba(16, 185, 129, 0.14); }

/* Cartão de perfil com capa + avatar */
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 30px;
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.45);
}

.profile-cover {
  position: relative;
  width: 100%;
  height: 230px;
  background: linear-gradient(135deg, #064e3b 0%, #1e3a8a 52%, #0f172a 100%);
  overflow: hidden;
}

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

.profile-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.82) 0%, rgba(15, 23, 42, 0.15) 55%, transparent 100%);
  pointer-events: none;
}

.profile-body {
  position: relative;
  padding: 0 28px 28px;
  text-align: center;
}

.profile-avatar-wrap {
  width: 120px;
  height: 120px;
  margin: -62px auto 14px;
  border-radius: 50%;
  border: 4px solid var(--surface);
  box-shadow: 0 0 0 2px var(--accent), 0 10px 26px rgba(2, 6, 23, 0.55);
  background: linear-gradient(145deg, #10b981, #0f766e);
  overflow: hidden;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.profile-avatar-fallback {
  font-size: 2.6rem;
  font-weight: 800;
  color: #052e16;
  letter-spacing: -0.03em;
}

.profile-name-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.profile-name {
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.profile-badge {
  background: var(--accent-soft);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.38);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.profile-bio {
  color: var(--muted);
  font-size: 0.98rem;
  max-width: 540px;
  margin: 0 auto 14px;
}

.profile-highlights {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-pill {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border);
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
}

/* Frase convidativa acima dos planos */
.plans-intro {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 24px;
}

.plans-intro h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.55rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.plans-intro p {
  color: var(--muted);
  font-size: 0.95rem;
}

.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-bottom: 32px; }

.plan-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 22px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.plan-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 14px 30px rgba(16, 185, 129, 0.12); }
.plan-card.featured { border-color: var(--accent); box-shadow: 0 14px 34px rgba(16, 185, 129, 0.18); }

.plan-badge {
  position: absolute; top: -12px; right: 18px; background: var(--accent); color: #052e16;
  font-weight: 700; font-size: 0.74rem; padding: 4px 10px; border-radius: 999px; text-transform: uppercase;
}

.plan-name { font-size: 1.2rem; font-weight: 700; margin-bottom: 6px; }
.plan-subtitle { color: var(--muted); font-size: 0.9rem; margin-bottom: 20px; }
.plan-price { font-size: 2.2rem; font-weight: 800; margin-bottom: 22px; }
.plan-price span { font-size: 0.95rem; font-weight: 500; color: var(--muted); }

.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  width: 100%; padding: 13px 18px; border: none; border-radius: 10px;
  font-size: 0.98rem; font-weight: 700; cursor: pointer; transition: background 0.15s ease;
}
.btn-primary { background: var(--accent); color: #052e16; }
.btn-primary:hover { background: var(--accent-hover); color: #ffffff; }
.btn-secondary { background: #334155; color: var(--text); }
.btn-secondary:hover { background: #475569; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; max-width: 560px; margin: 0 auto;
}
.hidden { display: none !important; }

.qr-box {
  background: #ffffff; border-radius: 12px; padding: 16px; width: 240px; height: 240px;
  margin: 20px auto; display: flex; align-items: center; justify-content: center;
}
.qr-box img { max-width: 100%; max-height: 100%; display: block; }

.copia-cola {
  width: 100%; min-height: 76px; background: var(--surface-alt); color: #e2e8f0;
  border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82rem;
  resize: none; margin-bottom: 12px;
}

.status-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px;
  border-radius: 999px; font-size: 0.88rem; font-weight: 600;
  background: var(--accent-soft); color: #6ee7b7; margin-bottom: 16px;
}

.password-display {
  background: var(--surface-alt); border: 2px dashed var(--accent); border-radius: 12px;
  padding: 20px; text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(1.35rem, 4vw, 1.85rem); font-weight: 800; letter-spacing: 0.08em;
  color: #6ee7b7; margin: 18px 0; user-select: all;
}

.stack { display: flex; flex-direction: column; gap: 12px; }

.input {
  width: 100%; padding: 14px 16px; background: var(--surface-alt);
  border: 1px solid var(--border); border-radius: 10px; color: var(--text);
  font-size: 1.05rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.input:focus { outline: none; border-color: var(--accent); }

.alert-error {
  background: rgba(244, 63, 94, 0.14); border: 1px solid rgba(244, 63, 94, 0.45);
  color: #fda4af; padding: 12px 14px; border-radius: 10px; font-size: 0.92rem; margin-bottom: 16px;
}
.meta-text { color: var(--muted); font-size: 0.9rem; text-align: center; }

/* Galeria de fotos e vídeos (Biaa) */
.gallery-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  flex-wrap: wrap; gap: 16px; margin-bottom: 24px;
}
.gallery-header h1 { font-size: clamp(1.5rem, 3vw, 2rem); margin-bottom: 4px; }
.gallery-header p { color: var(--muted); font-size: 0.95rem; }

.filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab-btn {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all 0.15s ease;
}
.tab-btn:hover { border-color: var(--accent); color: var(--text); }
.tab-btn.active { background: var(--accent); border-color: var(--accent); color: #052e16; }

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

.media-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: transform 0.18s ease, border-color 0.18s ease;
  display: flex; flex-direction: column;
}
.media-card:hover { transform: translateY(-3px); border-color: var(--accent); }

.media-thumb {
  position: relative; aspect-ratio: 16 / 10; background: var(--surface-alt);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.media-thumb img, .media-thumb video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.media-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; color: var(--muted); padding: 20px; text-align: center; font-size: 0.85rem;
}
.media-type-badge {
  position: absolute; top: 10px; left: 10px;
  background: rgba(15, 23, 42, 0.85); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.4);
  font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; text-transform: uppercase;
}
.media-info { padding: 14px 16px; }
.media-title { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.media-desc { font-size: 0.86rem; color: var(--muted); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; background: rgba(2, 6, 23, 0.92);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 1000;
}
.lightbox-content {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  max-width: 900px; width: 100%; overflow: hidden;
}
.lightbox-bar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.lightbox-close {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 6px 12px; cursor: pointer; font-weight: 600;
}
.lightbox-close:hover { border-color: var(--accent); }
.lightbox-body {
  background: #000; display: flex; align-items: center; justify-content: center;
  min-height: 320px; max-height: 75vh;
}
.lightbox-body img, .lightbox-body video {
  max-width: 100%; max-height: 75vh; display: block;
}
.lightbox-body iframe {
  width: 100%; height: 65vh; border: 0;
}

@media (max-width: 600px) {
  .profile-cover { height: 170px; }
  .profile-avatar-wrap { width: 102px; height: 102px; margin-top: -52px; }
  .profile-body { padding: 0 18px 22px; }
}

/* Card de entrada com senha já gerada abaixo dos planos */
.existing-password-card {
  background: rgba(30, 41, 59, 0.78);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  max-width: 560px;
  margin: 8px auto 0;
  text-align: center;
}

.existing-password-card h3 {
  font-size: 1.12rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.inline-login-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.inline-login-form .input {
  flex: 1 1 220px;
}

.inline-login-form .btn {
  flex: 0 1 210px;
  width: auto;
}

@media (max-width: 540px) {
  .inline-login-form .btn {
    width: 100%;
    flex: 1 1 100%;
  }
}
