/* ============================================
   ROOT VARIABLES
============================================ */
:root {
  --bg-main: #0e0b10;
  --bg-card: rgba(24, 17, 20, 0.88);
  --bg-card-alt: rgba(16, 12, 15, 0.95);
  --border-soft: #3b2e25;
  --accent: #b89c6c;
  --accent-soft: #d6c8b0;
  --danger: #b25a5a;
  --text-main: #f1e6d8;
  --text-muted: #c2b6a5;
  --shadow: rgba(0, 0, 0, 0.6);
}

/* ============================================
   GLOBAL
============================================ */
body {
  margin: 0;
  padding: 0;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: "Cormorant Garamond", serif;
  min-height: 100vh;
  overflow-x: hidden;
}



.page-bg {
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle at top, #241926, #050308),
    url("https://i.imgur.com/5ZQ8bHQ.jpeg");
  background-size: cover;
  background-position: center;
  opacity: 0.2;
  z-index: -1;
}

/* ============================================
   HEADER
============================================ */
.header {
  position: relative;     /* antes era absolute */
  width: 100%;
  text-align: center;
  margin-top: 40px;
  margin-bottom: 20px;
  z-index: 5;
}





.title {
  font-family: "Cinzel", serif;
  font-size: 2.4rem;
  color: var(--accent-soft);
  letter-spacing: 2px;
  text-shadow: 0 0 12px var(--shadow);
}

.subtitle {
  font-size: 0.95rem;
  opacity: 0.85;
  color: var(--text-muted);
}

/* ============================================
   CONTAINER PRINCIPAL
============================================ */
/* .container {
  width: 100%;
  height: 100%;
  
  display: flex;
  align-items: center;
  justify-content: center;

  position: relative;
  z-index: 10;
  overflow: visible;
} */

.container {
  width: 100%;
  min-height: calc(100vh - 150px); /* espaço embaixo do header */
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding-top: 40px;
}


/* ============================================
   LOGIN & REGISTER CARDS
============================================ */
#login-section,
#register-section {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: linear-gradient(135deg, rgba(133, 89, 35, 0.95), rgba(24, 17, 20, 0.92));
  backdrop-filter: blur(8px);
  border-radius: 18px;
  border: 1px solid #6a4632;
  padding: 32px 26px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.8);
  animation: fade-in 0.6s ease;
}

#register-section.hidden,
#login-section.hidden {
  display: none !important;
}

/* Borda dourada */
#login-section::before,
#register-section::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, #b89c6c, #d6c8b0);
  border-radius: 20px;
  opacity: 0.1;
  z-index: -1;
}

/* TITULOS */
#login-section .section-title,
#register-section .section-title {
  font-family: "Cinzel", serif;
  font-size: 1.8rem;
  margin-bottom: 24px;
  text-align: center;
}

/* FORMS */
.label {
  display: block;
  margin-top: 8px;
  margin-bottom: 4px;
  font-size: 0.9rem;
  color: var(--accent-soft);
  letter-spacing: 0.5px;
}

.input {
  width: 100%;
  background: rgba(28, 21, 23, 0.8);
  border: 1px solid #6a4632;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  color: var(--text-main);
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(40, 30, 25, 0.9);
  box-shadow: 0 0 12px rgba(184, 156, 108, 0.4);
}

.input::placeholder {
  color: #a89682;
}

/* BOTÃO PRINCIPAL */
.main-btn {
  width: 100%;
  background: linear-gradient(135deg, #b89c6c, #d6c8b0);
  color: #0e0b10;
  padding: 13px 16px;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 10px;
  margin-top: 12px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(184, 156, 108, 0.3);
  transition: 0.3s;
}

.main-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(184, 156, 108, 0.45);
}

/* MENSAGENS DE ERRO */
.error {
  background: rgba(178, 90, 90, 0.15);
  border: 1px solid rgba(178, 90, 90, 0.4);
  padding: 8px 10px;
  font-size: 0.9rem;
  text-align: center;
  color: #e49d9d;
  border-radius: 6px;
  margin-top: 8px;
}

/* ============================================
   APP SECTION (ÁREA LOGADA)
============================================ */
#app-section {
  display: none;
  width: 95%;
  max-width: 960px;
  height: calc(100vh - 40px);
  overflow-y: auto;
  margin-top: 40px;
}

body.app-active {
  overflow-y: auto;
  justify-content: flex-start;
}

body.app-active #app-section {
  display: block;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Cartões */
.card,
.app-card {
  background: var(--bg-card);
  backdrop-filter: blur(5px);
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  box-shadow: 0 0 22px var(--shadow);
  padding: 20px 18px 24px;
  margin-bottom: 18px;
}
#app-section {
  width: 95%;
  max-width: 960px;
  margin: 20px auto;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}

.section-title {
  font-family: "Cinzel", serif;
  font-size: 1.6rem;
  text-align: center;
  margin: 0 0 16px;
  color: var(--accent-soft);
  text-shadow: 0 0 8px rgba(214, 200, 176, 0.3);
}

