@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,400;0,9..144,700;1,9..144,300&family=Space+Grotesk:wght@300;400;500;600&family=JetBrains+Mono:wght@300;400&display=swap");

:root {
  --navy: #003049;
  --red: #d62828;
  --orange: #f77f00;
  --yellow: #fcbf49;
  --cream: #eae2b7;

  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 18px;
  --header-h: 62px;

  /* --font-display: "Fraunces", Georgia, serif;
  --font-body: "Space Mono", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace; */

  --font-display: "Sansation", sans-serif;
  --font-body: "Outfit", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px - 2px);
}

body {
  background: #001218;
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  min-height: 100vh;
  padding-top: calc(var(--header-h) + 56px);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--navy);
}
::-webkit-scrollbar-thumb {
  background: var(--orange);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--yellow);
}

/* ── HEADER ── */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background-color: var(--navy);
  border-bottom: 1px solid var(--orange);
  z-index: 900;
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 28px;
}

.header-nav {
  display: flex;
  gap: 12px;
  flex: 1;
  justify-content: center;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cream);
  text-decoration: none;
  padding: 8px 16px;
  border: 1px solid var(--navy);
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.nav-link:hover {
  color: var(--cream);
  border: 1px solid var(--orange);
}
.nav-link.active {
  border: 1px solid var(--orange);
  background-color: #001218;
}

/* ── BENTO ── */
.bento {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
  padding: 0 16px 56px;
  position: relative;
  z-index: 1;
}

/* ── CARD BASE ── */
.card {
  background: var(--navy);
  border: 1px solid var(--orange);
  border-radius: var(--radius-lg);
  padding: 32px;
  position: relative;
  overflow: hidden;
  opacity: 0;
  animation: fadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ── Section labels ── */
.section-label {
  margin-bottom: 24px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--cream);
  display: flex;
  align-items: center;
  gap: 12px;
}
.label-num {
  color: var(--orange);
  font-size: 0.9rem;
}
.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--b-orange), transparent);
}

/* ── Spans ── */
.c1 {
  grid-column: span 4;
}
.c3 {
  grid-column: span 3;
}
.c4 {
  grid-column: span 4;
}
.c5 {
  grid-column: span 5;
}
.c6 {
  grid-column: span 8;
}
.c7 {
  grid-column: span 12;
}
.c8 {
  grid-column: span 8;
}
.c9 {
  grid-column: span 9;
}
.c12 {
  grid-column: span 12;
}

@media (max-width: 900px) {
  .c1,
  .c3,
  .c4,
  .c5,
  .c6,
  .c7,
  .c8,
  .c9,
  .c12 {
    grid-column: span 12;
  }
  .nav-link {
    padding: 6px 10px;
    font-size: 0.8rem;
  }
}

/* ── HERO ── */
.hero {
  display: flex;
  align-items: center;
  justify-content: space-around;
  min-height: 280px;
  background: var(--navy);
  border: 1px solid var(--orange);
  position: relative;
  overflow: hidden;
  gap: 32px;
}

.hero img {
  width: 210px;
  height: auto;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: var(--radius);
  border: 1px solid var(--b-orange);
  grid-column: 1;
}

.hero-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cream);
  border: 1px solid var(--cream);
  display: inline-block;
  padding: 7px 16px;
  width: fit-content;
  border-radius: 20px;
  grid-column: 1;
}

.hero-info {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.02em;
  color: var(--cream);
  grid-column: 2;
  display: flex;
  flex-direction: column;
}

.hero .hero-info h1 {
  font-size: 4rem;
}

.hero .hero-info h1 span {
  color: var(--yellow);
  font-style: italic;
  font-weight: 400;
}

.hero-info .hero-sub {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--cream);
  margin-top: 16px;
  letter-spacing: 0.04em;
  line-height: 20px;
}

.hero-info .hero-sub span {
  color: var(--yellow);
}

/* A propos */

.about-card p {
  text-align: justify;
}

/* ── FORMATION ── */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-top: 8px;
}
.tl-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.tl-dot-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 6px;
}
.tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  background-color: var(--yellow);
}
.tl-line {
  width: 1px;
  flex: 1;
  min-height: 28px;
  background: var(--yellow);
  margin-top: 6px;
}
.tl-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--cream);
}
.tl-sub {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--cream);
  margin-top: 4px;
  letter-spacing: 0.04em;
}

