/* FONTES */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@100..900&display=swap');

@font-face {
  font-family: 'Nohemi';
  src: url('./fontes/Nohemi-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Nohemi';
  src: url('./fontes/Nohemi-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
}

/* RESET E BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

:root {
  --primary: #2563eb;
  --primary-light: #e0e7ff;
  --secondary: #f8fafc;
  --accent: #6366f1;
  --gray: #6b7280;
  --radius: 18px;
  --shadow: 0 8px 32px rgba(37, 99, 235, 0.10);
  font-family: 'Segoe UI', Inter, Arial, sans-serif;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  width: 100vw;
  background: linear-gradient(180deg, #7b91c7 0%, #e6eaff 40%, #fff 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}



/* Menu hamburguer */
.menu-toggle {
  display: none;
}

.mobile-menu {
  display: none;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 1001;
  width: 30px;
  height: 30px;
}

.hamburger span {
  height: 3px;
  width: 24px;
  background: white;
  margin: 3px 0;
  border-radius: 2px;
  transition: all 0.3s;
}

.mobile-nav {
  display: none;
  position: absolute;
  top: 60px;
  right: 20px;
  background: rgba(123, 145, 199, 0.98);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  flex-direction: column;
  gap: 16px;
  z-index: 1000;
  min-width: 220px;
}

.menu-toggle:checked~.mobile-nav {
  display: flex;
}

.mobile-nav a {
  color: white;
  font-size: 16px;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.2s;
}

.mobile-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Botões de autenticação no menu mobile */
.mobile-auth-buttons {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.mobile-auth-buttons button {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  border: none;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.mobile-entrar {
  background: #6d7dfc;
  color: white;
  border: 1.5px solid white;
}

.mobile-entrar:hover {
  background: white;
  color: #7b91c7;
}

.mobile-criar-conta {
  background: white;
  color: #7b91c7;
}

.mobile-criar-conta:hover {
  background: #6d7dfc;
  color: white;
}

/* CHAT STYLE */
#chat-container {
  position: fixed;
  top: 70px;
  left: 0;
  width: 100vw;
  height: calc(100vh - 70px);
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

#chat-card {
  width: 100vw;
  height: 100%;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#messages {
  flex: 1;
  width: 100vw;
  max-width: 900px;
  margin: 0 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding: 36px 0 18px 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  font-size: 1.08em;
}

.msg {
  margin-bottom: 18px;
  padding: 18px 28px;
  border-radius: 16px;
  background: #fff;
  color: #222;
  max-width: 70%;
  font-size: 1.08em;
  box-shadow: 0 1px 8px rgba(16, 24, 40, 0.06);
  transition: background 0.2s;
  word-break: break-word;
}

.from-user {
  background: var(--primary);
  color: #fff;
  text-align: right;
  margin-left: auto;
  border-bottom-right-radius: 8px;
}

.from-agent {
  background: #e0e7ef;
  color: #222;
  text-align: left;
  margin-right: auto;
  border-bottom-left-radius: 8px;
}

.meta {
  font-size: 0.85em;
  color: #8b95a5;
  margin-top: 10px;
}

#input-area {
  width: 100vw;
  max-width: 900px;
  margin: 0 auto 24px auto;
  padding: 0 0 0 0;
  background: transparent;
  border-top: none;
  display: flex;
  gap: 12px;
  align-items: center;
}

#inputMsg {
  flex: 1;
  padding: 18px 20px;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  font-size: 1.08em;
  background: #fff;
  outline: none;
  transition: border 0.2s;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.06);
}

#inputMsg:focus {
  border-color: var(--primary);
  background: #f0f6ff;
}

#btnSend {
  padding: 16px 32px;
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  font-size: 1.08em;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(91, 141, 247, 0.08);
}

#btnSend:hover,
#btnSend:focus {
  background: #1746a2;
}

/* HEADER DINAMICO - deu certo no teste, entao manter e dar uma melhorada,
pra depois ser implementado em todas as paginas de forma funcional */

.usuario-logado {
  display: flex;
  align-items: center;
  gap: 10px;
}

.usuario-perfil-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 6px 12px 6px 6px;
  border-radius: 100px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.2s, border-color 0.2s;
}

.usuario-perfil-link:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.6);
}

/* avatar circular com inicial */
.header-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #6d7dfc;
  border: 2px solid #fff;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.header-avatar-inicial {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.header-avatar-sm {
  width: 28px;
  height: 28px;
}

