/* ==========================================================
   Formulário "Vamos conversar?" — Sizebay
   Fonte: Figma "Redesign Site" — Desktop 1368:3341 / Mobile 1382:3419
   ========================================================== */

:root {
  /* Cores (tokens do Figma) */
  --sb-text: #434a50;                       /* Título / Parágrafo */
  --sb-text-80: rgba(67, 74, 80, 0.8);      /* Subtítulo, "+55" */
  --sb-text-40: rgba(67, 74, 80, 0.4);      /* Placeholder */
  --sb-white-50: #ffffff;                   /* branco-50 */
  --sb-white-100: #f0f4f7;                  /* branco-100 */
  --sb-white-200: #dde7ee;                  /* branco-200 */
  --sb-blue-50: #e6f4ff;                    /* azul-50 */
  --sb-blue-200: #a8d8fa;                   /* azul-200 */
  --sb-blue-400: #5eafe8;                   /* azul-400 (borda dos inputs) */
  --sb-blue-500: #4299d7;                   /* azul-500 */
  --sb-purple-600: #786faf;                 /* roxo-600 (botão) */
  --sb-divider: #d6d9db;
  --sb-error: #d64545;

  --sb-font: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
  --sb-radius-input: 8px;
}

/* ---------- Bootstrap Offcanvas integration ---------- */
.signup-offcanvas.offcanvas {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  z-index: 1055 !important;
  background: rgba(20, 30, 40, 0.5) !important;
  border: 0 !important;
  transform: none !important;
  transition: opacity 0.25s ease-in-out, visibility 0.25s ease-in-out !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.signup-offcanvas.offcanvas.show {
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

body.sb-lock {
  overflow: hidden;
}

/* ---------- Moldura azul (Forms Desk - Compacto para Notebooks) ---------- */
.sb-modal {
  position: relative;
  box-sizing: border-box;
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 920px;
  margin: auto;
  padding: 12px;
  border-radius: 28px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(255, 255, 255, 0.9) 0%, rgba(255, 255, 255, 0) 45%),
    linear-gradient(-37deg, #dbeefc 0%, var(--sb-blue-50) 100%);
  font-family: var(--sb-font);
  color: var(--sb-text);
  transition: max-width 0.3s ease;
}
.sb-modal *, .sb-modal *::before, .sb-modal *::after {
  box-sizing: border-box;
}

/* ---------- Layout após envio (Sucesso) ---------- */
.sb-modal.is-submitted {
  max-width: 500px !important;
}
.sb-modal.is-submitted .sb-media {
  display: none !important;
}
.sb-modal.is-submitted .sb-text-block {
  display: none !important;
}

.sb-success-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 16px;
  gap: 12px;
}

.sb-success-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sb-blue-50);
  border-radius: 50%;
  margin-bottom: 4px;
}

.sb-success-title {
  margin: 0;
  font-family: var(--sb-font) !important;
  font-size: 26px !important;
  font-weight: 600 !important;
  color: var(--sb-text) !important;
  line-height: 1.3 !important;
}

.sb-success-text {
  margin: 0;
  font-family: var(--sb-font) !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  color: var(--sb-text-80) !important;
  line-height: 1.5 !important;
  max-width: 380px;
}

/* ---------- Coluna do formulário ---------- */
.sb-form-col {
  position: relative !important;
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 20px 26px;
  border-radius: 20px;
  background: var(--sb-white-50);
}

.sb-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
}
.sb-logo {
  display: block;
  width: 124px;
  height: 32px;
  object-fit: contain;
}

.sb-close {
  position: absolute !important;
  top: 20px !important;
  right: 20px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  border: 1px solid var(--sb-white-200) !important;
  border-radius: 54px !important;
  background: var(--sb-white-100) !important;
  cursor: pointer !important;
  transition: background-color .15s;
  z-index: 99999 !important;
}
.sb-close:hover {
  background: var(--sb-white-200) !important;
}
.sb-close img {
  display: block !important;
  width: 12px !important;
  height: 12px !important;
}

.sb-text-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sb-title {
  margin: 0;
  font-family: var(--sb-font) !important;
  font-size: 30px !important;          /* H2 compact para notebooks */
  font-weight: 600 !important;
  line-height: 1.2 !important;
  color: var(--sb-text) !important;
}
.sb-subtitle {
  margin: 0;
  max-width: 400px;
  font-family: var(--sb-font) !important;
  font-size: 15px !important;          /* Body/L compact */
  font-weight: 400 !important;
  line-height: 1.4 !important;
  color: var(--sb-text-80) !important;
}

