@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700&display=swap");

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

body {
  font-family: "Sora", "Roboto", "Inter", "Segoe UI", Tahoma, Geneva, Verdana,
    sans-serif;
  height: 100vh;
  padding: 10px;
  overflow: hidden;

  background-color: #0a1933;
  background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg opacity='0.07'%3E%3Cpath d='M60 0L120 34.64V103.92L60 138.56L0 103.92V34.64L60 0Z' stroke='%23ffffff' stroke-width='1'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, #061760 0%, #0090da 50%, #3b74bb 100%);
  background-repeat: repeat, no-repeat;
  background-size: 120px 120px, cover;
  background-attachment: fixed, fixed;
}

.container {
  max-width: 1200px;
  height: calc(100vh - 20px);
  margin: 0 auto;
  background: white;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #0090da 0%, #3b74bb 50%, #0090da 100%);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    box-shadow: 0 0 5px rgba(0, 144, 218, 0.5);
  }
  to {
    box-shadow: 0 0 20px rgba(0, 144, 218, 0.8);
  }
}

header {
  position: relative;
  overflow: hidden;
  flex-shrink: 0;

  background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg opacity='0.05'%3E%3Cpath d='M60 0L120 34.64V103.92L60 138.56L0 103.92V34.64L60 0Z' stroke='%23ffffff' stroke-width='1'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(135deg, #061760 0%, #0050bd 100%);
  background-repeat: repeat, no-repeat;
  background-size: 120px 120px, cover;
  background-attachment: scroll, scroll;

  padding: 20px 20px 25px;
  text-align: center;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  color: #ffffff;
}

header .logo {
  height: 40px;
  width: auto;
}

header .company-name {
  font-size: 0.8rem;
  font-weight: 300;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.85;
  margin-top: 3px;
}

header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 10px;
  line-height: 1.3;
  color: #fefbff;
  text-shadow: 0 0 20px rgba(0, 186, 255, 0.3);
}

.language-selector {
  position: absolute;
  top: 20px;
  right: 20px;
}

.language-selector select {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fefbff;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.language-selector select:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: #00baff;
}

.language-selector select:focus {
  outline: none;
  border-color: #00baff;
  box-shadow: 0 0 0 2px rgba(0, 186, 255, 0.4);
}

.language-selector select option {
  background: #061760;
  color: #fefbff;
}

.calculator-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  gap: 0;
  flex: 1;
  overflow: hidden;
}

.inputs-section {
  padding: 20px;
  background: #f8f9fa;
  border-right: 1px solid #e9ecef;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
}

.outputs-section {
  padding: 20px 20px 10px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
}

.right-column {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.costs-section {
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  padding: 10px 20px 20px 20px;
  flex: 1;
  overflow-y: auto;
}

.costs-section h2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.costs-section h2 .budget-value {
  font-size: 1rem;
  font-weight: 600;
  color: #0090da;
  background: rgba(0, 144, 218, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
}

section h2 {
  color: #061760;
  margin-bottom: 15px;
  font-size: 1.2rem;
  font-weight: 600;
  border-bottom: 2px solid #0090da;
  padding-bottom: 6px;
}

.tooltip-icon {
  display: inline-block;
  margin-left: 8px;
  color: #0090da;
  font-size: 1rem;
  cursor: help;
  opacity: 0.7;
  transition: opacity 0.3s ease;
  position: relative;
  user-select: none;
}

.tooltip-icon:hover {
  opacity: 1;
}

.tooltip-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 130%;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: linear-gradient(135deg, #061760 0%, #0090da 100%);
  color: #fefbff;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: normal;
  max-width: 320px;
  min-width: 200px;
  text-align: center;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999999;
  box-shadow: 0 8px 24px rgba(6, 23, 96, 0.3), 0 0 0 1px rgba(0, 144, 218, 0.2);
  pointer-events: none;
  border: 1px solid rgba(0, 144, 218, 0.3);
}

.tooltip-icon::before {
  content: "";
  position: absolute;
  top: 120%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-bottom-color: #061760;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999999;
  pointer-events: none;
}

.tooltip-icon:hover::after,
.tooltip-icon:hover::before,
.tooltip-icon.tooltip-active::after,
.tooltip-icon.tooltip-active::before {
  opacity: 1;
  visibility: visible;
}

.tooltip-icon:hover::after,
.tooltip-icon.tooltip-active::after {
  transform: translateX(-50%) translateY(0);
}

.input-group {
  margin-bottom: 12px;
}

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

.checkbox-group-label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-weight: 500;
  font-size: 0.95rem;
}

.checkbox-options {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}

.checkbox-item {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 8px 12px;
  border: 2px solid #e9ecef;
  border-radius: 6px;
  background: #ffffff;
  transition: all 0.3s ease;
  user-select: none;
}

.checkbox-item:hover {
  border-color: rgba(0, 144, 218, 0.5);
  background: rgba(0, 144, 218, 0.05);
}

.checkbox-item input[type="checkbox"] {
  margin-right: 8px;
  width: 16px;
  height: 16px;
  accent-color: #0090da;
  cursor: pointer;
}

.checkbox-item input[type="checkbox"]:checked + .checkbox-text {
  color: #0090da;
  font-weight: 600;
}

.checkbox-item:has(input[type="checkbox"]:checked) {
  border-color: #0090da;
  background: rgba(0, 144, 218, 0.1);
}

.checkbox-text {
  font-size: 0.95rem;
  color: #555;
  transition: all 0.3s ease;
}

.inputs-content {
  flex: 1;
}

.outputs-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
}

