:root {
  --azul: #0d6bff;
  --roxo: #7b3fff;
  --cinza: #f6f7fb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', Arial, sans-serif;
  background: #f6f7fb;
  color: #1d1d1f;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #e3e3e3;
  background: #fff;
}

.logo {
  height: 46px;
  width: auto;
}

.logo-small {
  height: 32px;
  width: auto;
  vertical-align: middle;
}

.brand {
  font-weight: 700;
  font-size: 16px;
  color: #111827;
}

.back-wrap {
  display: flex;
  justify-content: center;
  padding: 14px 20px;
}

.btn-back {
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(90deg, #0057ff, #7b3fff);
  box-shadow: 0 6px 18px rgba(10, 70, 180, 0.18);
  display: inline-block;
}

.footer {
  border-top: 1px solid #e3e3e3;
  padding: 14px 20px;
  text-align: center;
  font-weight: 600;
  color: #111827;
  background: #fff;
}

/* Index */
.hero {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  min-height: calc(100vh - 170px);
}

.card {
  width: 100%;
  max-width: 880px;
  background: #ffffff;
  border: 1px solid #e7e9f1;
  border-radius: 22px;
  box-shadow: 0 14px 45px rgba(40, 60, 140, 0.12);
  padding: 40px;
  text-align: center;
}

h1 {
  margin: 10px 0 6px;
  font-size: 28px;
  color: #111827;
}

.subtitle {
  margin: 0 0 22px;
  color: #4b5563;
  font-weight: 500;
}

.intro {
  font-size: 17px;
  color: #1f2937;
  margin-bottom: 30px;
}

.menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.menu a {
  text-decoration: none;
  padding: 16px 18px;
  border-radius: 16px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(90deg, var(--azul), var(--roxo));
  box-shadow: 0 10px 25px rgba(10, 70, 180, 0.18);
  transition: transform 0.15s, box-shadow 0.15s;
}

.menu a:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(10, 70, 180, 0.25);
}

.menu a:active {
  transform: translateY(0);
}

@media (max-width: 640px) {
  .card { padding: 26px; }
  h1 { font-size: 24px; }
}

/* Chat */
#chatbox {
  width: 100%;
  max-width: 700px;
  height: 600px;
  margin: 20px auto 40px;
  background: #ffffff;
  border-radius: 22px;
  border: 1px solid #e3e3e3;
  box-shadow: 0 10px 35px rgba(70, 80, 120, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background: linear-gradient(180deg, #ffffff 0%, #f7f9ff 100%);
}

.message {
  margin-bottom: 14px;
  line-height: 1.4;
  font-size: 16px;
  max-width: 85%;
}

.user {
  color: #ffffff;
  background: #0057ff;
  padding: 10px 14px;
  border-radius: 14px;
  margin-left: auto;
  text-align: left;
  box-shadow: 0 3px 10px rgba(0, 87, 255, 0.25);
}

.bot {
  color: #ffffff;
  background: #7b3fff;
  padding: 10px 14px;
  border-radius: 14px;
  margin-right: auto;
  box-shadow: 0 3px 10px rgba(123, 63, 255, 0.25);
}

#inputArea {
  display: flex;
  border-top: 1px solid #e3e3e3;
  background: #ffffff;
  padding: 10px;
}

#inputArea input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid #cdd3e1;
  border-radius: 14px;
  outline: none;
  font-size: 16px;
  transition: 0.2s;
}

#inputArea input:focus {
  border-color: #7b3fff;
  box-shadow: 0 0 0 3px rgba(123, 63, 255, 0.2);
}

#inputArea button {
  margin-left: 10px;
  background: linear-gradient(90deg, #0057ff, #7b3fff);
  color: white;
  border: none;
  padding: 12px 18px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: 0.2s;
}

#inputArea button:hover {
  filter: brightness(1.08);
  box-shadow: 0 3px 12px rgba(0, 87, 255, 0.35);
}

@media (max-width: 768px) {
  #chatbox {
    height: 85vh;
    margin: 20px;
    border-radius: 18px;
  }

  #messages {
    padding: 14px;
  }

  #inputArea input {
    padding: 10px 12px;
    font-size: 15px;
  }

  #inputArea button {
    padding: 10px 14px;
    font-size: 14px;
  }
}

/* Voice & Video containers */
#container {
  max-width: 900px;
  margin: 40px auto;
  background: #ffffff;
  padding: 36px;
  border-radius: 22px;
  box-shadow: 0 12px 40px rgba(90, 70, 200, 0.14);
  text-align: center;
  border: 1px solid #e7e9f1;
}

/* Voice specifics */
#micBtn {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: linear-gradient(90deg, #0057ff, #7b3fff);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 25px auto;
  box-shadow: 0 5px 20px rgba(0,87,255,0.35);
  transition: 0.25s;
  position: relative;
}

#micBtn.active {
  transform: scale(1.08);
  box-shadow: 0 0 30px rgba(123,63,255,0.55);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0px rgba(123,63,255,0.0);
  }
  50% {
    transform: scale(1.09);
    box-shadow: 0 0 25px rgba(123,63,255,0.45);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0px rgba(123,63,255,0.0);
  }
}

#micBtn::before,
#micBtn::after {
  content: "";
  position: absolute;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  border: 3px solid rgba(123,63,255,0.35);
  opacity: 0;
}

#micBtn.active::before { animation: wave1 1.8s infinite; }
#micBtn.active::after { animation: wave2 1.8s infinite; }

@keyframes wave1 {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.7); opacity: 0; }
}

@keyframes wave2 {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(2); opacity: 0; }
}

#micBtn img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  filter: brightness(1.07);
}

#status {
  margin-top: 15px;
  font-size: 18px;
  color: #333;
}

#logBox {
  margin-top: 20px;
  background: #eef1ff;
  border-radius: 14px;
  padding: 18px;
  text-align: left;
  font-size: 15px;
  max-height: 250px;
  overflow: auto;
}

/* Video specifics */
.placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  background: linear-gradient(135deg, #0057ff, #7b3fff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 22px;
  box-shadow: inset 0 0 0 4px rgba(255,255,255,0.2);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.placeholder span { pointer-events: none; }

/* Modal simples */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal.hidden { display: none; }

.modal-box {
  background: #fff;
  padding: 22px;
  border-radius: 16px;
  box-shadow: 0 16px 45px rgba(20, 30, 70, 0.25);
  max-width: 360px;
  width: 90%;
  text-align: center;
}

.modal-box h3 {
  margin: 0 0 10px;
  color: #111827;
}

.modal-box p {
  margin: 0 0 16px;
  color: #374151;
}

.modal-close {
  border: none;
  background: linear-gradient(90deg, #0057ff, #7b3fff);
  color: #fff;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}
