/*
 * 20BLACK Affiliates — Frontend CSS v1.1
 * Isolato con prefisso .tba- per non interferire col tema
 */

/* Reset isolato — solo dentro containers TBA */
.tba-auth-wrap *,
.tba-dashboard * {
  box-sizing: border-box;
}

:root {
  --tba-black:   #0a0a0a;
  --tba-dark:    #111111;
  --tba-surface: #161616;
  --tba-border:  rgba(255,255,255,0.08);
  --tba-text:    rgba(248,246,242,0.90);
  --tba-muted:   rgba(248,246,242,0.45);
  --tba-accent:  #c8a96e;
  --tba-success: #2a9d8f;
  --tba-warning: #e9c46a;
  --tba-danger:  #e63946;
  --tba-mono:    'DM Mono', 'Courier New', monospace;
  --tba-serif:   'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --tba-sans:    'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ================================================================
   AUTH PAGES — login & registrazione
   ================================================================ */
.tba-auth-wrap {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  background: var(--tba-black);
}

.tba-auth-card {
  background: var(--tba-surface);
  border: 1px solid var(--tba-border);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
}
.tba-auth-card--wide { max-width: 700px; }

.tba-auth-header { margin-bottom: 2rem; }

.tba-eyebrow {
  display: block;
  font-family: var(--tba-mono) !important;
  font-size: 0.6rem !important;
  letter-spacing: 0.32em !important;
  text-transform: uppercase !important;
  color: var(--tba-accent) !important;
  margin-bottom: 0.6rem !important;
}

.tba-auth-title {
  display: block;
  font-family: var(--tba-serif) !important;
  font-size: 2rem !important;
  font-weight: 300 !important;
  color: var(--tba-text) !important;
  margin: 0 0 0.4rem !important;
  letter-spacing: 0.04em !important;
  line-height: 1.2 !important;
}

.tba-auth-sub {
  display: block;
  font-family: var(--tba-sans) !important;
  font-size: 0.88rem !important;
  color: var(--tba-muted) !important;
  margin: 0 !important;
  line-height: 1.55 !important;
}

.tba-auth-footer {
  text-align: center;
  margin-top: 1.75rem;
  font-family: var(--tba-sans);
  font-size: 0.84rem;
  color: var(--tba-muted);
}

.tba-link {
  color: var(--tba-accent) !important;
  text-decoration: none !important;
  border-bottom: 1px solid rgba(200,169,110,0.35) !important;
  transition: border-color 0.2s !important;
}
.tba-link:hover { border-bottom-color: var(--tba-accent) !important; }

/* Benefits grid */
.tba-benefits {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding: 1.25rem;
  background: rgba(200,169,110,0.05);
  border: 1px solid rgba(200,169,110,0.12);
}
.tba-benefit {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--tba-sans);
  font-size: 0.83rem;
  color: var(--tba-muted);
  line-height: 1.4;
}
.tba-benefit-icon { font-size: 1.1rem; flex-shrink: 0; }

/* ================================================================
   FORMS
   ================================================================ */
.tba-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.tba-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}

.tba-field {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}
.tba-field-full   { grid-column: 1 / -1; }
.tba-field-inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

/* Label */
.tba-field > label,
.tba-field label:not(.tba-check-label) {
  display: block !important;
  font-family: var(--tba-mono) !important;
  font-size: 0.63rem !important;
  letter-spacing: 0.16em !important;
  text-transform: uppercase !important;
  color: var(--tba-muted) !important;
  font-weight: 400 !important;
  margin-bottom: 0 !important;
}

.tba-req { color: var(--tba-accent) !important; }

/* Input */
.tba-field input[type="text"],
.tba-field input[type="email"],
.tba-field input[type="password"],
.tba-field input[type="tel"],
.tba-field input[type="search"] {
  display: block !important;
  width: 100% !important;
  height: 48px !important;
  background: var(--tba-dark) !important;
  border: 1px solid var(--tba-border) !important;
  color: var(--tba-text) !important;
  font-family: var(--tba-sans) !important;
  font-size: 0.9rem !important;
  padding: 0 0.9rem !important;
  border-radius: 0 !important;
  outline: none !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  box-shadow: none !important;
}
.tba-field input:focus {
  border-color: var(--tba-accent) !important;
  box-shadow: 0 0 0 3px rgba(200,169,110,0.12) !important;
}
.tba-field input::placeholder { color: rgba(248,246,242,0.2) !important; }

