:root {
  --tf-border: #e6ebf3;
  --tf-text: #1f2d3d;
  --tf-muted: #6c7b92;
  --tf-blue: #4c8df6;
  --tf-blue-dark: #2463d3;
  --tf-sidebar: #1d2338;
  --tf-sidebar-2: #252b45;
  --tf-bg: #f6f8fc;
  --tf-card: #ffffff;
  --tf-orange: #f89d32;
}

.tf-page,
.tf-settings-page {
  margin: 0;
  font-family: "Inter", Arial, sans-serif;
  color: var(--tf-text);
}

.tf-page {
  background: var(--tf-bg);
}

.tf-page .dash-main {
  min-height: 100vh;
  background: #fff;
}

.tf-page .dash-topbar {
  background: #fff;
  border-bottom: 1px solid var(--tf-border);
}

.tf-page .search-box {
  max-width: 376px;
  border-radius: 12px;
  background: #f7f9fc;
  border-color: #dfe5ef;
}

.tf-page .dash-content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 18px 32px 48px;
}

.tf-sidebar {
  background: linear-gradient(180deg, var(--tf-sidebar) 0%, var(--tf-sidebar-2) 100%);
}

.tf-sidebar .logo {
  width: 118px;
}

.tf-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid #edf1f6;
}

.tf-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tf-title {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  color: #14213d;
}

.tf-title-button {
  border: 0;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.tf-back-btn,
.tf-help-btn,
.tf-fab-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tf-back-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #edf4ff;
  color: var(--tf-blue-dark);
  text-decoration: none;
}

.tf-select-anchor {
  position: relative;
}

.tf-select-anchor.open .tf-select-menu {
  display: block;
}

.tf-select-label {
  color: #56657d;
}

.tf-select-menu {
  position: absolute;
  top: calc(100% + 16px);
  left: 0;
  width: 316px;
  background: #fff;
  border: 1px solid var(--tf-border);
  border-radius: 14px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
  padding: 12px;
  display: none;
  z-index: 40;
}

.tf-select-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  border: 1px solid #d9dfeb;
  border-radius: 10px;
  padding: 0 12px;
  color: #64748b;
}

.tf-select-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
}

.tf-select-options {
  margin-top: 12px;
}

.tf-select-empty {
  padding: 18px 12px 22px;
  color: #6c7488;
  font-size: 15px;
}

.tf-select-option {
  width: 100%;
  border: 0;
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  text-align: left;
  font: inherit;
  color: #1f2d3d;
  cursor: pointer;
}

.tf-select-option:hover,
.tf-select-option.active {
  background: #4c8df6;
  color: #fff;
}

.tf-header-tools {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tf-help-btn {
  width: 40px;
  height: 40px;
  border: 1px solid #d7dde7;
  border-radius: 10px;
  background: #fff;
  color: #334155;
}

.tf-center-block {
  text-align: center;
  padding: 44px 0 10px;
}

.tf-kicker {
  margin: 0;
  font-size: 22px;
  font-weight: 400;
  color: #2d3a52;
}

.tf-kicker-bar {
  width: 54px;
  height: 3px;
  border-radius: 999px;
  margin: 18px auto 34px;
  background: #6d8cff;
}

.tf-section-title {
  margin: 0 0 38px;
  font-size: 22px;
  font-weight: 500;
}

.tf-deductor-card {
  width: min(476px, 92%);
  margin: 0 auto;
  background: #fff;
  border: 1px solid #edf1f6;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  padding: 40px 28px 30px;
}

.tf-deductor-card p {
  margin: 0 0 16px;
  font-size: 18px;
}

.tf-link-btn,
.tf-inline-link {
  color: var(--tf-blue-dark);
  text-decoration: none;
  font-weight: 500;
}

.tf-note {
  margin-top: 18px;
  font-size: 16px;
  color: #6b7280;
}

.tf-steps-wrap {
  margin: 92px auto 0;
  width: min(1296px, 100%);
}

.tf-steps-wrap h2 {
  margin: 0 0 36px;
  text-align: center;
  font-size: 22px;
  font-weight: 500;
}

.tf-steps-card {
  display: grid;
  grid-template-columns: 1.7fr 320px;
  gap: 0;
  background: #fff;
  border: 1px solid var(--tf-border);
  border-radius: 18px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
  overflow: hidden;
}

.tf-steps-main {
  padding: 34px 38px;
}

.tf-steps-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 42px;
}

.tf-steps-head .label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tf-steps-head a {
  color: var(--tf-blue-dark);
  text-decoration: none;
  font-size: 16px;
}

.tf-steps-flow {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  align-items: start;
}

.tf-step-item {
  text-align: center;
  position: relative;
  padding: 0 10px;
}

.tf-step-item:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 30px;
  right: -8px;
  width: 32px;
  height: 10px;
  background:
    linear-gradient(45deg, transparent 45%, #c9d3eb 46%, #c9d3eb 54%, transparent 55%) 0 0 / 16px 10px repeat-x;
}

.tf-step-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  border-radius: 18px;
  background: #f7f9ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
}