/* ---------- Campos ---------- */
.sb-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 0;
}
.sb-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sb-row {
  display: flex;
  gap: 12px;
}
.sb-row > .sb-field {
  flex: 1 1 0;
  min-width: 0;
}

.sb-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sb-label {
  font-family: var(--sb-font);
  font-size: 15px;          /* Body/M */
  font-weight: 400;
  line-height: 1.3;
  color: var(--sb-text);
  margin-bottom: 0;
}

.sb-control {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px;
  padding: 4px 14px;
  border: 1px solid var(--sb-blue-400);
  border-radius: var(--sb-radius-input);
  background: var(--sb-white-50);
  transition: border-color .15s, box-shadow .15s;
}
.sb-control:focus-within,
.sb-control.is-open {
  border-color: var(--sb-blue-500);
  box-shadow: 0 0 0 3px rgba(94, 175, 232, 0.25);
}

.sb-input,
.sb-select {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  font-family: var(--sb-font) !important;
  font-size: 15px !important;
  line-height: 1.4 !important;
  color: var(--sb-text) !important;
  box-shadow: none !important;
}
.sb-input::placeholder {
  color: var(--sb-text-40) !important;
  opacity: 1;
}

/* Telefone */
.sb-phone {
  gap: 10px;
}
.sb-flag {
  display: block;
  flex-shrink: 0;
  width: 24px;
  height: 16px;
  object-fit: contain;
}
.sb-ddi {
  flex-shrink: 0;
  font-family: var(--sb-font);
  font-size: 15px;
  color: var(--sb-text-80);
}
.sb-divider {
  flex-shrink: 0;
  width: 1px;
  height: 22px;
  background: var(--sb-divider);
}

/* Select */
.sb-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 32px !important;
  cursor: pointer;
}
.sb-select:invalid,
.sb-select-trigger.is-placeholder {
  color: var(--sb-text-40) !important;
}
.sb-select option {
  font-family: var(--sb-font);
  font-size: 14px;
  color: var(--sb-text);
  background-color: #ffffff;
  padding: 8px 12px;
}
.sb-chevron {
  position: absolute;
  top: 50%;
  right: 14px;
  display: block;
  width: 15px;
  height: 15px;
  transform: translateY(-50%) rotate(90deg);
  transition: transform 0.2s ease;
  pointer-events: none;
}
.sb-control.is-open .sb-chevron {
  transform: translateY(-50%) rotate(-90deg);
}

/* ---------- Styled Custom Dropdown Menu (Abre para CIMA) ---------- */
.sb-custom-select-wrapper {
  cursor: pointer;
  user-select: none;
}