/* Password wrapper */
.tba-pwd-wrap { position: relative; }
.tba-pwd-wrap input { padding-right: 2.8rem !important; }
.tba-pwd-toggle {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--tba-muted);
  padding: 0.3rem;
  line-height: 1;
  z-index: 2;
}

.tba-pwd-strength {
  height: 3px;
  margin-top: 0.4rem;
  background: var(--tba-border);
  border-radius: 2px;
  transition: width 0.4s, background 0.4s;
  width: 0;
}

/* Checkbox */
.tba-check-label {
  display: flex !important;
  align-items: flex-start !important;
  gap: 0.65rem !important;
  cursor: pointer !important;
  font-family: var(--tba-sans) !important;
  font-size: 0.84rem !important;
  color: var(--tba-muted) !important;
  line-height: 1.5 !important;
}
.tba-check-label input[type="checkbox"] {
  width: 16px !important;
  height: 16px !important;
  accent-color: var(--tba-accent) !important;
  flex-shrink: 0 !important;
  margin-top: 0.15rem !important;
  cursor: pointer !important;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.tba-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  padding: 0.8rem 1.75rem !important;
  font-family: var(--tba-mono) !important;
  font-size: 0.68rem !important;
  letter-spacing: 0.18em !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  border: none !important;
  text-decoration: none !important;
  transition: all 0.2s !important;
  border-radius: 0 !important;
  line-height: 1 !important;
  font-weight: 400 !important;
}
.tba-btn-primary  { background: var(--tba-accent) !important; color: #0a0a0a !important; }
.tba-btn-primary:hover { background: #d4b87a !important; }
.tba-btn-ghost    { background: transparent !important; color: var(--tba-muted) !important; border: 1px solid var(--tba-border) !important; }
.tba-btn-ghost:hover { color: var(--tba-text) !important; border-color: rgba(255,255,255,0.25) !important; }
.tba-btn-full     { width: 100% !important; }

/* ================================================================
   ALERTS & NOTICES
   ================================================================ */
.tba-alert {
  padding: 0.9rem 1.1rem !important;
  font-family: var(--tba-sans) !important;
  font-size: 0.87rem !important;
  border-radius: 0 !important;
  margin-bottom: 1.1rem !important;
  line-height: 1.5 !important;
}
.tba-alert-error   { background: rgba(230,57,70,0.1)  !important; border-left: 3px solid var(--tba-danger)  !important; color: var(--tba-text) !important; }
.tba-alert-success { background: rgba(42,157,143,0.1) !important; border-left: 3px solid var(--tba-success) !important; color: var(--tba-text) !important; }

.tba-notice {
  padding: 1rem 1.25rem;
  background: var(--tba-surface);
  border-left: 3px solid var(--tba-accent);
  font-family: var(--tba-sans);
  font-size: 0.88rem;
  color: var(--tba-text);
}

.tba-status-notice {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--tba-border);
  background: var(--tba-surface);
}
.tba-status-icon { font-size: 2rem; flex-shrink: 0; }
.tba-pending  { border-left: 3px solid var(--tba-warning); }
.tba-suspended { border-left: 3px solid var(--tba-danger); }
.tba-status-notice strong {
  display: block;
  font-family: var(--tba-sans);
  font-size: 0.95rem;
  color: var(--tba-text);
  margin-bottom: 0.4rem;
}
.tba-status-notice p {
  font-family: var(--tba-sans);
  font-size: 0.84rem;
  color: var(--tba-muted);
  margin: 0;
}

/* ================================================================
   DASHBOARD
   ================================================================ */
.tba-dashboard {
  color: var(--tba-text);
  font-family: var(--tba-sans);
  padding-bottom: 4rem;
}

/* Top bar */
.tba-dash-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--tba-border);
}
.tba-dash-title {
  font-family: var(--tba-serif) !important;
  font-size: 2rem !important;
  font-weight: 300 !important;
  color: var(--tba-text) !important;
  margin: 0 !important;
  letter-spacing: 0.04em !important;
}
.tba-dash-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.tba-ref-label {
  font-family: var(--tba-mono);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tba-muted);
  display: block;
  margin-bottom: 0.35rem;
}
.tba-ref-row { display: flex; align-items: center; gap: 0.5rem; }
.tba-ref-code {
  font-family: var(--tba-mono);
  font-size: 1rem;
  letter-spacing: 0.15em;
  color: var(--tba-accent);
  background: rgba(200,169,110,0.08);
  padding: 0.35rem 0.75rem;
  border: 1px solid rgba(200,169,110,0.2);
}
.tba-btn-copy {
  background: none;
  border: 1px solid var(--tba-border);
  cursor: pointer;
  padding: 0.35rem 0.55rem;
  font-size: 0.85rem;
  transition: all 0.2s;
  border-radius: 2px;
  color: var(--tba-muted);
}
.tba-btn-copy:hover { border-color: var(--tba-accent); color: var(--tba-accent); }

