/* Affiliate program, affiliate dashboard and partner directory pages. */

.aff-page {
  max-width: 1080px;
  margin: 40px auto 80px;
  padding: 0 16px;
  color: var(--text-primary-color);
  line-height: 1.6;
}

.aff-narrow {
  max-width: 760px;
}

.aff-hero {
  text-align: center;
  padding: 24px 0 32px;
}

.aff-hero h1 {
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

.aff-hero-small {
  padding-bottom: 16px;
}

.aff-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 13px;
  color: var(--primary-color);
  margin: 0 0 8px;
}

.aff-lead {
  font-size: 1.1rem;
  max-width: 720px;
  margin: 0 auto 20px;
}

.aff-narrow .aff-lead {
  margin-left: 0;
}

.aff-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.aff-partner-profile .aff-buttons {
  justify-content: flex-start;
}

.aff-note {
  font-size: 14px;
  color: #6b7280;
}

.aff-section {
  margin: 48px 0;
}

.aff-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.aff-step {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
}

.aff-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  font-weight: 700;
  margin-bottom: 8px;
}

.aff-list {
  padding-left: 20px;
}

.aff-list li {
  margin-bottom: 8px;
}

.aff-faq {
  border-bottom: 1px solid #e5e7eb;
  padding: 14px 0;
}

.aff-faq summary {
  cursor: pointer;
  font-weight: 700;
  color: #142640;
}

.aff-faq p {
  margin: 8px 0 0;
}

.aff-cta {
  text-align: center;
  background: #f6f5f7;
  border-radius: 16px;
  padding: 36px 20px;
  margin-top: 48px;
}

.aff-legal h2 {
  font-size: 1.2rem;
  margin-top: 28px;
}

/* Forms */

.aff-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
}

.aff-form label {
  font-weight: 700;
  margin-top: 10px;
  color: #142640;
}

.aff-form input,
.aff-form select,
.aff-form textarea,
.aff-filters input,
.aff-filters select {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  color: inherit;
  width: 100%;
  box-sizing: border-box;
}

.aff-form input:focus-visible,
.aff-form select:focus-visible,
.aff-form textarea:focus-visible,
.aff-filters input:focus-visible,
.aff-filters select:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 1px;
}

.aff-form small {
  color: #6b7280;
  font-size: 13px;
}

.aff-form button {
  margin-top: 18px;
  align-self: flex-start;
}

.aff-form .aff-check {
  font-weight: 400;
  display: flex;
  gap: 8px;
  align-items: center;
}

.aff-form .aff-check input {
  width: auto;
}

.aff-fieldset {
  border: 0;
  padding: 0;
  margin: 10px 0 0;
}

.aff-fieldset legend {
  font-weight: 700;
  color: #142640;
  margin-bottom: 4px;
}

.aff-fieldset .aff-check {
  margin-top: 4px;
}

.aff-optional {
  font-weight: 400;
  color: #6b7280;
}

.aff-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 12px 0;
}

.aff-success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 12px;
  padding: 20px 24px;
}

.aff-success-bar {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 12px 0;
}

.aff-auth {
  max-width: 460px;
}

/* Dashboard */

.aff-dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.aff-dashboard-head h1 {
  margin-bottom: 0;
}

.aff-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px 20px 24px;
  margin: 20px 0;
  background: #fff;
}

.aff-card h2 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.aff-warning {
  border-left: 4px solid #d97706;
}

.aff-link-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-top: 1px solid #f1f1f4;
  padding: 10px 0;
}

.aff-link-row code,
.aff-page code {
  word-break: break-all;
  font-size: 14px;
}

.aff-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.aff-stats > div {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  font-size: 14px;
  color: #6b7280;
}

.aff-stats span {
  display: block;
  font-size: 26px;
  font-weight: 900;
  color: #142640;
}

.aff-earnings {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-bottom: 16px;
}

.aff-earnings > div {
  display: flex;
  flex-direction: column;
}

.aff-earnings strong {
  font-size: 20px;
  color: #142640;
}

.aff-earnings span {
  font-size: 13px;
  color: #6b7280;
}

.aff-table-wrap {
  overflow-x: auto;
}

.aff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 520px;
}

.aff-table th,
.aff-table td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid #f1f1f4;
}

.aff-table th {
  color: #6b7280;
  font-weight: 700;
}

.aff-method {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px;
  margin: 12px 0;
}

.aff-method.selected {
  border-color: var(--primary-color);
}

.aff-method-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.aff-method-actions form {
  margin: 0;
}

.aff-chosen {
  font-weight: 700;
  color: var(--primary-color);
}

/* Partner directory */

.aff-filters {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 10px;
  margin-bottom: 24px;
}

.aff-empty {
  text-align: center;
  padding: 24px;
}

.aff-partner-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.aff-partner-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.aff-partner-card:hover {
  border-color: var(--primary-color);
}

.aff-partner-card:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.aff-partner-card h2 {
  font-size: 1.1rem;
  margin: 0;
}

.aff-partner-card p {
  margin: 10px 0 0;
}

.aff-partner-head {
  display: flex;
  gap: 12px;
  align-items: center;
}

.aff-partner-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.aff-partner-logo-large {
  width: 88px;
  height: 88px;
  font-size: 30px;
}

.aff-partner-initials {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef0fe;
  color: var(--primary-color);
  font-weight: 900;
}

.aff-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #047857;
  background: #ecfdf5;
  border-radius: 999px;
  padding: 2px 10px;
  margin-top: 4px;
}

.aff-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 12px;
}

.aff-tags span {
  font-size: 12px;
  background: #f6f5f7;
  border-radius: 999px;
  padding: 2px 10px;
}

.aff-partner-profile {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin: 16px 0 24px;
}

.aff-partner-profile h1 {
  margin-bottom: 4px;
}

.aff-facts {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 6px 16px;
  margin: 0 0 24px;
}

.aff-facts dt {
  font-weight: 700;
  color: #142640;
}

.aff-facts dd {
  margin: 0;
}

.aff-disclaimer {
  margin-top: 32px;
}

.aff-logo-box {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 32px;
  text-align: center;
}

.aff-logo-box img {
  max-width: 240px;
}

.aff-copy {
  background: #f6f5f7;
  border-radius: 12px;
  padding: 4px 20px;
}

@media (max-width: 900px) {
  .aff-steps,
  .aff-partner-grid {
    grid-template-columns: 1fr 1fr;
  }

  .aff-filters {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .aff-steps,
  .aff-partner-grid,
  .aff-filters {
    grid-template-columns: 1fr;
  }

  .aff-stats {
    grid-template-columns: 1fr 1fr;
  }

  .aff-link-row,
  .aff-method {
    flex-direction: column;
    align-items: flex-start;
  }

  .aff-method-actions {
    justify-content: flex-start;
  }

  .aff-partner-profile {
    flex-direction: column;
  }

  .aff-facts {
    grid-template-columns: 1fr;
  }

  .aff-facts dd {
    margin-bottom: 8px;
  }
}

.aff-change-code {
  border-top: 1px solid #f1f1f4;
  padding-top: 10px;
}

.aff-change-code summary {
  cursor: pointer;
  color: var(--primary-color);
  font-weight: 700;
}

.aff-change-code .aff-form {
  max-width: 420px;
}

/* The site's .button is styled for links. Real <button> elements (form submits, copy buttons) need the pointer, the site font and
   no browser border or background to match. */
.aff-page button.button {
  cursor: pointer;
  font-family: inherit;
  border: 0;
  line-height: normal;
}

.aff-page button.button-transparent {
  background: transparent;
}

.aff-page button.button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}