#login-section .section-title,
#register-section .section-title {
  font-size: 1.8rem;
  margin-bottom: 24px;
  letter-spacing: 1px;
}

#login-section .label,
#register-section .label {
  font-size: 0.92rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  color: #d6c8b0;
}

#login-section .input,
#register-section .input {
  background: rgba(28, 21, 23, 0.8);
  border: 1px solid #6a4632;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  color: var(--text-main);
  transition: all 0.3s ease;
  font-size: 0.96rem;
}

#login-section .input:focus,
#register-section .input:focus {
  background: rgba(40, 30, 25, 0.9);
  border-color: #b89c6c;
  box-shadow: 0 0 12px rgba(184, 156, 108, 0.4), inset 0 0 4px rgba(184, 156, 108, 0.2);
}

#login-section .input::placeholder,
#register-section .input::placeholder {
  color: #a89682;
}

#login-section .main-btn,
#register-section .main-btn {
  width: 100%;
  margin-top: 8px;
  background: linear-gradient(135deg, #b89c6c, #d6c8b0);
  color: #0e0b10;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  font-size: 0.95rem;
  padding: 13px 16px;
  box-shadow: 0 8px 20px rgba(184, 156, 108, 0.3);
  transition: all 0.3s ease;
}

#login-section .main-btn:hover,
#register-section .main-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(184, 156, 108, 0.5);
  background: linear-gradient(135deg, #d6c8b0, #e8dcc8);
}

#login-section .main-btn:active,
#register-section .main-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 10px rgba(184, 156, 108, 0.3);
}

.with-border {
  border-bottom: 1px solid rgba(184, 156, 108, 0.4);
  padding-bottom: 8px;
}

.section-subtitle {
  font-family: "Cinzel", serif;
  font-size: 1.2rem;
  margin: 10px 0 8px;
}

.section-description {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

/* Formulários */
.label {
  display: block;
  margin-top: 8px;
  margin-bottom: 4px;
  font-size: 0.98rem;
  color: var(--accent-soft);
}

.input,
.textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #1c1517;
  border-radius: 8px;
  border: 1px solid #3e2f25;
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
}

.textarea {
  resize: vertical;
}

.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(184, 156, 108, 0.5);
}

/* Botões */
.button {
  border: none;
  border-radius: 999px;
  padding: 11px 16px;
  font-family: "Cinzel", serif;
  font-size: 1rem;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.2s ease;
}

