/* =============================
   PALETA DE CORES (BASE)
============================= */
:root {
  --grafite: #2F2F2F;
  --cinza-medio: #4A4A4A;
  --cinza-suave: #C8C8C8;
  --bege: #EDE5D9;
  --caramelo: #DFA543;
  --caramelo-escuro: #B9802D;
  --white: #FFFFFF;
  --preto: #000000;
  
  /* Cores padrão (modo claro) */
  --bg: var(--white);
  --bg-secondary: var(--bege);
  --text: var(--grafite);
  --text-secondary: var(--cinza-medio);
  --card: var(--bege);
  --border: var(--cinza-suave);
  --button-bg: var(--caramelo);
  --button-text: var(--white);
}

/* =============================
   MODO ESCURO 
============================= */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--grafite);
    --bg-secondary: var(--cinza-medio);
    --text: var(--bege);
    --text-secondary: var(--cinza-suave);
    --card: var(--cinza-medio);
    --border: var(--cinza-suave);
    --button-bg: var(--caramelo);
    --button-text: var(--grafite);
  }
}

/* Modo claro forçado */
[data-theme="light"] {
  --bg: var(--white);
  --bg-secondary: var(--bege);
  --text: var(--grafite);
  --text-secondary: var(--cinza-medio);
  --card: var(--bege);
  --border: var(--cinza-suave);
  --button-bg: var(--caramelo);
  --button-text: var(--white);
}

/* Modo escuro forçado */
[data-theme="dark"] {
  --bg: var(--grafite);
  --bg-secondary: var(--cinza-medio);
  --text: var(--bege);
  --text-secondary: var(--cinza-suave);
  --card: var(--cinza-medio);
  --border: var(--cinza-suave);
  --button-bg: var(--caramelo);
  --button-text: var(--grafite);
}

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

/* ===== BODY ===== */
body {
  font-family: "Archivo", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ===== HEADER COM LOGO ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--bg-secondary);
  backdrop-filter: blur(10px);
  padding: 16px 48px;
  z-index: 1000;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s ease;
}

/* Botão Voltar */
.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 1.6rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
  background: transparent;
  border: 1px solid var(--border);
  font-family: "Archivo", sans-serif;
}

.back-btn:hover {
  background: rgba(223, 165, 67, 0.1);
  border-color: var(--caramelo);
  transform: translateX(-4px);
}

.back-icon {
  font-size: 2rem;
  line-height: 1;
  transition: transform 0.3s ease;
}

.back-btn:hover .back-icon {
  transform: translateX(-4px);
}

.back-text {
  font-size: 1.4rem;
}

/* Toggle de Tema */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.4rem;
  font-weight: 500;
  transition: all 0.3s ease;
  font-family: "Archivo", sans-serif;
}

.theme-toggle:hover {
  background: rgba(223, 165, 67, 0.1);
  border-color: var(--caramelo);
  transform: translateY(-2px);
}

.theme-icon {
  font-size: 2rem;
  line-height: 1;
  transition: transform 0.5s ease;
}

.theme-toggle:hover .theme-icon {
  transform: rotate(20deg);
}

.header .logo {
  height: 48px;
  transition: transform 0.3s ease;
}

.header .logo:hover {
  transform: scale(1.05);
}

/* ===== CONTAINER PRINCIPAL ===== */
.container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(223, 165, 67, 0.1);
  width: 100%;
  max-width: 480px;
  text-align: center;
  padding: 48px 32px;
  margin-top: 100px;
  font-family: "Archivo", sans-serif;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* ===== FOTO DE PERFIL ===== */
.photo {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 24px;
}

.photo img {
  position: absolute;
  top: 0;
  left: 0;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--caramelo);
  box-shadow: 0 8px 24px rgba(223, 165, 67, 0.3);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.photo img:hover {
  transform: scale(1.05);
}

/* Controle de visibilidade das fotos por tema */
/* Padrão: modo claro */
.photo-light {
  opacity: 1;
  z-index: 2;
}

.photo-dark {
  opacity: 0;
  z-index: 1;
}

/* Preferência do sistema - modo escuro */
@media (prefers-color-scheme: dark) {
  .photo-light {
    opacity: 0;
    z-index: 1;
  }
  
  .photo-dark {
    opacity: 1;
    z-index: 2;
  }
}

/* Modo claro forçado - sobrescreve tudo */
[data-theme="light"] .photo-light {
  opacity: 1 !important;
  z-index: 2 !important;
}

[data-theme="light"] .photo-dark {
  opacity: 0 !important;
  z-index: 1 !important;
}

/* Modo escuro forçado - sobrescreve tudo */
[data-theme="dark"] .photo-light {
  opacity: 0 !important;
  z-index: 1 !important;
}

[data-theme="dark"] .photo-dark {
  opacity: 1 !important;
  z-index: 2 !important;
}

