/* SimpleDownloads Customer Dashboard — matches simpleboards.io design system */

/* Match the simpleboards theme container padding so the breakout is exact */
:root { --sd-breakout: 28px; }

.sd-portal {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #2d2d4e;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Viewport breakout — escapes narrow theme content columns ─────────── */
.sd-portal-breakout {
  /* Pull the dashboard outside the theme's container padding */
  margin-left:  calc(-1 * var(--sd-breakout, 28px));
  margin-right: calc(-1 * var(--sd-breakout, 28px));
  padding: 0;
}

/* ── Login screen ─────────────────────────────────────────────────────── */
.sd-login-card {
  max-width: 440px; margin: 48px auto; padding: 48px 44px;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(20px);
  border: 1px solid rgba(91,94,244,0.14); border-radius: 28px;
  box-shadow: 0 24px 80px rgba(91,94,244,0.14), 0 8px 24px rgba(0,0,0,0.06);
}
.sd-login-logo { text-align: center; margin-bottom: 24px; }
.sd-login-site-name { font-size: 1.3rem; font-weight: 700; color: #5b5ef4; }
.sd-login-title { font-size: 1.5rem; font-weight: 700; color: #13132b; text-align: center; margin: 0 0 8px; }
.sd-login-sub { color: #5c5b7d; text-align: center; margin: 0 0 28px; font-size: 0.9rem; }

/* ── Forms ────────────────────────────────────────────────────────────── */
.sd-field { margin-bottom: 16px; }
.sd-field label { display: block; font-size: 0.86rem; font-weight: 600; color: #13132b; margin-bottom: 6px; }
.sd-field input {
  width: 100%; padding: 12px 16px; border-radius: 12px;
  border: 1.5px solid rgba(91,94,244,0.2); background: #f4f3ff;
  font-size: 0.95rem; font-family: inherit; color: #13132b; outline: none;
  transition: border-color 0.2s; box-sizing: border-box;
}
.sd-field input:focus { border-color: #5b5ef4; background: #fff; }
.sd-magic-form { margin-bottom: 0; }
.sd-password-form { margin-bottom: 0; }

/* ── Login tab switcher ──────────────────────────────────────────────── */
.sd-login-tabs {
  display: flex; gap: 0; margin: 0 0 24px;
  background: #f4f3ff; border-radius: 100px; padding: 4px;
}
.sd-login-tab {
  flex: 1; padding: 10px 16px; border: none; background: transparent;
  font-family: inherit; font-size: 0.88rem; font-weight: 600; color: #5c5b7d;
  border-radius: 100px; cursor: pointer; transition: all 0.2s;
}
.sd-login-tab:hover { color: #13132b; }
.sd-login-tab.is-active { background: #fff; color: #5b5ef4; box-shadow: 0 2px 8px rgba(91,94,244,0.12); }
.sd-login-pane[hidden] { display: none; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.sd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: 100px; font-size: 0.92rem; font-weight: 600;
  cursor: pointer; border: none; font-family: inherit; text-decoration: none;
  transition: all 0.2s;
}
.sd-btn--primary { background: #5b5ef4; color: #fff; box-shadow: 0 4px 14px rgba(91,94,244,0.35); }
.sd-btn--primary:hover { background: #4a4dd8; transform: translateY(-1px); color: #fff; }
.sd-btn--ghost { background: #fff; color: #13132b; border: 1.5px solid rgba(91,94,244,0.2); }
.sd-btn--ghost:hover { border-color: #5b5ef4; color: #5b5ef4; }
.sd-btn--full { width: 100%; }
.sd-btn-link { color: #5b5ef4; text-decoration: none; font-size: 0.88rem; font-weight: 600; }
.sd-btn-link:hover { text-decoration: underline; }
.sd-btn--danger-hover:hover { border-color: #ef4444 !important; color: #ef4444 !important; }

/* ── Dashboard layout ─────────────────────────────────────────────────── */
/* Break out of the theme's narrow content column so the dashboard has room */
.sd-portal--auth {
  display: flex;
  gap: 0;
  min-height: 600px;
  border: 1px solid rgba(91,94,244,0.12);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(91,94,244,0.1);
  background: #fff;
  /* Widen to fill the full viewport width minus standard WP theme margins */
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  /* If the theme constrains the content column, escape it */
  position: relative;
}

.sd-sidebar {
  width: 260px; flex-shrink: 0; background: #f4f3ff; border-right: 1px solid rgba(91,94,244,0.10);
  padding: 24px 14px; display: flex; flex-direction: column; gap: 6px;
}
.sd-sidebar-user { display: flex; align-items: center; gap: 12px; padding: 0 8px 20px; border-bottom: 1px solid rgba(91,94,244,0.1); margin-bottom: 8px; }
/* Only the text column flexes/shrinks. Without :not(.sd-avatar-lg), flex:1
   stretches the 42×42 avatar into an oval whenever the sidebar narrows. */
.sd-sidebar-user > div:not(.sd-avatar-lg) { min-width: 0; flex: 1; }
.sd-avatar-lg {
  width: 42px; height: 42px; min-width: 42px;
  border-radius: 50%; background: linear-gradient(135deg, #5b5ef4, #8b8df6);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700; color: #fff; flex: 0 0 42px;
}
.sd-sidebar-name { font-weight: 700; font-size: 0.9rem; color: #13132b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sd-sidebar-email { font-size: 0.75rem; color: #5c5b7d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sd-sidebar-nav { display: flex; flex-direction: column; gap: 3px; }
.sd-nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; font-size: 0.88rem; font-weight: 500; color: #5c5b7d;
  text-decoration: none; transition: all 0.18s;
}
.sd-nav-item:hover { background: rgba(91,94,244,0.08); color: #5b5ef4; }
.sd-nav-item.active { background: rgba(91,94,244,0.1); color: #5b5ef4; font-weight: 700; border-left: 3px solid #5b5ef4; }
.sd-nav-logout { margin-top: auto; color: #9a98b8; }
.sd-nav-logout:hover { color: #ef4444; background: rgba(239,68,68,0.06); }

.sd-main { flex: 1; min-width: 0; padding: 36px 40px; overflow: auto; }
.sd-tab-header { margin-bottom: 28px; }
.sd-tab-header h2 { font-size: 1.4rem; font-weight: 700; color: #13132b; margin: 0 0 6px; }
.sd-tab-header p { color: #5c5b7d; margin: 0; font-size: 0.9rem; }

/* ── Status pills ─────────────────────────────────────────────────────── */
.sd-pill {
  display: inline-flex; align-items: center; padding: 3px 10px;
  border-radius: 100px; font-size: 0.72rem; font-weight: 700;
}
.sd-pill--green  { background: rgba(16,185,129,0.1); color: #10b981; border: 1px solid rgba(16,185,129,0.25); }
.sd-pill--amber  { background: rgba(245,158,11,0.1); color: #f59e0b; border: 1px solid rgba(245,158,11,0.25); }
.sd-pill--red    { background: rgba(239,68,68,0.08); color: #ef4444; border: 1px solid rgba(239,68,68,0.2); }
.sd-pill--blue   { background: rgba(91,94,244,0.08); color: #5b5ef4; border: 1px solid rgba(91,94,244,0.18); }

/* ── Overview cards ───────────────────────────────────────────────────── */
.sd-overview-grid { display: flex; flex-direction: column; gap: 16px; }
.sd-overview-card {
  background: #fff; border: 1.5px solid rgba(91,94,244,0.12); border-radius: 20px;
  padding: 24px 28px; transition: box-shadow 0.2s;
}
.sd-overview-card--green  { border-color: rgba(16,185,129,0.3); }
.sd-overview-card--amber  { border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.02); }
.sd-overview-card--red    { border-color: rgba(239,68,68,0.25); background: rgba(239,68,68,0.02); }
.sd-overview-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.sd-overview-product { font-size: 1.1rem; font-weight: 700; color: #13132b; margin: 0 0 8px; }
.sd-overview-meta { font-size: 0.85rem; color: #5c5b7d; display: flex; gap: 16px; flex-wrap: wrap; }
.sd-overview-actions { display: flex; gap: 16px; margin-top: 14px; }
.sd-days-ring {
  width: 68px; height: 68px; border-radius: 50%; border: 3px solid rgba(16,185,129,0.25);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(16,185,129,0.06); flex-shrink: 0;
}
.sd-days-num { font-size: 1.2rem; font-weight: 800; color: #10b981; line-height: 1; }
.sd-days-label { font-size: 0.62rem; font-weight: 600; color: #9a98b8; text-transform: uppercase; }
.sd-days-ring--lifetime { border-color: rgba(91,94,244,0.2); background: rgba(91,94,244,0.05); }

/* ── License cards ────────────────────────────────────────────────────── */
.sd-license-card {
  background: #fff; border: 1px solid rgba(91,94,244,0.12); border-radius: 20px;
  padding: 24px 28px; margin-bottom: 20px;
}
.sd-lc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.sd-lc-header h3 { font-size: 1.05rem; font-weight: 700; color: #13132b; margin: 0; }

.sd-site-limit { margin-bottom: 16px; }
.sd-site-limit-label { display: flex; justify-content: space-between; font-size: 0.85rem; margin-bottom: 8px; color: #5c5b7d; }
.sd-site-progress { height: 6px; background: #ecebfa; border-radius: 3px; overflow: hidden; }
.sd-site-progress-fill { height: 100%; background: linear-gradient(90deg, #5b5ef4, #8b8df6); border-radius: 3px; transition: width 0.4s; }
.sd-site-progress-fill.full { background: #f59e0b; }

.sd-sites-section h4 { font-size: 0.85rem; font-weight: 700; color: #9a98b8; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 10px; }
.sd-sites-list { display: flex; flex-direction: column; gap: 8px; }
.sd-site-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: #f4f3ff; border: 1px solid rgba(91,94,244,0.1); border-radius: 10px; }
.sd-domain { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; color: #2d2d4e; }
.sd-sites-empty p { color: #9a98b8; font-size: 0.88rem; font-style: italic; }
.sd-sites-full-msg { color: #f59e0b; font-size: 0.85rem; margin-top: 8px; }

/* ── Download cards ───────────────────────────────────────────────────── */
.sd-download-card { background: #fff; border: 1px solid rgba(91,94,244,0.12); border-radius: 20px; padding: 24px 28px; margin-bottom: 20px; }
.sd-dc-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sd-dc-header h3 { font-size: 1.05rem; font-weight: 700; color: #13132b; margin: 0; }
.sd-version-badge { font-family: 'JetBrains Mono', monospace; font-size: 0.78rem; background: rgba(91,94,244,0.08); color: #5b5ef4; border: 1px solid rgba(91,94,244,0.18); border-radius: 100px; padding: 2px 10px; margin-left: 8px; }
.sd-dc-meta { font-size: 0.82rem; color: #9a98b8; display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }

/* ── Billing cards ────────────────────────────────────────────────────── */
.sd-billing-card { background: #fff; border: 1px solid rgba(91,94,244,0.12); border-radius: 20px; padding: 24px 28px; margin-bottom: 20px; }
.sd-bc-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; }
.sd-bc-top h3 { font-size: 1.05rem; font-weight: 700; color: #13132b; margin: 0 0 5px; }
.sd-bc-plan { font-size: 0.85rem; color: #5c5b7d; }
.sd-bc-detail { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid rgba(91,94,244,0.08); padding-top: 14px; }
.sd-bc-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid rgba(91,94,244,0.06); font-size: 0.88rem; }
.sd-bc-row:last-child { border-bottom: none; }
.sd-bc-row span { color: #5c5b7d; }
.sd-bc-row strong { color: #13132b; }
.sd-bc-renew { margin-top: 16px; padding: 16px; background: rgba(239,68,68,0.04); border: 1px solid rgba(239,68,68,0.2); border-radius: 12px; }
.sd-bc-renew p { color: #ef4444; font-size: 0.88rem; margin: 0 0 12px; }

/* ── Invoice list ─────────────────────────────────────────────────────── */
.sd-invoices { margin-top: 28px; }
.sd-invoices h3 { font-size: 1rem; font-weight: 700; color: #13132b; margin: 0 0 14px; }
.sd-invoice-list { background: #fff; border: 1px solid rgba(91,94,244,0.1); border-radius: 16px; overflow: hidden; }
.sd-invoice-row { display: grid; grid-template-columns: 100px 1fr auto auto; gap: 14px; align-items: center; padding: 13px 18px; border-bottom: 1px solid rgba(91,94,244,0.06); font-size: 0.87rem; }
.sd-invoice-row:last-child { border-bottom: none; }
.sd-invoice-total { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; margin-top: 12px; background: rgba(91,94,244,0.06); border: 1px solid rgba(91,94,244,0.14); border-radius: 12px; font-size: 0.92rem; }
.sd-invoice-total strong { font-size: 1.05rem; color: #13132b; }

/* ── Notice / alerts ──────────────────────────────────────────────────── */
.sd-notice { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-radius: 12px; font-size: 0.9rem; font-weight: 500; margin-bottom: 20px; }
.sd-notice--success { background: rgba(16,185,129,0.08); border: 1px solid rgba(16,185,129,0.25); color: #065f46; }
.sd-notice--error   { background: rgba(239,68,68,0.06); border: 1px solid rgba(239,68,68,0.2); color: #991b1b; }

/* ── Misc ─────────────────────────────────────────────────────────────── */
.sd-muted { color: #9a98b8; }
.sd-login-purchase-cta { text-align: center; font-size: 0.82rem; color: #9a98b8; margin-top: 16px; }

/* ── Checkout / pricing shortcode ────────────────────────────────────── */
.sd-pricing-wrap { max-width: 960px; margin: 0 auto; }
.sd-pricing-toggle {
  display: flex; justify-content: center; gap: 6px; margin-bottom: 36px;
  background: #f4f3ff; border: 1px solid rgba(91,94,244,0.14);
  border-radius: 100px; padding: 5px; width: fit-content; margin: 0 auto 36px;
}
.sd-ptab {
  padding: 10px 24px; border-radius: 100px; border: none; cursor: pointer;
  font-size: 0.9rem; font-weight: 600; background: transparent; color: #5c5b7d;
  font-family: inherit; transition: all 0.18s;
}
.sd-ptab.active { background: #fff; color: #13132b; box-shadow: 0 2px 8px rgba(91,94,244,0.12); }
.sd-ptab-badge { background: rgba(16,185,129,0.12); color: #10b981; font-size: 0.68rem; padding: 2px 7px; border-radius: 100px; margin-left: 6px; }
.sd-pricing-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px; margin-top: 28px;
}
.sd-plan-card {
  background: #fff; border: 1.5px solid rgba(91,94,244,0.14); border-radius: 20px;
  padding: 32px 28px; text-align: center; transition: all 0.2s;
}
.sd-plan-card:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(91,94,244,0.14); border-color: #5b5ef4; }
.sd-plan-name { font-size: 1rem; font-weight: 700; color: #13132b; margin-bottom: 6px; }
.sd-plan-sites { font-size: 0.8rem; color: #5b5ef4; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; }
.sd-plan-price { font-size: 2.6rem; font-weight: 800; color: #13132b; line-height: 1; margin-bottom: 4px; }
.sd-plan-currency { font-size: 1.4rem; vertical-align: top; margin-top: 6px; display: inline-block; }
.sd-plan-period { font-size: 0.85rem; color: #9a98b8; font-weight: 400; }
.sd-plan-cta { margin-top: 24px; width: 100%; display: block; }
.sd-plan-no-price { font-size: 0.82rem; color: #9a98b8; margin-top: 16px; }
.sd-buy-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 28px; border-radius: 100px; background: #5b5ef4; color: #fff;
  font-size: 0.92rem; font-weight: 600; border: none; cursor: pointer;
  font-family: inherit; transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(91,94,244,0.35);
}
.sd-buy-btn:hover { background: #4a4dd8; transform: translateY(-1px); }
.sd-buy-btn--disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.sd-buy-btn--disabled:hover { background: #5b5ef4; transform: none; }

/* Sidebar nav: SVG icons sit cleanly next to the label */
.sd-nav-item svg { flex-shrink: 0; opacity: 0.85; }
.sd-nav-item.active svg { opacity: 1; }

/* License key display — masked by default, "Show" reveals */
.sd-key-wrap {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px;
}
.sd-key-box {
  flex: 1 1 280px; min-width: 0;
  background: #f4f3ff; border: 1px solid rgba(91,94,244,0.2); border-radius: 10px;
  padding: 12px 16px; font-family: 'JetBrains Mono', monospace; font-size: 13px;
  color: #5b5ef4; letter-spacing: 0.04em; word-break: break-all;
}
.sd-key-box .sd-muted { color: #9a98b8; font-family: 'DM Sans', sans-serif; letter-spacing: 0; }
.sd-key-toggle, .sd-key-copy {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px;
  font-size: 13px; white-space: nowrap;
}

/* Upgrade card at the bottom of each license */
.sd-lc-upgrade {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 20px; padding: 16px 20px;
  background: rgba(91,94,244,0.04);
  border: 1px solid rgba(91,94,244,0.15);
  border-radius: 12px; flex-wrap: wrap;
}
.sd-lc-upgrade strong { color: #13132b; font-size: 14px; }

/* Change-plan panel — inline, expands when "Change plan" is clicked */
.sd-change-panel {
  margin-top: 14px; padding: 18px 20px;
  background: #fff; border: 1px solid rgba(91,94,244,0.18);
  border-radius: 12px; box-shadow: 0 4px 16px rgba(91,94,244,0.06);
}
.sd-change-heading {
  font-size: 13px; font-weight: 700; color: #13132b;
  text-transform: uppercase; letter-spacing: 0.08em;
  margin: 0 0 14px;
}
.sd-change-plan-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-top: 1px solid rgba(91,94,244,0.08); flex-wrap: wrap;
}
.sd-change-plan-row:first-of-type { border-top: 0; padding-top: 0; }
.sd-change-plan-row.is-current { opacity: 0.65; }
.sd-change-plan-info { flex: 1 1 280px; min-width: 0; }
.sd-change-plan-name {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; color: #13132b; font-size: 15px; margin-bottom: 4px;
}
.sd-change-plan-meta { font-size: 13px; color: #5c5b7d; }
.sd-change-plan-meta strong { color: #13132b; }
.sd-change-plan-proration { font-size: 13px; color: #5c5b7d; margin-top: 6px; }
.sd-change-plan-proration strong { color: #5b5ef4; }
.sd-change-plan-proration .sd-muted { display: block; margin-top: 2px; font-size: 12px; }

/* Empty state — no emoji, just clean text */
.sd-empty-state {
  text-align: center; padding: 60px 24px; background: #fff;
  border: 1px dashed rgba(91,94,244,0.2); border-radius: 16px;
}
.sd-empty-state h3 { font-size: 18px; color: #13132b; margin: 0 0 6px; }
.sd-empty-state p { color: #5c5b7d; margin: 0 0 20px; }

/* Deactivate-site button: tight square with the X icon */
.sd-deactivate-site {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border-radius: 8px;
}

/* Inline messaging for shortcode failure modes (visible to admins primarily). */
.sd-buy-error {
  color: #ef4444; font-size: 0.9rem; line-height: 1.5;
  border: 1px solid rgba(239,68,68,0.3); background: rgba(239,68,68,0.05);
  padding: 10px 14px; border-radius: 8px;
}
.sd-buy-admin-warn {
  color: #92400e; font-size: 0.82rem; line-height: 1.5; margin-top: 6px;
  border: 1px solid rgba(245,158,11,0.3); background: rgba(245,158,11,0.1);
  padding: 10px 14px; border-radius: 8px;
}

/* Floating Paddle error toast (shown when checkout fails). */
.sd-paddle-error-toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 99999;
  background: #fff; border: 2px solid #ef4444; border-radius: 12px;
  padding: 16px 20px; max-width: 420px; font-size: 13px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.sd-paddle-error-toast strong { color: #ef4444; }
.sd-paddle-error-toast code { font-size: 11px; word-break: break-all; }
.sd-paddle-error-toast small { color: #9a98b8; }

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sd-portal--auth { flex-direction: column; }
  .sd-sidebar { width: auto; flex-direction: row; flex-wrap: wrap; padding: 14px; gap: 4px; }
  .sd-sidebar-user { display: none; }
  .sd-sidebar-nav { flex-direction: row; flex-wrap: wrap; }
  .sd-nav-item { padding: 8px 12px; font-size: 0.8rem; }
  .sd-main { padding: 20px 18px; }
  .sd-dc-header, .sd-bc-top { flex-direction: column; gap: 12px; }
  .sd-invoice-row { grid-template-columns: 1fr 1fr; }
}