.input-group label {
  display: block;
  margin-bottom: 6px;
  color: #555;
  font-weight: 500;
  font-size: 0.95rem;
}

.input-group {
  position: relative;
}

.input-group input {
  width: 100%;
  padding: 8px 10px;
  padding-right: 40px; /* Espaço para o adornment */
  border: 2px solid #e9ecef;
  border-radius: 6px;
  font-size: 14px;
  background: #ffffff;
  transition: all 0.3s ease;
}

.input-group::after {
  content: attr(data-adornment);
  position: absolute;
  right: 10px;
  top: calc(50% + 11px); /* Ajuste para centralizar verticalmente */
  transform: translateY(-50%);
  color: #6c757d;
  font-size: 14px;
  pointer-events: none;
}

.input-group input:hover {
  border-color: rgba(0, 144, 218, 0.5);
}

.input-group input:focus {
  outline: none;
  border-color: #0090da;
  box-shadow: 0 0 0 3px rgba(0, 144, 218, 0.2);
}

.input-group input.error {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

.error-message {
  color: #dc3545;
  font-size: 0.8rem;
  margin-top: 4px;
  font-weight: 500;
}

.output-value.partial,
.cost-value.partial {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.output-value.final,
.cost-value.final {
  opacity: 1;
}

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

.calculate-btn {
  flex: 1;
  padding: 12px;
  background: linear-gradient(135deg, #0090da 0%, #0050bd 100%);
  color: #fefbff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.calculate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 144, 218, 0.4);
  background: linear-gradient(135deg, #3b74bb 0%, #0090da 100%);
}

.calculate-btn:active {
  transform: translateY(0);
}

.reset-btn {
  width: 44px;
  height: 44px;
  padding: 8px;
  background: rgba(0, 144, 218, 0.1);
  color: #0090da;
  border: 2px solid #0091da7d;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reset-btn:hover {
  background: rgba(0, 144, 218, 0.2);
  border-color: #0090da;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 144, 218, 0.3);
}

.reset-btn:active {
  transform: translateY(0);
}

.reset-btn svg {
  width: 16px;
  height: 16px;
}

.reset-btn.reset-active {
  background: rgba(40, 86, 224, 0.3);
  border-color: #0090da;
  animation: spin 0.5s ease-in-out;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.reset-animation {
  animation: highlight 0.5s ease-in-out;
}

@keyframes highlight {
  0% {
    background-color: rgba(53, 86, 220, 0.1);
  }
  50% {
    background-color: rgba(53, 86, 220, 0.2);
  }
  100% {
    background-color: #ffffff;
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(3px);
  }
}

.shake-error {
  animation: shake 0.5s ease-in-out;
  border-color: #dc3545 !important;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2) !important;
}

.output-group,
.cost-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #e9ecef;
  transition: all 0.3s ease;
  min-height: 35px;
}

.output-group:hover,
.cost-item:hover {
  background: rgba(0, 144, 218, 0.05);
  border-radius: 6px;
  padding: 12px 8px;
}

.output-group:last-child,
.cost-item:last-child {
  border-bottom: none;
}

.output-group label,
.cost-item label {
  color: #555;
  font-weight: 500;
  font-size: 0.95rem;
}

.output-value,
.cost-value {
  font-weight: 600;
  color: #061760;
  font-size: 1rem;
}

.cost-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-top: 2px solid #0090da;
  margin-top: 15px;
  background: linear-gradient(
    90deg,
    rgba(0, 144, 218, 0.1) 0%,
    rgba(0, 144, 218, 0.05) 100%
  );
  border-radius: 8px;
}

.cost-total label {
  font-size: 1.1rem;
  font-weight: 700;
  color: #061760;
}

.cost-total .cost-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0090da;
  text-shadow: 0 0 10px rgba(0, 144, 218, 0.3);
}

.output-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-top: 2px solid #0090da;
  margin-top: 15px;
  background: linear-gradient(
    90deg,
    rgba(0, 144, 218, 0.1) 0%,
    rgba(0, 144, 218, 0.05) 100%
  );
  border-radius: 8px;
}

.output-total label {
  font-size: 1.1rem;
  font-weight: 700;
  color: #061760;
}

.output-total .output-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0090da;
  text-shadow: 0 0 10px rgba(0, 144, 218, 0.3);
}