.sb-select-trigger {
  flex: 1 1 auto;
  width: 100%;
  font-family: var(--sb-font);
  font-size: 15px;
  line-height: 1.4;
  color: var(--sb-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-dropdown-menu {
  position: absolute;
  top: auto !important;
  bottom: calc(100% + 6px) !important;
  left: -1px;
  right: -1px;
  background: #ffffff;
  border: 1px solid var(--sb-blue-400);
  border-radius: 8px;
  box-shadow: 0 -8px 24px rgba(67, 74, 80, 0.15);
  z-index: 100;
  overflow: hidden;
  padding: 4px 0;
  display: none;
}
.sb-control.is-open .sb-dropdown-menu {
  display: block;
}

.sb-dropdown-option {
  padding: 10px 14px;
  font-family: var(--sb-font);
  font-size: 14px;
  color: var(--sb-text);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.sb-dropdown-option:hover,
.sb-dropdown-option.is-selected {
  background-color: var(--sb-blue-50);
  color: var(--sb-blue-500);
  font-weight: 500;
}

/* Erro */
.sb-field.is-invalid .sb-control {
  border-color: var(--sb-error);
}
.sb-field.is-invalid .sb-control:focus-within {
  box-shadow: 0 0 0 3px rgba(214, 69, 69, 0.2);
}
.sb-error {
  display: none;
  margin: -2px 0 0;
  font-family: var(--sb-font);
  font-size: 12px;
  line-height: 1.3;
  color: var(--sb-error);
}
.sb-field.is-invalid .sb-error {
  display: block;
}

/* Botão */
.sb-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 32px;
  height: 46px;
  border: 0;
  border-radius: 8px;
  background: var(--sb-purple-600);
  font-family: var(--sb-font) !important;
  font-size: 15px !important;          /* Button */
  font-weight: 500 !important;
  line-height: 1.2 !important;
  color: var(--sb-white-50) !important;
  cursor: pointer;
  transition: filter .15s, opacity .15s;
}
.sb-button:hover {
  filter: brightness(0.94);
}
.sb-button:disabled {
  opacity: .6;
  cursor: wait;
}

.sb-success {
  margin: 0;
  font-family: var(--sb-font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--sb-text);
  padding: 14px 0;
  text-align: center;
}

/* ---------- Coluna da imagem (Desktop - Proporcional para Notebook) ---------- */
.sb-media {
  position: relative;
  flex: 0 0 340px;
  max-width: 340px;
  min-width: 0;
  overflow: hidden;
  border-radius: 24px;
  background: radial-gradient(ellipse at 100% 0%,
    #6f91b5 0%, #55799f 28%, #2f5a82 58%, #123f66 82%, #082f50 100%);
}
.sb-media__model {
  position: absolute;
  top: 2.5%;
  left: 50%;
  width: 118%;
  height: auto;
  max-width: none;
  transform: translateX(-50%);
  pointer-events: none;
  user-select: none;
}

/* ---------- Notebooks / Telas de Baixa Altura ---------- */
@media (min-width: 1025px) and (max-height: 800px) {
  .sb-modal {
    max-width: 900px !important;
    padding: 12px !important;
    gap: 12px !important;
  }
  .sb-form-col {
    padding: 20px 24px !important;
    gap: 14px !important;
  }
  .sb-title {
    font-size: 26px !important;
  }
  .sb-subtitle {
    font-size: 14px !important;
  }
  .sb-form {
    gap: 14px !important;
  }
  .sb-fields {
    gap: 10px !important;
  }
  .sb-control {
    height: 40px !important;
    padding: 4px 12px !important;
  }
  .sb-button {
    height: 42px !important;
    padding: 10px 24px !important;
    font-size: 14px !important;
  }
  .sb-media {
    flex: 0 0 300px !important;
    max-width: 300px !important;
  }
}

/* ---------- Tablet: some a imagem ---------- */
@media (max-width: 1024px) {
  .sb-modal {
    max-width: 580px;
  }
  .sb-media {
    display: none;
  }
}

/* ---------- Mobile Ultra Compacto (Tela Única Sem Scroll) ---------- */
@media (max-width: 767px) {
  .signup-offcanvas.offcanvas {
    padding: 0 !important;
    background: var(--sb-white-50) !important;
    align-items: stretch;
  }
  .sb-modal {
    max-width: none;
    height: 100%;
    min-height: 100dvh;
    padding: 0;
    border-radius: 0;
    background: var(--sb-white-50);
  }
  .sb-form-col {
    gap: 8px;
    padding: 16px 20px;
    padding-top: max(24px, calc(env(safe-area-inset-top, 0px) + 20px));
    padding-bottom: max(24px, env(safe-area-inset-bottom, 16px));
    border-radius: 0;
    justify-content: flex-start;
    height: 100dvh;
    box-sizing: border-box;
  }
  .sb-header {
    display: block !important;
    position: static;
    margin: 0;
  }
  .sb-logo, .sb-subtitle {
    display: none !important;
  }
  .sb-close {
    position: absolute !important;
    top: max(20px, calc(env(safe-area-inset-top, 0px) + 16px)) !important;
    right: 18px !important;
    display: flex !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 54px !important;
    background: var(--sb-white-100) !important;
    border: 1px solid var(--sb-white-200) !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 99999 !important;
  }
  .sb-text-block {
    gap: 2px;
    margin-bottom: 4px;
    padding-right: 36px;
  }
  .sb-title {
    font-size: 22px !important;
    line-height: 1.2 !important;
    margin-top: 0 !important;
  }
  .sb-form {
    gap: 10px;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }
  .sb-fields {
    gap: 6px;
  }
  .sb-row {
    gap: 6px;
    flex-direction: column;
  }
  .sb-field {
    gap: 2px;
  }
  .sb-label {
    font-size: 13px !important;
    line-height: 1.2;
  }
  .sb-control {
    height: 38px !important;
    padding: 2px 12px;
  }
  .sb-input, .sb-select, .sb-select-trigger {
    font-size: 13px !important;
  }
  .sb-button {
    padding: 10px 20px;
    height: 42px;
    font-size: 14px !important;
    margin-top: 8px;
  }
}