/* ===== TÍTULOS ===== */
h1 {
  font-size: 3.2rem;
  font-weight: 600;
  margin: 16px 0 8px;
  color: var(--text);
  font-family: "Archivo", sans-serif;
  transition: color 0.3s ease;
}

h1 span {
  color: var(--caramelo);
}

h2 {
  font-size: 1.6rem;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 32px;
  font-family: "Archivo", sans-serif;
  transition: color 0.3s ease;
}

/* ===== BOTÕES COM GRADIENTE ===== */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--button-bg);
  color: var(--button-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.6rem;
  padding: 16px 24px;
  border-radius: 8px;
  margin: 12px 0;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  font-family: "Archivo", sans-serif;
}

.btn-icon {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}

/* Filtro para modo claro */
[data-theme="light"] .btn-icon {
  filter: brightness(0) invert(1);
}

/* Filtro para modo escuro */
[data-theme="dark"] .btn-icon {
  filter: brightness(0) saturate(100%) invert(18%) sepia(9%) saturate(415%) hue-rotate(358deg) brightness(95%) contrast(91%);
}

/* Preferência do sistema - modo escuro */
@media (prefers-color-scheme: dark) {
  .btn-icon {
    filter: brightness(0) saturate(100%) invert(18%) sepia(9%) saturate(415%) hue-rotate(358deg) brightness(95%) contrast(91%);
  }
}

/* Preferência do sistema - modo claro */
@media (prefers-color-scheme: light) {
  .btn-icon {
    filter: brightness(0) invert(1);
  }
}

.btn:hover .btn-icon {
  transform: scale(1.1);
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--caramelo-escuro);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.btn:hover::before {
  opacity: 0.2;
}

.btn span {
  position: relative;
  z-index: 1;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(223, 165, 67, 0.4);
}

.btn:active {
  transform: translateY(0);
}

/* ===== BOTÃO SECUNDÁRIO ===== */
.btn-secondary {
  background: transparent;
  border: 2px solid rgba(223, 165, 67, 0.3);
  color: var(--caramelo);
}

.btn-secondary::before {
  background: rgba(223, 165, 67, 0.1);
}

.btn-secondary:hover {
  border-color: var(--caramelo);
  color: var(--white);
}

/* ===== FOOTER ===== */
footer {
  font-size: 1.4rem;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 48px;
  transition: color 0.3s ease;
}

footer a {
  color: var(--caramelo);
  text-decoration: none;
  transition: color 0.3s ease;
}

footer a:hover {
  color: var(--caramelo-escuro);
}

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
  .header {
    padding: 12px 24px;
  }

  .header .logo {
    height: 40px;
  }

  .container {
    padding: 32px 24px;
    margin-top: 80px;
  }

  h1 {
    font-size: 2.4rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  .btn {
    font-size: 1.4rem;
    padding: 14px 20px;
  }

  .btn-icon {
    width: 20px;
    height: 20px;
  }

  footer {
    font-size: 1.2rem;
    padding: 0 16px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 56%;
  }

  .container {
    padding: 24px 16px;
  }

  .photo img {
    width: 120px;
    height: 120px;
  }

  h1 {
    font-size: 2rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  .btn {
    font-size: 1.2rem;
    padding: 12px 16px;
  }

  .btn-icon {
    width: 18px;
    height: 18px;
  }
}

/* ===== ANIMAÇÕES ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.container {
  animation: fadeIn 0.6s ease;
}

.btn {
  animation: fadeIn 0.8s ease;
  animation-fill-mode: both;
}

.btn:nth-child(1) { animation-delay: 0.1s; }
.btn:nth-child(2) { animation-delay: 0.2s; }
.btn:nth-child(3) { animation-delay: 0.3s; }
.btn:nth-child(4) { animation-delay: 0.4s; }
.btn:nth-child(5) { animation-delay: 0.5s; }
.btn:nth-child(6) { animation-delay: 0.6s; }

/* ===== ACESSIBILIDADE ===== */
.btn:focus,
.header a:focus,
.theme-toggle:focus {
  outline: 2px solid var(--caramelo);
  outline-offset: 4px;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
  .header {
    padding: 12px 24px;
  }

  .back-btn,
  .theme-toggle {
    font-size: 1.2rem;
    padding: 6px 12px;
  }

  .back-icon,
  .theme-icon {
    font-size: 1.6rem;
  }

  .back-text {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 10px 16px;
  }

  .back-btn,
  .theme-toggle {
    font-size: 1rem;
    padding: 6px 10px;
  }

  .back-text {
    display: none; /* Oculta o texto "Início" em telas muito pequenas */
  }

  .back-icon,
  .theme-icon {
    font-size: 1.4rem;
  }
}

/* ===== SELEÇÃO DE TEXTO ===== */
::selection {
  background-color: var(--caramelo);
  color: var(--white);
}

::-moz-selection {
  background-color: var(--caramelo);
  color: var(--white);
}