/* ── COMPÉTENCES ── */
.skills-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 32px;
}
.category-header {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.category-header span {
  color: var(--yellow);
}
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.skill-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 37, 53, 0.7);
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--cream);
  transition: all 0.2s;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ── PROJETS ── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.project-card {
  background: rgba(0, 37, 53, 0.7);
  border: 1px solid var(--b-orange);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.project-screen {
  background: var(--bg);
  aspect-ratio: 16/9;
  overflow: hidden;
  border-bottom: 1px solid var(--b-orange);
}
.project-screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}
.project-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  flex: 1;
}
.project-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: -0.01em;
}
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ptag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--yellow);
  background: transparent;
  border: 1px solid var(--yellow);
  padding: 3px 10px;
  border-radius: 20px;
  letter-spacing: 0.05em;
}
.project-desc {
  font-size: 0.9rem;
  color: var(--cream);
  line-height: 1.65;
  flex: 1;
  /* text-align: justify; */
}
.project-links {
  display: flex;
  gap: 8px;
  margin-top: 4px;
  justify-content: space-between;
}
.plink {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--navy);
  background: var(--yellow);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.plink:hover {
  transform: translateY(-2px);
  background-color: #ffd580;
}
.plink-alt {
  background: transparent;
  color: var(--yellow);
  border: 1px solid var(--yellow);
}

.plink-alt:hover {
  background-color: #001218;
}

.external-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.plink:hover .external-icon {
  transform: translate(1px, -1px);
}

/* ── HAMBURGER MENU ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  margin-left: auto;
  border: 1px solid transparent;
}
.hamburger:hover {
  border: 1px solid var(--orange);
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--cream);
  border-radius: 2px;
  transition:
    transform 0.3s,
    opacity 0.3s;
}
.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── CONTACT ── */

.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 48px;
  align-items: start;
}
.contact-intro p {
  color: var(--cream);
  line-height: 1.75;
  margin-bottom: 28px;
  text-align: justify;
}
.contact-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.contact-social {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cream);
  text-decoration: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: rgba(0, 37, 53, 0.7);
  transition: all 0.2s;
}
.contact-social:hover {
  background: #001218;
  transform: translateX(2px);
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cream);
}
.form-input {
  background: rgba(0, 37, 53, 0.7);
  border: 1px solid var(--navy);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
  width: 100%;
}
.form-input::placeholder {
  color: rgba(234, 226, 183, 0.45);
}
.form-input:focus {
  background: #001218;
  border: 1px solid var(--yellow);
}
.form-textarea {
  resize: vertical;
  min-height: 130px;
  line-height: 1.6;
  max-height: 300px;
  overflow-y: auto;
}
.form-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-end;
  background: var(--yellow);
  color: var(--navy);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 13px 28px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}
.form-submit:hover {
  transform: translateY(-2px);
  background-color: #ffd580;
}

.form-submit svg {
  transition: all 0.2s ease;
}

.form-submit:hover svg {
  transform: translate(1px, -1px);
}

.footer {
  width: 100vw;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.footer-inner {
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid var(--orange);
  background-color: var(--navy);
}
.footer p {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cream);
  letter-spacing: 0.08em;
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.card:nth-child(1) {
  animation-delay: 0.05s;
}
.card:nth-child(2) {
  animation-delay: 0.1s;
}
.card:nth-child(3) {
  animation-delay: 0.2s;
}
.card:nth-child(4) {
  animation-delay: 0.25s;
}
.card:nth-child(5) {
  animation-delay: 0.3s;
}
.card:nth-child(6) {
  animation-delay: 0.35s;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .skills-wrapper {
    grid-template-columns: 1fr;
  }
  .about-card {
    flex-direction: column;
  }
  .hero {
    flex-direction: column;
    align-items: flex-start;
    min-height: unset;
    gap: 20px;
  }
  .hero img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    margin: 0 auto;
  }
  .hero-info {
    margin: 0 auto;
  }
  .hero .hero-info h1 {
    font-size: 2.8rem;
    text-align: center;
  }
  .hero a {
    margin: 0 auto;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .footer-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
    font-size: 0.6rem;
  }
  /* Hamburger */
  .hamburger {
    display: flex;
  }
  .header-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--navy);
    border-bottom: 1px solid var(--orange);
    flex-direction: column;
    padding: 12px 16px 20px;
    gap: 4px;
    z-index: 800;
  }
  .header-nav.open {
    display: flex;
  }
  .nav-link {
    padding: 10px 14px;
    font-size: 0.85rem;
    width: 100%;
  }
  /* Contact */
  .contact-wrapper {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .form-submit {
    align-self: stretch;
    justify-content: center;
  }
}