@media (max-width: 1024px) {
  body {
    overflow: auto;
  }

  .container {
    height: auto;
    min-height: calc(100vh - 20px);
  }

  .calculator-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    overflow: visible;
  }

  .inputs-section {
    border-right: none;
    border-bottom: 1px solid #e9ecef;
    overflow-y: visible;
  }

  .right-column {
    overflow: visible;
  }

  .outputs-section,
  .costs-section {
    overflow-y: visible;
  }
}

@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  header {
    padding: 20px 15px 25px;
  }

  header .logo {
    font-size: 1.8rem;
  }

  header h1 {
    font-size: 1.4rem;
  }

  header .company-name {
    font-size: 0.75rem;
  }

  .language-selector {
    position: static;
    margin-top: 15px;
    text-align: center;
  }

  .inputs-section,
  .outputs-section,
  .costs-section {
    padding: 20px;
  }

  section h2 {
    font-size: 1.1rem;
    margin-bottom: 15px;
  }

  .input-group {
    margin-bottom: 15px;
  }

  .button-group {
    flex-direction: column;
    gap: 8px;
  }

  .calculate-btn {
    padding: 12px;
    font-size: 16px;
  }

  .reset-btn {
    width: 100%;
    height: 40px;
  }
}

@media (max-width: 768px) {
  .tooltip-icon::after {
    max-width: 250px;
    min-width: 180px;
    font-size: 0.8rem;
    padding: 10px 14px;
    left: auto;
    right: 0;
    transform: translateY(-10px);
    top: 130%;
  }

  .tooltip-icon::before {
    left: auto;
    right: 20px;
    transform: none;
    top: 120%;
  }

  .tooltip-icon:hover::after,
  .tooltip-icon.tooltip-active::after {
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  body {
    padding: 5px;
  }

  header {
    padding: 15px 10px 20px;
  }

  header .logo {
    font-size: 1.6rem;
  }

  header h1 {
    font-size: 1.2rem;
    margin-top: 8px;
  }

  header .company-name {
    font-size: 0.7rem;
  }

  .language-selector select {
    padding: 6px 10px;
    font-size: 12px;
  }

  .inputs-section,
  .outputs-section,
  .costs-section {
    padding: 15px;
  }

  section h2 {
    font-size: 1rem;
    margin-bottom: 12px;
  }

  .input-group,
  .checkbox-group {
    margin-bottom: 12px;
  }

  .checkbox-options {
    flex-direction: column;
    gap: 8px;
  }

  .checkbox-item {
    padding: 6px 10px;
  }

  .checkbox-text {
    font-size: 0.9rem;
  }

  .input-group label {
    font-size: 0.9rem;
    margin-bottom: 4px;
  }

  .input-group input {
    padding: 8px 10px;
    font-size: 14px;
  }

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

  .calculate-btn {
    padding: 10px;
    font-size: 14px;
  }

  .reset-btn {
    height: 36px;
  }

  .output-group,
  .cost-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 8px 0;
    min-height: auto;
  }

  .output-group label,
  .cost-item label {
    font-size: 0.9rem;
  }

  .output-value,
  .cost-value {
    font-size: 0.9rem;
  }

  .cost-total {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
  }

  .cost-total label {
    font-size: 1rem;
  }

  .cost-total .cost-value {
    font-size: 1.1rem;
  }

  .tooltip-icon::after {
    max-width: 220px;
    min-width: 160px;
    font-size: 0.75rem;
    padding: 8px 12px;
    top: 130%;
    left: auto;
    right: -10px;
    transform: translateY(-10px);
  }

  .tooltip-icon::before {
    top: 120%;
    left: auto;
    right: 10px;
    transform: none;
  }

  .tooltip-icon:hover::after,
  .tooltip-icon.tooltip-active::after {
    transform: translateY(0);
  }
}
