:root {
  --rf-bg: #050505;
  --rf-surface: #0f0f10;
  --rf-surface-2: #17181b;
  --rf-surface-3: #202226;
  --rf-border: rgba(255, 255, 255, 0.09);
  --rf-border-strong: rgba(255, 255, 255, 0.18);
  --rf-text: #ffffff;
  --rf-muted: #a1a1aa;
  --rf-red: #ff1a12;
  --rf-red-hover: #ff2d26;
  --rf-share-red: #FF3333;
  --rf-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.rf-calculator {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(255, 26, 18, 0.24) 0%, rgba(255, 26, 18, 0.10) 18%, rgba(255, 26, 18, 0.03) 34%, rgba(255, 26, 18, 0) 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, #101114 0%, #080808 100%);
  border: 1px solid var(--rf-border);
  box-shadow: var(--rf-shadow);
}

.rf-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 26, 18, 0.1);
  border: 1px solid rgba(255, 26, 18, 0.22);
  color: #ffd2cf;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.rf-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1;
  margin: 0;
  color: #ffffff;
  text-transform: uppercase;
}

.rf-subtitle,
.rf-note,
small,
p,
span,
label,
li {
  color: var(--rf-muted);
}

.rf-box {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)), var(--rf-surface);
  border: 1px solid var(--rf-border);
  border-radius: 22px;
  padding: 24px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.rf-box-title {
  font-size: 1.1rem;
  font-weight: 900;
  margin-bottom: 20px;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.rf-box-title i {
  margin-right: 8px;
  color: var(--rf-red);
}

.rf-result-item,
.rf-calorie-box {
  border: 1px solid var(--rf-border);
  border-radius: 18px;
  padding: 18px;
  background: var(--rf-surface-2);
}

.rf-result-item small,
.rf-calorie-box small {
  display: block;
  color: var(--rf-muted);
  margin-bottom: 8px;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.rf-result-item strong,
.rf-calorie-box strong {
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 800;
}

.form-label {
  margin-bottom: 8px;
  font-size: .9rem;
  font-weight: 700;
  color: #d4d4d8;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.rf-input-lg,
.rf-input-lg.form-control,
.rf-input-lg.form-select {
  height: 84px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f7f7f8 0%, #ebedf0 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #0f172a;
  text-align: center;
  font-size: 2.2rem;
  font-weight: 900;
  padding: 12px 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.rf-input-md,
.rf-input-md.form-control,
.rf-input-md.form-select {
  height: 58px;
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
  opacity: 1;
}

input:focus,
select:focus,
textarea:focus,
.rf-input-lg:focus,
.rf-input-lg.form-control:focus,
.rf-input-lg.form-select:focus {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  color: #0f172a;
  border-color: rgba(255, 26, 18, 0.55);
  box-shadow: 0 0 0 .22rem rgba(255, 26, 18, 0.18);
}

.rf-btn-primary {
  min-height: 62px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--rf-red) 0%, #df120b 100%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
  box-shadow: 0 16px 35px rgba(255, 26, 18, 0.22);
}

.rf-btn-primary:hover,
.rf-btn-primary:focus {
  color: #ffffff;
  background: linear-gradient(180deg, var(--rf-red-hover) 0%, #f0170f 100%);
}

.rf-btn-secondary {
  min-height: 50px;
  border-radius: 14px;
  border-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.03);
}

.rf-btn-secondary:hover,
.rf-btn-secondary:focus {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
}

.alert-danger {
  background: rgba(255, 26, 18, 0.1);
  border-color: rgba(255, 26, 18, 0.3);
  color: #ffd2cf;
  border-radius: 16px;
}

.table {
  color: #f4f4f5;
  --bs-table-bg: transparent;
  --bs-table-color: #f4f4f5;
  --bs-table-border-color: rgba(255, 255, 255, 0.08);
  --bs-table-striped-bg: rgba(255, 255, 255, 0.02);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.03);
}

.table > :not(caption) > * > * {
  padding-top: 1rem;
  padding-bottom: 1rem;
  background-color: transparent !important;
  border-color: rgba(255, 255, 255, 0.08);
}

.table thead th {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.16);
  text-transform: uppercase;
  letter-spacing: .04em;
  font-size: .82rem;
}

.rf-modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.rf-modal-footer .btn {
  min-width: 170px;
}

#rfResultModal .modal-body {
  max-height: calc(100vh - 210px);
  overflow-y: auto;
}

.rf-share-dimensions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #d4d4d8;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.rf-share-preview-shell {
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015)), #11141b;
  padding: 18px;
}

.rf-share-preview-grid {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  padding: 18px;
  background-color: #171b23;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.045) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.045) 75%, rgba(255, 255, 255, 0.045)),
    linear-gradient(45deg, rgba(255, 255, 255, 0.045) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.045) 75%, rgba(255, 255, 255, 0.045));
  background-position: 0 0, 18px 18px;
  background-size: 36px 36px;
}

.rf-share-preview {
  position: relative;
  width: min(100%, 295px);
  aspect-ratio: 720 / 1280;
  background: transparent;
}

.rf-share-content-area {
  position: absolute;
  left: 0;
  right: 0;
  top: 21.875%;
  height: 56.25%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
}

.rf-share-block {
  text-align: center;
}

.rf-share-label {
  display: block;
  margin-bottom: 6px;
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.94);
}

.rf-share-value-line,
.rf-share-time-line {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.rf-share-value-line strong,
.rf-share-time-line strong {
  margin: 0;
  color: #ffffff;
  font-size: 2.15rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.04em;
}

.rf-share-value-line span {
  color: var(--rf-share-red);
  font-size: 1.95rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.04em;
}

.rf-share-icon {
  margin-top: 2px;
  margin-bottom: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rf-share-icon-image {
  display: block;
  width: 62px;
  max-width: 100%;
  height: auto;
}

.rf-share-logo-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: auto;
}

.rf-share-logo {
  max-width: 165px;
  width: 100%;
  height: auto;
}

.rf-share-helper {
  font-size: .92rem;
  color: #c4c8d1;
}

@media (max-width: 767.98px) {
  .rf-box {
    padding: 18px;
  }

  .rf-input-lg,
  .rf-input-lg.form-control,
  .rf-input-lg.form-select {
    height: 72px;
    font-size: 1.7rem;
  }

  .rf-modal-footer .btn {
    width: 100%;
    min-width: 0;
  }

  .rf-share-preview-shell {
    padding: 12px;
  }

  .rf-share-preview-grid {
    padding: 12px;
  }

  .rf-share-preview {
    width: min(100%, 245px);
  }

  .rf-share-content-area {
    gap: 16px;
  }

  .rf-share-label {
    font-size: .68rem;
  }

  .rf-share-value-line strong,
  .rf-share-time-line strong {
    font-size: 1.8rem;
  }

  .rf-share-value-line span {
    font-size: 1.64rem;
  }

  .rf-share-icon-image {
    width: 54px;
  }

  .rf-share-logo {
    max-width: 145px;
  }
}
