/* General Styling */
body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
}

.background-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 0;
  background-image: url('images/background.jpg');
  background-size: cover; /* Ensure the image covers the entire container */
  background-repeat: no-repeat; /* Prevent the image from repeating */
  background-position: center; /* Center the image */
  padding: 20px;
  box-sizing: border-box;
}

.container {
  display: flex;
  flex-direction: row;
  background-color: #f3f3f3;
  max-width: 100vw;
  min-height: 0;
  height: auto;
}

/* Left Part */
.left {
  flex: 3;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-right: 1px solid #ddd;
}

.title-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.image-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.title-image {
  width: 150px;
  max-width: 100%;
  border-radius: 5px;
}

.left h1 {
  font-size: 2rem;
  margin: 0;
}

.left h4 {
  font-size: 1rem;
  font-weight: 400;
  color: #555;
}

.left p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #555;
  text-align: justify;
}

/* Right Part */
.right {
  flex: 7;
  display: flex;
  flex-direction: column;
  padding: 20px;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.title {
  display: flex;
  flex-direction: column;
  text-align: center;
  justify-content: center;
  align-items: center;
}

.right h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.tbs-subtitle {
  font-size: 0.9rem;
  font-weight: normal;
  color: #666;
  margin-bottom: 15px;
}

.inputs-row,
.inputs-row-diabetes {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center; 
}


.inputs-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  width: 100%;
}

.inputs-row-primary,
.inputs-row-secondary {
  flex-wrap: nowrap;
}

.inputs-row .input-group {
  flex: 0 0 auto;
}

.inputs-row select.select-input {
  width: 150px;
  height: 38px;
  padding: 8px 30px 8px 10px;
  border: 2px solid #007bff;
  border-radius: 8px;
  background-color: #f8f9fa;
  font-size: 1rem;
  color: #333;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007bff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px auto;
}

.inputs-row input,
.inputs-row-diabetes input {
  width: 150px;
  padding: 8px;
  font-size: 1rem;
  border: 2px solid #007bff;
  border-radius: 8px;
  text-align: center;
  background-color: #f8f9fa;
  color: #333;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.inputs-row-diabetes input {
  width: 40%;
}

.inputs-row input:focus,
.inputs-row-diabetes input:focus {
  border-color: #0056b3;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

.inputs-row input::-webkit-inner-spin-button,
.inputs-row input::-webkit-outer-spin-button,
.inputs-row-diabetes input::-webkit-inner-spin-button,
.inputs-row-diabetes input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.inputs-row input[type="number"],
.inputs-row-diabetes input[type="number"] {
  -moz-appearance: textfield;
}

.text-blocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  width: 100%;
  margin-bottom: 10px;
}

.text-block {
  display: flex;
  flex-direction: column;
  text-align: center;
  justify-content: center;
  align-items: center;
}

.text-block select {
  padding: 8px 30px 8px 10px;
  border: 2px solid #007bff;
  border-radius: 8px;
  background-color: #f8f9fa;
  font-size: 1rem;
  width: 100%;
  color: #333;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007bff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px auto;
  height: 38px;
}