.w4rAnimated_checkmark svg {
  width: 100px;
  display: block;
  margin: 0 auto;
}
.w4rAnimated_checkmark .path {
  stroke-dasharray: 1000;
  stroke-dashoffset: 0;
}
.w4rAnimated_checkmark .path.circle {
  -webkit-animation: dash 0.9s ease-in-out;
  animation: dash 0.9s ease-in-out;
}
.w4rAnimated_checkmark .path.line {
  stroke-dashoffset: 1000;
  -webkit-animation: dash 0.9s 0.35s ease-in-out forwards;
  animation: dash 0.9s 0.35s ease-in-out forwards;
}
.w4rAnimated_checkmark .path.check {
  stroke-dashoffset: -100;
  -webkit-animation: dash-check 0.9s 0.35s ease-in-out forwards;
  animation: dash-check 0.9s 0.35s ease-in-out forwards;
}

@-webkit-keyframes dash {
  0% {
    stroke-dashoffset: 1000;
  }
  100% {
    stroke-dashoffset: 0;
  }
}
@keyframes dash {
  0% {
    stroke-dashoffset: 1000;
  }
  100% {
    stroke-dashoffset: 0;
  }
}
@-webkit-keyframes dash-check {
  0% {
    stroke-dashoffset: -100;
  }
  100% {
    stroke-dashoffset: 900;
  }
}
@keyframes dash-check {
  0% {
    stroke-dashoffset: -100;
  }
  100% {
    stroke-dashoffset: 900;
  }
}

/* ── MODAL ── */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 18, 24, 0.85);
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}
.modal-backdrop.open {
  display: flex;
}

.modal-backdrop.closing {
  animation: fadeOut 0.2s ease forwards;
}

.modal-backdrop.closing .modal-box {
  animation: slideDown 0.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}
@keyframes slideDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(20px);
    opacity: 0;
  }
}

.modal-box {
  background: var(--navy);
  border: 1px solid var(--orange);
  border-radius: var(--radius-lg) 0px 0px var(--radius-lg);
  max-width: 620px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.modal-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: #001c28;
  overflow: hidden;
}
.modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}
.modal-close {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1001;
  background: rgba(0, 18, 24, 0.7);
  border: 1px solid rgba(234, 226, 183, 0.2);
  border-radius: var(--radius-sm);
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--cream);
  font-size: 1.4rem;
  transition: all 0.2s;
}
.modal-close:hover {
  border-color: var(--orange);
}
.modal-body {
  padding: 28px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-top: 4px;
  text-align: center;
}
.modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.modal-tags .ptag {
  font-size: 0.75rem;
}
.modal-desc {
  font-size: 1rem;
  color: var(--cream);
  line-height: 1.75;
  text-align: justify;
}
.modal-footer {
  display: flex;
  gap: 10px;
  margin-top: 4px;
  align-self: flex-end;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Scrollbar custom dans le modal */
.modal-box::-webkit-scrollbar {
  width: 4px;
  height: 50%;
}
.modal-box::-webkit-scrollbar-track {
  background: transparent;
}
.modal-box::-webkit-scrollbar-thumb {
  background: var(--orange);
  border-radius: 0px;
}
.modal-box::-webkit-scrollbar-thumb:hover {
  background: var(--yellow);
}

/* ── CHATBOT WIDGET — Portfolio Rémi Coimbra ────────────────────────────── */

/* Bouton flottant */
#chatbot-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 1100;
  width: 56px;
  height: 56px;
  background: var(--yellow, #fcbf49);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
  transition:
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.2s;
}
#chatbot-toggle:hover {
  transform: scale(1.1);
  background: #ffd27a;
}
#chatbot-toggle svg {
  width: 26px;
  height: 26px;
  color: var(--navy, #003049);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#chatbot-toggle.open svg.icon-chat {
  display: none;
}
#chatbot-toggle:not(.open) svg.icon-close {
  display: none;
}

/* Bulle de notification */
#chatbot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  background: var(--red, #d62828);
  border-radius: 50%;
  border: 2px solid #001218;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

/* Panneau chatbot */
#chatbot-panel {
  position: fixed;
  bottom: 96px;
  right: 28px;
  z-index: 1099;
  width: 370px;
  max-width: calc(100vw - 40px);
  background: var(--navy, #003049);
  border: 1px solid var(--orange, #f77f00);
  border-radius: 18px 18px 4px 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(247, 127, 0, 0.15);
  transform: translateY(20px) scale(0.95);
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.25s ease;
}
#chatbot-panel.open {
  transform: translateY(0) scale(1);
  opacity: 1;
  pointer-events: all;
}