.usuario-nome {
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

.btn-sair {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 100px;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: #000;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.btn-sair:hover {
  background: #6d7dfc;
  border-color: #6d7dfc;
  color: #fff;
}

/* RESPONSIVIDADE */
@media (max-width: 767px) {
  header {
    padding: 16px 20px;
  }

  .logo img {
    height: 36px;
  }

  .desktop-nav,
  .auth-buttons {
    display: none;
  }

  .mobile-menu {
    display: block;
  }

  .hamburger {
    display: flex;
  }

  #chat-container {
    top: 60px;
    height: calc(100vh - 60px);
  }

  #messages,
  #input-area {
    max-width: 100vw;
    padding-left: 8px;
    padding-right: 8px;
  }

  #messages {
    padding: 24px 8px 12px 8px;
  }

  .msg {
    padding: 14px 16px;
    font-size: 0.95em;
    max-width: 85%;
  }

  #input-area {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    padding: 0 12px;
  }

  #inputMsg {
    width: 100%;
    padding: 14px 16px;
    font-size: 1em;
  }

  #btnSend {
    width: 100%;
    padding: 14px 24px;
    font-size: 1em;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  header {
    padding: 10px 20px;
  }

  .logo img {
    height: 32px;
  }

  .desktop-nav,
  .auth-buttons {
    display: none !important;
  }

  .mobile-menu {
    display: block !important;
  }

  .hamburger {
    display: flex !important;
  }

  #chat-container {
    top: 50px;
    height: calc(100vh - 50px);
  }

  #messages {
    padding: 16px 12px 8px 12px;
  }

  .msg {
    padding: 10px 14px;
    font-size: 0.9em;
    margin-bottom: 12px;
    max-width: 70%;
  }

  #input-area {
    margin-bottom: 12px;
    padding: 0 12px;
    gap: 8px;
  }

  #inputMsg {
    padding: 12px 16px;
    font-size: 0.95em;
  }

  #btnSend {
    padding: 12px 24px;
    font-size: 0.95em;
  }
}

@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  header {
    padding: 20px 30px;
  }

  .desktop-nav,
  .auth-buttons {
    display: none;
  }

  .mobile-menu {
    display: block;
  }

  .hamburger {
    display: flex;
  }

  #messages,
  #input-area {
    max-width: 90vw;
    padding-left: 5vw;
    padding-right: 5vw;
  }

  .msg {
    max-width: 75%;
    font-size: 1.05em;
  }

  #input-area {
    gap: 12px;
  }
}

@media (min-width: 768px) and (max-width: 1279px) and (orientation: landscape) {
  header {
    padding: 18px 24px;
  }

  .logo img {
    height: 38px;
  }

  .desktop-nav {
    display: flex;
    gap: 2.5rem;
  }

  .desktop-nav a {
    font-size: 14px;
    padding: 6px 0;
  }

  .auth-buttons {
    display: flex;
  }

  .auth-buttons button {
    padding: 10px 18px;
    font-size: 14px;
    margin-left: 8px;
  }

  .mobile-menu,
  .hamburger {
    display: none;
  }

  #chat-container {
    top: 65px;
    height: calc(100vh - 65px);
  }

  #messages,
  #input-area {
    max-width: 85vw;
  }

  .msg {
    max-width: 70%;
    font-size: 1.05em;
  }

  #input-area {
    gap: 12px;
    margin-bottom: 20px;
  }
}

@media (min-width: 1024px) and (max-width: 1279px) and (orientation: landscape) {
  .desktop-nav {
    gap: 3.5rem;
  }

  .desktop-nav a {
    font-size: 15px;
  }

  .auth-buttons button {
    padding: 11px 20px;
    font-size: 15px;
  }

  #messages,
  #input-area {
    max-width: 800px;
  }
}

@media (min-width: 1280px) {
  .mobile-menu,
  .hamburger {
    display: none;
  }

  .desktop-nav,
  .auth-buttons {
    display: flex;
  }
}

@media (min-width: 1000px) {
  #messages,
  #input-area {
    max-width: 900px;
  }
}

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

  .logo img {
    height: 32px;
  }

  #messages {
    padding: 20px 8px 10px 8px;
  }

  .msg {
    padding: 12px 14px;
    font-size: 0.9em;
    max-width: 90%;
  }

  #input-area {
    padding: 0 8px;
    margin-bottom: 12px;
  }

  #inputMsg {
    padding: 12px 14px;
    font-size: 0.95em;
  }

  #btnSend {
    padding: 12px 20px;
    font-size: 0.95em;
  }
}