.main-btn {
  width: 100%;
  background: linear-gradient(135deg, #6a4632, #39271f);
  color: var(--text-main);
  box-shadow: 0 6px 12px var(--shadow);
}

.secondary-btn {
  background: linear-gradient(135deg, #3c2a33, #24171e);
  color: var(--accent-soft);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px var(--shadow);
}

.button:active {
  transform: translateY(1px);
  box-shadow: 0 3px 6px var(--shadow);
}

/* Navegação */
.top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.nav-btn {
  flex: 1;
  min-width: 80px;
  padding: 8px 6px;
  border-radius: 999px;
  border: 1px solid #3a2a24;
  background: rgba(18, 12, 14, 0.9);
  color: var(--text-muted);
  font-family: "Cinzel", serif;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.nav-active {
  background: linear-gradient(135deg, #694433, #3b2620);
  color: var(--text-main);
  border-color: var(--accent);
}

.nav-danger {
  border-color: var(--danger);
  color: #e3bcbc;
}

/* Listas */
.list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-card {
  background: var(--bg-card-alt);
  border-radius: 10px;
  border-left: 4px solid var(--accent);
  padding: 10px 12px;
  box-shadow: 0 4px 10px var(--shadow);
  animation: subtle-pop 0.18s ease-out;
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}

.item-title {
  font-family: "Cinzel", serif;
  font-size: 1.05rem;
  margin: 0;
}

.item-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.item-body {
  font-size: 0.95rem;
  color: var(--text-main);
  margin: 4px 0;
}

.item-footer {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.item-rating {
  font-size: 0.9rem;
  color: var(--accent);
  margin: 4px 0;
  font-weight: 600;
}

/* Perfil */
.profile-card {
  background: var(--bg-card-alt);
  border-radius: 12px;
  padding: 16px;
  border: 1px dashed var(--accent);
}

.profile-field {
  margin-bottom: 8px;
  font-size: 0.96rem;
}

.profile-label {
  font-weight: 600;
  color: var(--accent-soft);
}

/* Divider */
.divider {
  height: 1px;
  margin: 16px 0;
  background: linear-gradient(
    to right,
    transparent,
    rgba(184, 156, 108, 0.6),
    transparent
  );
}

#login-section .divider,
#register-section .divider {
  margin: 24px 0;
}

/* Mensagens */
.error {
  color: #e49d9d;
  text-align: center;
  font-size: 0.9rem;
  min-height: 18px;
  margin-top: 6px;
  background: rgba(178, 90, 90, 0.15);
  border: 1px solid rgba(178, 90, 90, 0.4);
  padding: 8px 10px;
  border-radius: 4px;
}

#loginError,
#registerError {
  margin-top: 12px;
  margin-bottom: 0;
}

.info {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Links */
.link {
  color: var(--accent-soft);
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px solid rgba(214, 200, 176, 0.5);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.link:hover {
  color: #e8d9c3;
  border-bottom-color: var(--accent-soft);
}

/* Utilitários */
.hidden {
  display: none;
}

/* Animações */
.fade-in {
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes subtle-pop {
  from {
    transform: scale(0.98);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Responsividade */
@media (min-width: 768px) {
  body.app-active .container {
    height: auto;
    min-height: auto;
  }

  body.app-active #app-section {
    width: 95%;
    max-width: 960px;
    margin: 40px auto;
  }

  .top-nav {
    justify-content: center;
  }

  .nav-btn {
    flex: 0 0 auto;
  }
}

@media (min-width: 992px) {
  .container {
    grid-template-columns: 1.1fr 2.2fr;
  }
}

/* Abas */
.tab-btn {
  flex: 1;
  min-width: 100px;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-soft);
  background: rgba(18, 12, 14, 0.9);
  color: var(--text-muted);
  font-family: "Cinzel", serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: linear-gradient(135deg, #694433, #3b2620);
  color: var(--text-main);
  border-color: var(--accent);
}

.tab-btn:hover {
  border-color: var(--accent-soft);
  color: var(--accent-soft);
}

.tab-content {
  animation: fadeIn 0.3s ease-out;
}

.hidden {
  display: none;
}

/* ===== REDE SOCIAL ===== */

/* Cartão de usuário */
.user-card {
  background: linear-gradient(135deg, rgba(155, 126, 189, 0.15), rgba(107, 69, 51, 0.15));
  border: 1px solid #9b7ebd;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.user-card:hover {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(155, 126, 189, 0.25), rgba(107, 69, 51, 0.25));
  box-shadow: 0 4px 15px rgba(155, 126, 189, 0.2);
}

.user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.user-name {
  font-size: 1.2rem;
  color: var(--accent-soft);
  margin: 0;
  font-weight: 600;
}

.user-bio {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 8px 0;
  font-style: italic;
}

.user-stats {
  display: flex;
  gap: 16px;
  margin: 12px 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.user-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Cartão de resenha no feed */
.feed-card {
  background: linear-gradient(135deg, rgba(184, 156, 108, 0.08), rgba(107, 69, 51, 0.08));
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
}

.feed-card:hover {
  background: linear-gradient(135deg, rgba(184, 156, 108, 0.15), rgba(107, 69, 51, 0.15));
  border-left-color: var(--accent-soft);
}

.author-link {
  cursor: pointer;
  color: #9b7ebd;
  transition: color 0.2s ease;
}

.author-link:hover {
  color: var(--accent-soft);
  text-decoration: underline;
}

/* Perfil melhorado */
.profile-header {
  text-align: center;
  margin-bottom: 20px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(155, 126, 189, 0.15), rgba(107, 69, 51, 0.15));
  border-radius: 10px;
  border: 1px solid #9b7ebd;
}

.profile-header h2 {
  font-size: 2rem;
  color: var(--accent-soft);
  margin: 0 0 8px 0;
}

.profile-bio {
  color: var(--text-muted);
  font-style: italic;
  margin: 8px 0 0 0;
}

.profile-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 20px 0;
  padding: 20px;
  background: linear-gradient(135deg, rgba(107, 69, 51, 0.1), transparent);
  border-radius: 8px;
}

.stat {
  text-align: center;
  flex: 1;
  max-width: 120px;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent);
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Cartão de resenha individual */
.review-card {
  background: rgba(24, 17, 20, 0.5);
  border-left: 2px solid #9b7ebd;
  padding: 12px;
  margin: 10px 0;
  border-radius: 4px;
}

.review-card h4 {
  color: var(--accent-soft);
  margin: 0 0 4px 0;
  font-size: 1rem;
}

.review-card p {
  margin: 8px 0;
  color: var(--text-main);
  line-height: 1.5;
}

.review-card em {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Search input melhorado */
#search-users-input {
  background: linear-gradient(135deg, rgba(107, 69, 51, 0.2), rgba(155, 126, 189, 0.2));
  border: 1px solid #9b7ebd;
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

#search-users-input:focus {
  outline: none;
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(107, 69, 51, 0.3), rgba(155, 126, 189, 0.3));
}

#search-users-input::placeholder {
  color: var(--text-muted);
}

/* ======== Layout do APP após login ======== */
body.app-active {
  overflow-y: auto; /* permite scroll normal */
  display: block;   /* remove flex centralizado */
  height: auto;
}

body.app-active .container {
  display: block;     /* remove centralização */
  height: auto;
  padding-top: 140px; /* espaço para o header */
  width: 100%;
}

body.app-active #app-section {
  display: block !important;
  margin: 0 auto;
  max-width: 1200px;
  padding: 20px;
}
/* Apenas nas telas de login/cadastro */
body.app-active .container {
  display: block;
  height: auto;
  padding-top: 30px; /* bem menor e mais elegante */
  width: 100%;
}
body.auth-active {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}


/* === TESTE DE ATUALIZAÇÃO === */