.text-block select:focus {
  border-color: #0056b3;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

/* TBS Page dropdown styles to match App.js */
.tbs-page .input-group select {
  width: 150px; /* Match other input widths */
  padding: 8px 30px 8px 10px; /* Match input padding, add space for arrow */
  height: 38px; /* Match input height */
  border: 2px solid #007bff;
  border-radius: 8px;
  background-color: #f8f9fa;
  font-size: 1rem;
  color: #333;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23007bff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px auto;
}

.tbs-page .input-group select:invalid {
  color: #6c757d; /* Cor do placeholder */
}

.tbs-page .input-group select option:first-child {
  color: #6c757d; /* Cor do placeholder para a primeira opção */
}

.tbs-page .input-group select option:not(:first-child) {
  color: #333; /* Cor do texto normal para as outras opções */
}

.tbs-page .input-group select:focus {
  border-color: #0056b3;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
  color: #333; /* Garante que o texto fique escuro quando selecionado */
  outline: none;
}

/* Ensure consistent width for all inputs and select */
.tbs-page .input-group input,
.tbs-page .input-group select {
  min-width: 100px;
  box-sizing: border-box;
}

.calc-result {
  font-size: 0.9rem;
  color: #333;
  font-weight: bold;
  margin-top: 5px;
}

/* Result Card */
.result-div {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.result-card {
  background-color: #e9ecef;
  padding: 10px;
  border-radius: 8px;
  text-align: center;
  font-size: 1rem;
  font-weight: bold;
  width: 100%;
}

.calculate-button {
  color: white;
  background-color: #007bff;
  border: none;
}

.calculate-button,
.reset-button {
  padding: 10px 20px;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 150px;
  height: 45px;
  text-align: center;
}


.calculate-button:hover {
  background-color: #0056b3;
}

.button-group {
  display: flex;
  gap: 10px;
}

.reset-button {
  color: #007bff; 
  background-color: transparent;
  border: 2px solid #007bff;
}

.reset-button:hover {
  background-color: rgba(0, 123, 255, 0.1);
}


/* Media Queries for Responsiveness */
@media screen and (max-width: 1024px) {
  .container {
    flex-direction: column;
    height: auto;
  }

  .left {
    border-right: none;
    border-bottom: 1px solid #ddd;
  }
}

@media screen and (max-width: 768px) {
  .inputs-row {
    flex-direction: column;
    gap: 10px;
  }

  .text-blocks-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .left h1 {
    font-size: 1.8rem;
  }

  .left h4 {
    font-size: 1rem;
  }

  .result-div {
    width: 90%;
  }
}

@media screen and (max-width: 480px) {
  .left h1 {
    font-size: 1.5rem;
  }

  .left h4 {
    font-size: 0.9rem;
  }

  .left p {
    font-size: 0.8rem;
  }

  .calculate-button {
    font-size: 1rem;
    padding: 8px 16px;
  }
}

.checkbox-group {
  display: flex;
  justify-content: center;
  margin: 10px 0;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  color: #333;
}

.checkbox-group input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #007bff;
  cursor: pointer;
}

.two-line {
  /* set a max-width so the browser will wrap at that point: */
  max-width: 20ch;          
  /* allow wrapping at spaces: */
  word-wrap: break-word;   
}
@media (max-width: 620px) {
  .inputs-row-primary, .inputs-row-secondary { flex-wrap: wrap; }
}

/* Sprint 03 — adequação responsiva do módulo de ajustes/TBS */
@media (max-width: 1100px) {
  body { font-family: "Open Sans", Arial, sans-serif; background: #fff; }
  .background-container { padding: 0; background: #fff; }
  .container { flex-direction: column; width: 100%; max-width: 100%; background: #fff; }
  .left { display: none; }
  .right { width: 100%; padding: 16px 12px 24px; gap: 16px; }
  .right h2 { color: #1c2b6d; font-size: 22px; line-height: 1.25; }
  .tbs-subtitle { font-size: 14px; line-height: 1.5; }
  .inputs-layout { gap: 14px; }
  .inputs-row-primary,
  .inputs-row-secondary,
  .inputs-row,
  .inputs-row-diabetes {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .inputs-row .input-group,
  .inputs-row input,
  .inputs-row select.select-input,
  .inputs-row-diabetes input,
  .tbs-page .input-group select {
    width: 100% !important;
    min-height: 46px;
    font-size: 16px;
  }
  .text-blocks-grid { grid-template-columns: 1fr; gap: 12px; }
  .text-block select { min-height: 46px; font-size: 16px; }
  button { min-height: 48px; border-radius: 8px; font-size: 16px; }
}

/* Sprint 03 v11 — primeira adequação visual da calculadora para smartphones */
@media (max-width: 1100px) {
  html, body, #root {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: transparent;
  }

  body,
  button,
  input,
  select {
    font-family: "Open Sans", Arial, sans-serif;
  }

  .background-container {
    width: 100%;
    padding: 0;
    background: transparent;
  }

  .container.tbs-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    background: #fff;
  }

  .right {
    width: 100%;
    padding: 30px 20px 34px;
    gap: 20px;
    box-sizing: border-box;
  }

  .title {
    width: 100%;
  }

  .right h2 {
    margin: 0 0 8px;
    color: #1c2b6d;
    font-size: 24px;
    line-height: 1.22;
    font-weight: 700;
  }

  .tbs-subtitle {
    max-width: 330px;
    margin: 0;
    color: #666;
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
  }

  .inputs-layout {
    width: 100%;
    gap: 12px;
  }

  .inputs-row-primary,
  .inputs-row-secondary,
  .inputs-row,
  .inputs-row-diabetes {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .input-group,
  .inputs-row .input-group {
    width: 100%;
  }

  .inputs-row input,
  .inputs-row select.select-input,
  .inputs-row-diabetes input,
  .tbs-page .input-group select,
  .text-block select {
    width: 100% !important;
    min-width: 0 !important;
    height: 48px;
    min-height: 48px;
    padding: 10px 40px 10px 14px;
    border: 2px solid #15a7e0;
    border-radius: 6px;
    background-color: #fff;
    color: #555;
    font-size: 16px;
    line-height: 1.2;
    box-sizing: border-box;
  }

  .inputs-row input,
  .inputs-row-diabetes input {
    padding-right: 14px;
    text-align: center;
  }

  .inputs-row input:focus,
  .inputs-row select:focus,
  .inputs-row-diabetes input:focus,
  .text-block select:focus,
  .tbs-page .input-group select:focus {
    border-color: #20409a;
    box-shadow: 0 0 0 3px rgba(21, 167, 224, .14);
    outline: none;
  }

  .checkbox-group {
    width: 100%;
    margin: 2px 0 4px;
  }

  .checkbox-group label {
    color: #555;
    font-size: 14px;
  }

  .checkbox-group input[type="checkbox"] {
    width: 20px;
    height: 20px;
  }

  .text-blocks-grid {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    margin: 2px 0 0;
  }

  .text-block {
    width: 100%;
    padding: 20px 0;
    border-bottom: 1px solid rgba(28, 43, 109, .12);
    text-align: center;
    align-items: stretch;
  }

  .text-block:last-child {
    border-bottom: 0;
  }

  .text-block .text {
    margin: 0 0 12px;
    color: #1c2b6d;
    font-size: 20px;
    line-height: 1.25;
    font-weight: 700;
    text-align: center;
  }

  .text-block .two-line,
  .two-line {
    max-width: none;
  }

  .text-block p,
  .text-block small {
    line-height: 1.45;
  }

  .inputs-row-diabetes {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .calc-result {
    min-height: 20px;
    margin-top: 8px;
    color: #1c2b6d;
    font-size: 14px;
    line-height: 1.4;
  }

  .result-div {
    width: 100%;
    max-width: none;
    gap: 14px;
  }

  .result-card {
    width: 100%;
    padding: 16px;
    border-radius: 6px;
    background: #edf8fc;
    color: #1c2b6d;
    font-size: 15px;
    line-height: 1.45;
    box-sizing: border-box;
  }

  .button-group {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .calculate-button,
  .reset-button {
    width: 100%;
    height: 50px;
    min-height: 50px;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    box-sizing: border-box;
  }

  .calculate-button {
    border: 0;
    background: linear-gradient(90deg, #2946a5 0%, #08a8df 100%);
    color: #fff;
  }

  .reset-button {
    border: 2px solid #2946a5;
    background: #fff;
    color: #2946a5;
  }
}


/* Sprint 03 v12 — refinamento da introdução e dos campos da calculadora */
@media (max-width: 1100px) {
  .container.tbs-page {
    display: flex;
    flex-direction: column;
  }

  /* Introdução mobile — Etapa 1 */
  .left {
    display: flex !important;
    width: 100%;
    padding: 28px 22px 20px;
    border: 0;
    background: #fff;
    box-sizing: border-box;
    justify-content: flex-start;
    gap: 0;
  }

  .left::before {
    content: "ETAPA 1";
    display: block;
    margin-bottom: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid #1c2b6d;
    color: #0097db;
    font-size: 18px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: .04em;
  }

  .left .image-container { display: none !important; }
  .left .title-container { gap: 0; }
  .left .title-text h3 {
    margin: 10px 0 14px;
    color: #1c2b6d;
    font-size: 24px;
    line-height: 1.45;
    font-weight: 700;
  }
  .left .title-text h4 {
    margin: 0 0 30px;
    color: #1c2b6d;
    font-size: 17px;
    line-height: 1.55;
    font-weight: 400;
  }
  .left > p {
    margin: 0 0 20px;
    color: #1c2b6d;
    font-size: 14px;
    line-height: 1.62;
    text-align: left;
  }
  .left > p:last-child { margin-bottom: 0; }

  .right {
    padding-top: 24px;
  }

  .right > .title {
    padding-top: 22px;
    border-top: 1px solid rgba(48,48,48,.25);
  }

  .tbs-subtitle {
    margin-bottom: 28px !important;
    color: #1c2b6d;
    font-size: 15px;
  }

  .inputs-layout,
  .inputs-row-primary,
  .inputs-row-secondary {
    gap: 18px !important;
  }

  .inputs-row input,
  .inputs-row select.select-input,
  .inputs-row-diabetes input,
  .tbs-page .input-group select,
  .text-block select {
    height: 48px;
    min-height: 48px;
    border: 1px solid rgba(0,151,219,.36) !important;
    border-radius: 8px;
    background-color: #fff;
    color: #777;
    font-size: 18px !important;
  }

  .inputs-row select.select-input,
  .tbs-page .input-group select,
  .text-block select {
    padding-right: 44px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%230097DB' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 14px center !important;
    background-size: 20px 20px !important;
  }

  .checkbox-group { margin-top: 12px; }

  .text-block {
    padding: 22px 0 24px;
  }
  .text-block .text {
    margin-bottom: 8px !important;
  }
  .text-block .text h2 {
    margin: 0 0 4px !important;
    color: #1c2b6d;
    font-size: 22px !important;
    line-height: 1.25;
    font-weight: 700;
  }
  .text-block .text p {
    margin: 0 0 10px !important;
    color: #303030 !important;
    font-size: 16px !important;
    line-height: 1.42 !important;
    font-weight: 400 !important;
  }
  .text-block select,
  .text-block .inputs-row-diabetes {
    margin-top: 0 !important;
  }

  /* Diabetes e TBS: campos em uma coluna */
  .inputs-row-diabetes {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 18px !important;
    width: 100%;
  }

  .calc-result { margin-top: 8px; }
  .result-div { margin-top: 10px; }
}


/* Sprint 03 v13 — refinamentos finais da primeira área da calculadora */
@media (max-width: 1100px) {
  /* Subtítulos em uma linha sempre que houver largura disponível */
  .text-block .text p {
    white-space: nowrap;
  }

  /* Valor de faixa etária */
  .result-card p:last-child {
    font-size: 18px;
  }

  /* Ritmo vertical do rodapé da calculadora */
  .result-div {
    gap: 0;
    margin-top: 18px;
  }

  .button-group {
    margin-top: 26px;
    gap: 16px;
  }

  .reset-button {
    border-width: 1px !important;
  }

  .button-group {
    margin-bottom: 4px;
  }

  .right {
    padding-bottom: 10px;
  }
}

/* Sprint 03 v14 — contenção de largura e refinamento do rodapé da calculadora */
@media (max-width: 1100px) {
  html,
  body,
  #root,
  .background-container,
  .container.tbs-page,
  .right {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow-x: hidden !important;
  }

  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  .right > *,
  .title,
  .inputs-layout,
  .inputs-row,
  .inputs-row-primary,
  .inputs-row-secondary,
  .inputs-row-diabetes,
  .text-blocks-grid,
  .text-block,
  .text-block .text,
  .result-div,
  .result-card,
  .button-group {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .text-block .text h2,
  .text-block .text p {
    max-width: 100% !important;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  /* Remove a regra global de nowrap que causava estouro horizontal. */
  .text-block .text p {
    white-space: normal !important;
  }

  /* Mantém em uma linha apenas os subtítulos curtos solicitados. */
  .text-block:nth-child(1) .text p,
  .text-block:nth-child(2) .text p,
  .text-block:nth-child(5) .text p {
    white-space: nowrap !important;
    font-size: 16px !important;
  }

  .inputs-row input,
  .inputs-row select.select-input,
  .inputs-row-diabetes input,
  .tbs-page .input-group select,
  .text-block select {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  /* Mais respiro antes e entre os botões. */
  .button-group {
    margin-top: 34px !important;
    gap: 22px !important;
    margin-bottom: 0 !important;
  }

  /* Evita espaço interno artificial após o botão Limpar. */
  .right {
    padding-bottom: 2px !important;
  }

  .reset-button {
    margin-bottom: 0 !important;
  }
}

/* Sprint 03 v15 — microespaçamentos do rodapé da calculadora */
@media (max-width: 1100px) {
  /* Aproxima o valor da legenda "Idades válidas". */
  .result-card p {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }

  .result-card p:first-child {
    margin-bottom: 3px !important;
  }

  /* Amplia os respiros solicitados antes e entre os botões. */
  .button-group {
    margin-top: 44px !important;
    gap: 26px !important;
    margin-bottom: 0 !important;
  }

  /* Remove sobra interna depois do botão Limpar. */
  .right {
    padding-bottom: 0 !important;
  }

  .result-div,
  .reset-button {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
}

/* Sprint 03 v17 — ajuste seguro dos botões, preservando a base estável v15 */
@media (max-width: 1100px) {
  /* Mais espaço entre os botões, sem alterar a estrutura do formulário. */
  .button-group {
    gap: 34px !important;
    margin-bottom: 0 !important;
  }

  /* Centraliza vertical e horizontalmente o texto do botão Limpar. */
  .reset-button {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }
}


/* Sprint 06 v04 — tablet keeps the homologated mobile calculator flow. */
@media (min-width: 768px) and (max-width: 1100px) {
  html, body, #root, #root * { font-family: "Open Sans", Arial, sans-serif !important; box-sizing: border-box; }
  html, body, #root { width: 100% !important; min-width: 0 !important; overflow-x: hidden !important; }
  input, select, textarea, button { font-family: "Open Sans", Arial, sans-serif !important; }
}

/* Sprint 06 v05 — remove a sobra inferior da calculadora no tablet. */
@media (min-width: 768px) and (max-width: 1100px) {
  html,
  body,
  #root,
  .background-container,
  .container.tbs-page {
    min-height: 0 !important;
    height: auto !important;
  }

  .background-container {
    padding-bottom: 8px !important;
  }

  .container.tbs-page,
  .right {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }

  .button-group,
  .reset-button,
  .result-div {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
}


html.frax-desktop-real .left::before {
  display: none !important;
  content: none !important;
}

/* Desktop real — restaura somente as duas linhas de campos */
html.frax-desktop-real .inputs-row-primary,
html.frax-desktop-real .inputs-row-secondary {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 15px !important;
  width: 100% !important;
  grid-template-columns: none !important;
}

html.frax-desktop-real .inputs-row-primary .input-group,
html.frax-desktop-real .inputs-row-secondary .input-group {
  width: auto !important;
  flex: 0 0 auto !important;
}

html.frax-desktop-real .inputs-row-primary input,
html.frax-desktop-real .inputs-row-secondary input,
html.frax-desktop-real .inputs-row-secondary select.select-input {
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
}

/* Desktop real — restaura a grade homologada dos 6 blocos */
html.frax-desktop-real .text-blocks-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
}

/* Desktop real — campos duplos de Diabetes e TBS lado a lado */
html.frax-desktop-real .inputs-row-diabetes {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  justify-content: center !important;
  gap: 10px !important;
  width: 100% !important;
  grid-template-columns: none !important;
}

html.frax-desktop-real .inputs-row-diabetes input {
  width: calc(50% - 5px) !important;
  min-width: 0 !important;
  max-width: none !important;
  flex: 0 0 calc(50% - 5px) !important;
}

/* Desktop real — restaura identidade visual homologada */
html.frax-desktop-real body,
html.frax-desktop-real button,
html.frax-desktop-real input,
html.frax-desktop-real select,
html.frax-desktop-real textarea {
  font-family: 'Inter', sans-serif !important;
}

/* Desktop real — restaura logo ABRASSO da calculadora */
html.frax-desktop-real .left .image-container {
  display: flex !important;
}

/* Desktop real — restaura botões homologados lado a lado */
html.frax-desktop-real .button-group {
  display: flex !important;
  grid-template-columns: none !important;
  width: auto !important;
  gap: 10px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

html.frax-desktop-real .calculate-button,
html.frax-desktop-real .reset-button {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}

/* Desktop real — força a tipografia original acima da regra mobile #root * */
html.frax-desktop-real #root,
html.frax-desktop-real #root * {
  font-family: 'Inter', sans-serif !important;
}

/* =========================================================
   DESKTOP REAL — acabamento fiel ao layout homologado
   ========================================================= */

/* Título principal */
html.frax-desktop-real .title-text h3 {
  color: #111 !important;
  font-size: 16px !important;
  line-height: 1.25 !important;
  font-weight: 700 !important;
}

/* Texto introdutório */
html.frax-desktop-real .title-text h4,
html.frax-desktop-real .title-text p {
  color: #666 !important;
}

/* Título da calculadora */
html.frax-desktop-real .right h2 {
  color: #111 !important;
}

/* Títulos dos 6 blocos */
html.frax-desktop-real .text-block .text h2 {
  color: #111 !important;
}

/* Textos explicativos dos blocos */
html.frax-desktop-real .text-block .text p {
  color: #222 !important;
}

/* Resultados FOM / FQ */
html.frax-desktop-real .text-block .result-div,
html.frax-desktop-real .result-card {
  color: #222 !important;
}

/* Campos — aparência do desktop homologado */
html.frax-desktop-real .inputs-row input,
html.frax-desktop-real .inputs-row select.select-input,
html.frax-desktop-real .inputs-row-diabetes input,
html.frax-desktop-real .text-block select {
  border: 2px solid #007bff !important;
  border-radius: 8px !important;
}

/* Remove os fios horizontais entre os 6 blocos */
html.frax-desktop-real .text-block {
  border-bottom: 0 !important;
  border-top: 0 !important;
}

/* Compacta levemente a área inferior */
html.frax-desktop-real .text-blocks-grid {
  row-gap: 10px !important;
}

html.frax-desktop-real .result-div {
  margin-bottom: 0 !important;
}

html.frax-desktop-real .button-group {
  margin-top: 18px !important;
}

/* =========================================================
   DESKTOP REAL — refinamentos finais de homologação
   ========================================================= */

/* Título principal: um pouco maior */
html.frax-desktop-real .title-text h3 {
  font-size: 18px !important;
  line-height: 1.3 !important;
}

/* Todo o texto introdutório no mesmo cinza */
html.frax-desktop-real .title-text h4,
html.frax-desktop-real .title-text p {
  color: #666 !important;
}

/* Campos mais baixos, próximos do desktop original */
html.frax-desktop-real .inputs-row input,
html.frax-desktop-real .inputs-row select.select-input,
html.frax-desktop-real .inputs-row-diabetes input,
html.frax-desktop-real .text-block select {
  height: 38px !important;
  min-height: 38px !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}

/* Aproxima a área "Idades válidas" dos blocos acima */
html.frax-desktop-real .result-div {
  margin-top: 10px !important;
}

html.frax-desktop-real .right {
  padding-bottom: 0 !important;
}

/* Botões menores, como no desktop original */
html.frax-desktop-real .button-group {
  margin-top: 10px !important;
  gap: 10px !important;
}

html.frax-desktop-real .calculate-button,
html.frax-desktop-real .reset-button {
  width: 110px !important;
  min-width: 110px !important;
  height: 38px !important;
  min-height: 38px !important;
  padding: 6px 12px !important;
  font-size: 14px !important;
  line-height: 1 !important;
}

/* =========================================================
   DESKTOP REAL — microajustes finais
   ========================================================= */

/* Título principal ligeiramente maior */
html.frax-desktop-real .title-text h3 {
  font-size: 20px !important;
}

/* Placeholder dos campos um pouco menor */
html.frax-desktop-real input::placeholder {
  font-size: 15px !important;
}

/* Texto inicial dos selects */
html.frax-desktop-real select {
  font-size: 15px !important;
}

/* Botões: ligeiramente mais largos e texto maior */
html.frax-desktop-real .calculate-button,
html.frax-desktop-real .reset-button {
  width: 125px !important;
  min-width: 125px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
}

/* Fabricante e Sexo — texto ligeiramente menor */
html.frax-desktop-real .inputs-row select {
  font-size: 15px !important;
}