/* Stats grid */
.tba-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-bottom: 2px;
}
.tba-stat-card {
  background: var(--tba-surface);
  border: 1px solid var(--tba-border);
  padding: 1.35rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: border-color 0.2s;
}
.tba-stat-card:hover { border-color: rgba(200,169,110,0.3); }
.tba-stat-icon { font-size: 1.6rem; flex-shrink: 0; }
.tba-stat-value {
  display: block;
  font-family: var(--tba-serif);
  font-size: 1.9rem;
  font-weight: 300;
  color: var(--tba-text);
  line-height: 1;
}
.tba-stat-label {
  display: block;
  font-family: var(--tba-mono);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--tba-muted);
  margin-top: 0.3rem;
}
.tba-stat-pending .tba-stat-value { color: var(--tba-warning); }
.tba-stat-paid .tba-stat-value    { color: var(--tba-success); }

/* Info box */
.tba-info-box {
  background: rgba(200,169,110,0.05);
  border: 1px solid rgba(200,169,110,0.15);
  border-left: 3px solid var(--tba-accent);
  padding: 1.25rem 1.5rem;
  margin-top: 2px;
  font-family: var(--tba-sans);
  font-size: 0.85rem;
  color: var(--tba-muted);
  line-height: 1.75;
}
.tba-info-box h4 {
  font-family: var(--tba-sans);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--tba-text);
  margin: 0 0 0.5rem;
}
.tba-info-box strong { color: var(--tba-accent); font-weight: 600; }
.tba-info-box em    { color: rgba(248,246,242,0.3); font-style: normal; }

/* Section */
.tba-section { margin-top: 2.5rem; }
.tba-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.tba-section-title {
  font-family: var(--tba-mono) !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.22em !important;
  text-transform: uppercase !important;
  color: var(--tba-accent) !important;
  margin: 0 !important;
}
.tba-search-input {
  background: var(--tba-dark);
  border: 1px solid var(--tba-border);
  color: var(--tba-text);
  padding: 0.5rem 0.9rem;
  font-family: var(--tba-sans);
  font-size: 0.85rem;
  outline: none;
  min-width: 220px;
  height: 38px;
}
.tba-search-input:focus { border-color: var(--tba-accent); }

