/* Traffic Insurance Calculator Styles */

.tic__header {
  padding: 16px 18px 0;
}

.tic__title {
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 22px;
}

.tic p:empty {
  display: none;
}

.tic__form {
  padding: 0 0 16px;
}

.tic__input_help {
  display: block;
  font-size: 14px;
  color: #7b7b7b;
  margin-top: 4px;
  line-height: 1.25;
}

.tic__rows {
  width: 100%;
}

.tic__row {
  display: grid;
  grid-template-columns: 30% 70%;
  align-items: center;
}

.tic__row.is-hidden {
  display: none;
}

.tic__cell {
  padding: 14px 16px;
}

.tic__cell--label {
  font-weight: 600;
  font-size: 16px;
}

.tic__label {
  display: inline-block;
  margin: 0;
}

.tic__select {
  width: 100% !important;
  height: 50px !important;
  font-size: 16px !important;
  margin-bottom: 0 !important;
  background-position: calc(100% - 24px) !important;
}

.tic__select:not(:invalid) {
  color: #000 !important;
}

/* Radio group styles */
.tic__radio-group {
  display: flex;
  flex-direction: row;
  gap: 24px;
}

.tic__radio {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  margin: 0;
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  background: #fff;
  width: 100%;
  line-height: 1.25;
}

.tic__radio input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.tic__radio span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.tic__radio span::before {
  content: '';
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  border-radius: 50%;
  border: 2px solid #cfcfcf;
  background: #fff;
  box-sizing: border-box;
}

.tic__radio input:checked + span::before {
  border-color: var(--color-primary);
  box-shadow: inset 0 0 0 4px var(--color-primary);
}

.tic__radio input:checked + span {
  font-weight: 600;
}

/* Actions */
.tic__actions button[type="submit"] {
  width: 200px;
  max-width: 50%;
}

.tic__actions button[type="submit"]:disabled {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  opacity: 0.6;
  cursor: not-allowed;
}

/* Error message */
.tic__error {
  font-size: 14px;
  font-weight: 600;
  border-radius: 0.375rem;
  padding: 1rem 2rem;
  color: #e0242f;
  background: #fc5c6524;
}

.tic__error.is-hidden {
  display: none;
}

/* Loading state */
.tic__loading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #f0f7ff;
  border-radius: 6px;
  color: #1e40af;
  font-size: 14px;
}

.tic__loading::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid #1e40af;
  border-top-color: transparent;
  border-radius: 50%;
  animation: tic-spin 0.8s linear infinite;
}

@keyframes tic-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Result panel */
.tic__result {
  border: 2px solid #f0f0f0;
  border-radius: 8px;
  background: #fafafa;
}

.tic__result .widget-title {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e0e0e0;
}

.tic__result-inner {
  padding: 0;
}

/* Result summary */
.tic__result-summary {
  padding: 16px 20px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  margin-bottom: 8px;
}

.tic__result-summary-item {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
}

.tic__result-summary-label {
  color: #666;
}

.tic__result-summary-value {
  font-weight: 600;
  color: #333;
}

/* Result title */
.tic__result-prices-title {
  padding: 16px 20px 8px;
  font-weight: 700;
  font-size: 16px;
  color: #333;
}

/* Result list */
.tic__result-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tic__result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #e8e8e8;
}

.tic__result-item:last-child {
  border-bottom: none;
}

.tic__result-item--discount {
  background: linear-gradient(90deg, #e8f5e9 0%, #fff 100%);
}

.tic__result-item--standard {
  background: linear-gradient(90deg, #e3f2fd 0%, #fff 100%);
  border-left: 3px solid #2196f3;
}

.tic__result-item--standard .tic__result-value {
  color: #1565c0;
  font-weight: 700;
}

.tic__result-item--surcharge {
  background: linear-gradient(90deg, #fff3e0 0%, #fff 100%);
}

.tic__result-item--base {
  background: linear-gradient(90deg, #e3f2fd 0%, #fff 100%);
  border: 2px solid #2196f3;
  border-radius: 6px;
  margin: 4px 8px;
}

.tic__result-label {
  font-size: 15px;
  font-weight: 500;
  color: #444;
}

.tic__result-label small {
  font-weight: 400;
  color: #666;
  margin-left: 4px;
}

.tic__result-value {
  font-weight: 600;
  font-size: 16px;
  color: #222;
  white-space: nowrap;
}

.tic__result-item--discount .tic__result-value {
  color: #2e7d32;
}

.tic__result-item--surcharge .tic__result-value {
  color: #e65100;
}

.tic__result-item--base .tic__result-value {
  color: #1565c0;
  font-size: 18px;
}

/* Note */
.tic__result-note {
  margin-top: 16px;
  padding: 12px 16px;
  background: #e8f5e9;
  border-radius: 6px;
  font-size: 14px;
  color: #2e7d32;
  border-left: 4px solid #4caf50;
}

/* Responsive */
@media (max-width: 768px) {
  .tic__rows {
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }

  .tic__row {
    grid-template-columns: 1fr;
  }

  .tic__row.is-hidden {
    display: none;
  }

  .tic__cell {
    padding: 0;
  }

  .tic__cell--label {
    margin-bottom: 6px;
  }

  .tic__radio-group {
    flex-direction: column;
    gap: 12px;
  }

  .tic__result-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .tic__result-summary-item {
    flex-direction: column;
    gap: 2px;
  }

  .tic__actions button[type="submit"] {
    width: auto;
  }
}
