@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@100;200;300;400;500;600;700&display=swap');

/* ==========================================================
           1. DESIGN SYSTEM & TOKENS GLOBAIS
========================================================== */
:root {
   --off-white: #F5F1EB;
   --azul-marinho: #011E38;
   --azul-vibrante: #264FEC;
   --cinza-gelo: #E2E8F0;
   --branco: #FFFFFF;
}

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

body {
   font-family: 'IBM Plex Sans', sans-serif;
   background: var(--off-white);
   display: flex;
   flex-direction: column;
   height: 100vh;
   overflow: hidden;
}

/* ==========================================================
           2. COMPONENTES ESTRUTURAIS
========================================================== */
.main-header {
   min-height: 86px;
   background-color: var(--azul-marinho);
   display: flex;
   flex-direction: column;
   justify-content: center;
   align-items: start;
   padding: 10px 24px;
   gap: 4px;
   box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
   z-index: 10;
}

.header-title {
   font-size: 1.2rem;
   font-weight: 600;
   color: var(--branco);
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 8px;
   text-align: center;
}

.header-subtitle {
   font-size: 0.9rem;
   font-weight: 500;
   letter-spacing: 0.04em;
   text-transform: uppercase;
   color: rgba(255, 255, 255, 0.88);
   text-align: center;
}

.content-area {
   flex: 1;
   display: flex;
   justify-content: center;
   align-items: center;
   padding: 24px;
   background: radial-gradient(circle at top right, #FFFFFF, var(--off-white));
}

/* Container flexível que abrigará o widget centralizado */
.chat-widget-container {
   width: 100%;
   height: 100%;
   display: flex;
   align-items: center;
   justify-content: center;
   position: relative;
}

/* Estilos aplicados dinamicamente ao container da AWS depois do sequestro */
#amazon-connect-widget-frame {
   border-radius: 16px 16px 0px 0px;
   box-shadow: 0 12px 40px rgba(1, 30, 56, 0.15);
   overflow: hidden;
   background: var(--branco);
   transition: width 0.3s ease, height 0.3s ease;
   /* Animação suave no resize */
}

#amazon-connect-close-widget-button {
   display: none !important;
}

/* ==========================================================
           3. TELA DE OFFBOARDING (SAÍDA GRACIOSA)
           ========================================================== */
.offboarding-container {
   position: absolute;
   width: 100%;
   max-width: 450px;
   background: var(--branco);
   border-radius: 16px;
   box-shadow: 0 12px 40px rgba(1, 30, 56, 0.15);
   padding: 40px 32px;
   display: none;
   /* Escondido inicialmente */
   flex-direction: column;
   align-items: center;
   text-align: center;
   opacity: 0;
   transform: translateY(20px);
   transition: opacity 0.4s ease, transform 0.4s ease;
}

.offboarding-container.active {
   display: flex;
   opacity: 1;
   transform: translateY(0);
}

.offboarding-icon {
   font-size: 56px;
   color: var(--azul-vibrante);
   margin-bottom: 16px;
}

.offboarding-title {
   font-size: 1.5rem;
   color: var(--azul-marinho);
   font-weight: 600;
   margin-bottom: 12px;
}

.offboarding-text {
   font-size: 1rem;
   color: #666;
   margin-bottom: 32px;
   line-height: 1.5;
}

/* Links Úteis para desviar o tráfego */
.useful-links {
   display: flex;
   flex-direction: column;
   gap: 12px;
   width: 100%;
   margin-bottom: 32px;
}

.link-item {
   display: flex;
   align-items: center;
   justify-content: center;
   gap: 8px;
   padding: 14px;
   border-radius: 8px;
   background: var(--cinza-gelo);
   color: var(--azul-marinho);
   text-decoration: none;
   font-weight: 500;
   font-size: 0.95rem;
   transition: background 0.2s ease, transform 0.1s ease;
}

.link-item:hover {
   background: #d0d7e0;
}

.link-item:active {
   transform: scale(0.98);
}

/* Botão Primário */
.btn-primary {
   background: var(--azul-vibrante);
   color: var(--branco);
   border: none;
   padding: 14px 24px;
   border-radius: 24px;
   font-size: 1rem;
   font-weight: 600;
   width: 100%;
   cursor: pointer;
   transition: background 0.2s ease, transform 0.1s ease;
}

.btn-primary:hover {
   background: #1a3cb8;
}

.btn-primary:active {
   transform: scale(0.98);
}


@media screen and (max-width: 768px) {
   .main-header {
      min-height: 78px;
      padding: 8px 12px;
   }

   .header-title {
      font-size: 1.02rem;
      gap: 6px;
   }

   .header-subtitle {
      font-size: 0.78rem;
   }

   .content-area {
      padding: 0;
      background: var(--off-white);
   }

   #amazon-connect-widget-frame {
      border-radius: 0;
      box-shadow: none;
   }

   .offboarding-container {
      max-width: 100%;
      height: 100%;
      border-radius: 0;
      justify-content: center;
      box-shadow: none;
   }
}