.tf-step-item.upload .tf-step-icon { color: #f43f5e; }
.tf-step-item.generate .tf-step-icon { color: #f59e0b; }
.tf-step-item.sign .tf-step-icon { color: #3b82f6; }
.tf-step-item.publish .tf-step-icon { color: #22c55e; }

.tf-step-item span {
  display: block;
  font-size: 15px;
  color: #1f2d3d;
}

.tf-video-card {
  background: linear-gradient(180deg, #fafcff 0%, #f3f7ff 100%);
  border-left: 1px solid var(--tf-border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
}

.tf-video-inner {
  width: 100%;
  min-height: 202px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(124, 146, 255, 0.08), transparent 55%),
    linear-gradient(315deg, rgba(98, 180, 255, 0.1), transparent 50%),
    #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
  color: #24334c;
  font-size: 16px;
  padding: 24px;
}

.tf-video-play {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #4c7ff7;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: 0 14px 24px rgba(76, 127, 247, 0.28);
}

.tf-support-tile {
  margin-top: 12px;
  background: #21365f;
  border-radius: 14px;
  padding: 16px 18px;
  color: #fff;
}

.tf-support-tile .support-title {
  margin-bottom: 12px;
  line-height: 1.45;
}

.tf-support-tile .support-action {
  color: #8dc0ff;
}

.tf-fab-help {
  position: fixed;
  right: 14px;
  top: 188px;
  width: 40px;
  height: 42px;
  border-radius: 10px;
  background: #ff8c1a;
  color: #fff;
  box-shadow: 0 14px 28px rgba(255, 140, 26, 0.28);
  z-index: 30;
  text-decoration: none;
}

.tf-flash {
  margin: 18px 0 0;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 14px;
}

.tf-flash.ok {
  background: #effcf5;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.tf-flash.err {
  background: #fff1f2;
  border: 1px solid #fecdd3;
  color: #9f1239;
}

.tf-settings-page {
  background: #f8faff;
}

.tf-settings-top {
  display: grid;
  grid-template-columns: 280px minmax(300px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 24px;
  background: #fff;
  border-bottom: 1px solid var(--tf-border);
}

.tf-settings-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tf-settings-brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid var(--tf-border);
  background: #fff;
  color: #ef4444;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.tf-settings-brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

.tf-settings-brand p {
  margin: 4px 0 0;
  color: var(--tf-muted);
  font-size: 13px;
}

.tf-settings-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f2f5fb;
  border: 1px solid var(--tf-border);
  border-radius: 16px;
  padding: 12px 14px;
}

.tf-settings-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
}

.tf-settings-close {
  background: #fff;
  border: 1px solid var(--tf-border);
  border-radius: 12px;
  padding: 11px 16px;
  color: var(--tf-text);
  text-decoration: none;
  font-weight: 600;
}

.tf-settings-close span {
  color: #ef4444;
}

.tf-settings-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: calc(100vh - 85px);
}

.tf-settings-sidebar {
  background: #fff;
  border-right: 1px solid var(--tf-border);
  padding: 8px 0 18px;
}

.tf-sidebar-heading {
  padding: 16px 20px 10px;
  font-size: 13px;
  color: #66758c;
  text-transform: uppercase;
}

.tf-side-nav,
.tf-side-subnav {
  display: flex;
  flex-direction: column;
}

.tf-side-link,
.tf-side-parent,
.tf-side-subnav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  text-decoration: none;
  color: #1f2937;
  font-weight: 500;
}

.tf-side-parent.active,
.tf-side-link.active,
.tf-side-subnav a.active {
  background: #4c8df6;
  color: #fff;
}

.tf-side-subnav a {
  padding-left: 40px;
}

.tf-settings-main {
  background: #fff;
}

.tf-settings-panel {
  max-width: 980px;
  padding: 24px 38px 40px;
}

.tf-settings-panel h2 {
  margin: 0 0 36px;
  font-size: 22px;
  font-weight: 500;
}

.tf-settings-panel section + section {
  margin-top: 42px;
}

.tf-settings-panel h3 {
  margin: 0 0 22px;
  font-size: 18px;
  font-weight: 600;
}

.tf-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 38px;
}

.tf-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tf-field label {
  font-size: 15px;
  color: #111827;
}

.tf-field small {
  color: #7b879b;
  font-size: 12px;
}

.tf-required {
  color: #ef4444;
}

.tf-input,
.tf-select {
  width: 100%;
  min-height: 52px;
  border: 1px solid #d7ddea;
  border-radius: 12px;
  padding: 0 14px;
  font: inherit;
  color: #334155;
  background: #fff;
  outline: 0;
}

.tf-input[readonly] {
  background: #f8fafc;
}

.tf-segmented {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  min-height: 52px;
}

.tf-radio {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}

.tf-radio input {
  width: 18px;
  height: 18px;
}

.tf-code-grid {
  display: grid;
  grid-template-columns: 74px 16px 62px 16px 86px 16px 66px;
  gap: 12px;
  align-items: center;
}

.tf-code-sep {
  text-align: center;
  color: #64748b;
  font-size: 24px;
  margin-top: -2px;
}

.tf-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
}

.tf-primary-btn {
  min-width: 68px;
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--tf-blue);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(76, 141, 246, 0.2);
}

.tf-footnote {
  margin-top: 18px;
  color: #ef4444;
  text-align: right;
}

@media (max-width: 1100px) {
  .tf-steps-card,
  .tf-settings-top,
  .tf-settings-layout {
    grid-template-columns: 1fr;
  }

  .tf-video-card {
    border-left: 0;
    border-top: 1px solid var(--tf-border);
  }
}

@media (max-width: 860px) {
  .tf-page .dash-content,
  .tf-settings-panel {
    padding: 16px 16px 32px;
  }

  .tf-header,
  .tf-steps-flow,
  .tf-form-grid,
  .tf-code-grid {
    grid-template-columns: 1fr;
  }

  .tf-steps-flow {
    display: flex;
    flex-direction: column;
    gap: 22px;
  }

  .tf-step-item:not(:last-child)::after {
    display: none;
  }

  .tf-settings-top {
    padding: 16px;
  }

  .tf-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .tf-select-menu,
  .tf-deductor-card {
    width: 100%;
  }
}