/* Products grid */
.tba-products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.tba-product-card {
  background: var(--tba-surface);
  border: 1px solid var(--tba-border);
  transition: border-color 0.25s;
}
.tba-product-card:hover { border-color: rgba(200,169,110,0.3); }
.tba-product-img {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--tba-dark);
}
.tba-product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  display: block;
}
.tba-product-card:hover .tba-product-img img { transform: scale(1.04); }
.tba-product-body { padding: 1rem; }
.tba-product-title {
  font-family: var(--tba-serif) !important;
  font-size: 0.95rem !important;
  font-weight: 400 !important;
  color: var(--tba-text) !important;
  margin: 0 0 0.3rem !important;
  line-height: 1.3 !important;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tba-product-price {
  font-family: var(--tba-sans);
  font-size: 0.82rem;
  color: var(--tba-muted);
  margin-bottom: 0.6rem;
}
.tba-product-price .woocommerce-Price-amount { color: var(--tba-text) !important; }
.tba-product-stats {
  display: flex;
  gap: 0.75rem;
  font-family: var(--tba-mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  color: rgba(248,246,242,0.3);
  margin-bottom: 0.85rem;
}
.tba-product-stats span b { color: var(--tba-accent); }
.tba-product-actions { display: flex; gap: 0.5rem; }
.tba-btn-link {
  flex: 1;
  background: var(--tba-accent);
  color: #0a0a0a;
  border: none;
  padding: 0.6rem;
  font-family: var(--tba-mono);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
}
.tba-btn-link:hover { background: #d4b87a; }
.tba-btn-preview {
  background: rgba(255,255,255,0.06);
  color: var(--tba-muted);
  border: none;
  padding: 0.6rem 0.7rem;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}
.tba-btn-preview:hover { background: rgba(255,255,255,0.1); color: var(--tba-text); }

/* Table */
.tba-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tba-table { width: 100%; border-collapse: collapse; font-family: var(--tba-sans); font-size: 0.85rem; }
.tba-table th {
  font-family: var(--tba-mono);
  font-size: 0.58rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--tba-muted);
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--tba-border);
  text-align: left;
  white-space: nowrap;
  background: rgba(255,255,255,0.02);
}
.tba-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  color: var(--tba-text);
  vertical-align: middle;
}
.tba-table tr:last-child td { border-bottom: none; }
.tba-table tr:hover td { background: rgba(255,255,255,0.02); }
.tba-product-name { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Status badges */
.tba-status {
  font-family: var(--tba-mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.65rem;
  white-space: nowrap;
  display: inline-block;
}
.tba-status-in-attesa { background: rgba(233,196,106,0.12); color: var(--tba-warning); }
.tba-status-approvata { background: rgba(42,157,143,0.12);  color: var(--tba-success); }
.tba-status-pagata    { background: rgba(42,157,143,0.18);  color: var(--tba-success); }
.tba-status-rifiutata { background: rgba(230,57,70,0.12);   color: var(--tba-danger);  }

/* Empty & loading */
.tba-empty-state { text-align: center; padding: 3rem 1rem; color: var(--tba-muted); }
.tba-empty-state span { font-size: 2.5rem; display: block; margin-bottom: 0.75rem; }
.tba-empty-state p { font-family: var(--tba-sans); font-size: 0.88rem; margin: 0; }
.tba-loading { text-align: center; padding: 2.5rem 1rem; color: var(--tba-muted); font-family: var(--tba-sans); font-size: 0.85rem; }

/* Pagination */
.tba-pagination { display: flex; gap: 0.35rem; justify-content: center; margin-top: 1.5rem; }
.tba-page-btn {
  background: var(--tba-surface);
  border: 1px solid var(--tba-border);
  color: var(--tba-muted);
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  font-family: var(--tba-mono);
  font-size: 0.7rem;
  transition: all 0.2s;
  line-height: 1;
}
.tba-page-btn:hover, .tba-page-btn.active {
  background: var(--tba-accent);
  color: #0a0a0a;
  border-color: var(--tba-accent);
}

/* Modal */
.tba-modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.tba-modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.72);
  backdrop-filter: blur(4px);
}
.tba-modal {
  position: relative;
  z-index: 1;
  background: var(--tba-dark);
  border: 1px solid var(--tba-border);
  width: min(540px, 100%);
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
}
.tba-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--tba-border);
}
.tba-modal-head h4 {
  font-family: var(--tba-sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--tba-text);
  margin: 0;
}
.tba-modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--tba-muted);
  font-size: 1rem;
  padding: 0.3rem;
  transition: color 0.2s;
  line-height: 1;
}
.tba-modal-close:hover { color: var(--tba-text); }
.tba-modal-body { padding: 1.5rem; }
.tba-modal-product-name {
  font-family: var(--tba-serif);
  font-size: 1.1rem;
  color: var(--tba-text);
  margin: 0 0 1rem;
}
.tba-link-box { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; }
.tba-link-input {
  flex: 1;
  background: var(--tba-surface);
  border: 1px solid var(--tba-border);
  color: var(--tba-text);
  padding: 0.65rem 0.9rem;
  font-family: var(--tba-mono);
  font-size: 0.78rem;
  outline: none;
  min-width: 0;
}
.tba-share-label {
  font-family: var(--tba-mono);
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--tba-muted);
  display: block;
  margin-bottom: 0.65rem;
}
.tba-share-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tba-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  font-family: var(--tba-sans);
  font-size: 0.8rem;
  text-decoration: none;
  border: 1px solid var(--tba-border);
  color: var(--tba-muted);
  background: var(--tba-surface);
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 0;
}
.tba-share-btn:hover             { border-color: var(--tba-accent); color: var(--tba-text); }
.tba-share-wa:hover              { border-color: #25d366; color: #25d366; }
.tba-share-tg:hover              { border-color: #0088cc; color: #0088cc; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 900px) {
  .tba-products-grid    { grid-template-columns: repeat(2, 1fr); }
  .tba-stats-grid       { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .tba-benefits         { grid-template-columns: 1fr; }
  .tba-form-grid        { grid-template-columns: 1fr; }
  .tba-auth-card        { padding: 1.75rem 1.25rem; }
  .tba-dash-top         { flex-direction: column; }
  .tba-dash-meta        { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 480px) {
  .tba-stats-grid       { grid-template-columns: 1fr; }
  .tba-products-grid    { grid-template-columns: 1fr; }
  .tba-modal            { width: 100vw; margin: 0; border-left: none; border-right: none; }
}