/* En-tête */
.cb-header {
  background: linear-gradient(135deg, #002035 0%, var(--navy, #003049) 100%);
  border-bottom: 1px solid rgba(247, 127, 0, 0.35);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.cb-avatar {
  width: 38px;
  height: 38px;
  background: var(--yellow, #fcbf49);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cb-avatar svg {
  width: 20px;
  height: 20px;
  color: var(--navy, #003049);
}
.cb-header-info {
  flex: 1;
}
.cb-name {
  font-family: var(--font-display, "Sansation", sans-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--cream, #eae2b7);
  line-height: 1.2;
}
.cb-status {
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  color: var(--yellow, #fcbf49);
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 5px;
}
.cb-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
  animation: blink-dot 2s infinite;
}
@keyframes blink-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

/* Zone messages */
.cb-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 340px;
  scroll-behavior: smooth;
}
.cb-messages::-webkit-scrollbar {
  width: 3px;
}
.cb-messages::-webkit-scrollbar-track {
  background: transparent;
}
.cb-messages::-webkit-scrollbar-thumb {
  background: var(--orange, #f77f00);
  border-radius: 99px;
}

/* Bulles */
.cb-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: msgIn 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.cb-msg.bot {
  align-self: flex-start;
}
.cb-msg.user {
  align-self: flex-end;
}

.cb-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-family: var(--font-body, "Outfit", sans-serif);
  font-size: 0.875rem;
  line-height: 1.6;
  word-break: break-word;
}
.cb-msg.bot .cb-bubble {
  background: rgba(0, 30, 48, 0.85);
  border: 1px solid rgba(247, 127, 0, 0.25);
  color: var(--cream, #eae2b7);
  border-radius: 4px 14px 14px 14px;
}
.cb-msg.user .cb-bubble {
  background: var(--yellow, #fcbf49);
  color: var(--navy, #003049);
  font-weight: 500;
  border-radius: 14px 4px 14px 14px;
}

/* Typage animé */
.cb-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: rgba(0, 30, 48, 0.85);
  border: 1px solid rgba(247, 127, 0, 0.25);
  border-radius: 4px 14px 14px 14px;
  width: fit-content;
}
.cb-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange, #f77f00);
  animation: typing-dot 1.2s infinite;
}
.cb-typing span:nth-child(2) {
  animation-delay: 0.2s;
}
.cb-typing span:nth-child(3) {
  animation-delay: 0.4s;
}
@keyframes typing-dot {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* Suggestions rapides */
.cb-suggestions {
  padding: 0 16px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cb-suggestion {
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  color: var(--yellow, #fcbf49);
  border: 1px solid rgba(252, 191, 73, 0.35);
  background: transparent;
  border-radius: 20px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.cb-suggestion:hover {
  background: rgba(252, 191, 73, 0.1);
  border-color: var(--yellow, #fcbf49);
  transform: translateY(-1px);
}

/* Zone de saisie */
.cb-input-area {
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(247, 127, 0, 0.25);
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
#chatbot-input {
  flex: 1;
  background: rgba(0, 20, 32, 0.8);
  border: 1px solid rgba(247, 127, 0, 0.3);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--cream, #eae2b7);
  font-family: var(--font-body, "Outfit", sans-serif);
  font-size: 0.875rem;
  resize: none;
  min-height: 42px;
  max-height: 100px;
  outline: none;
  transition: border-color 0.2s;
  line-height: 1.5;
}
#chatbot-input::placeholder {
  color: rgba(234, 226, 183, 0.35);
}
#chatbot-input:focus {
  border-color: var(--yellow, #fcbf49);
}
#chatbot-send {
  width: 42px;
  height: 42px;
  background: var(--yellow, #fcbf49);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
#chatbot-send:hover:not(:disabled) {
  background: #ffd27a;
  transform: translateY(-1px);
}
#chatbot-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
#chatbot-send svg {
  width: 18px;
  height: 18px;
  color: var(--navy, #003049);
}

/* Erreur */
.cb-error {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: var(--red, #d62828);
  text-align: center;
  padding: 4px 16px 8px;
}

@media (max-width: 480px) {
  #chatbot-panel {
    right: 12px;
    bottom: 88px;
    width: calc(100vw - 24px);
  }
  #chatbot-toggle {
    right: 16px;
    bottom: 20px;
  }
}
