/* PaxDesign Auth — login/register forms (exact provided design) + account dashboard */

/* ─── Auth bar (header login / account) ─────────────────── */
#pdx-auth-bar {
  position: fixed;
  top: max(10px, env(safe-area-inset-top, 10px));
  right: max(12px, env(safe-area-inset-right, 12px));
  z-index: 99995;
  display: flex;
  align-items: center;
}

#pdx-auth-bar.pdx-auth-bar--header {
  position: absolute;
  top: 50%;
  right: max(12px, env(safe-area-inset-right, 12px));
  transform: translateY(-50%);
  margin: 0;
}

body.admin-bar #pdx-auth-bar:not(.pdx-auth-bar--header) {
  top: calc(32px + max(10px, env(safe-area-inset-top, 10px)));
}

@media screen and (max-width: 782px) {
  body.admin-bar #pdx-auth-bar:not(.pdx-auth-bar--header) {
    top: calc(46px + max(8px, env(safe-area-inset-top, 8px)));
  }
}

.pdx-auth-bar-inner {
  position: relative;
}

.pdx-auth-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: #e8e8e8;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pdx-auth-trigger:hover,
.pdx-auth-trigger:focus {
  border-color: rgba(255, 224, 166, 0.35);
  background: rgba(255, 224, 166, 0.08);
  outline: none;
}

.pdx-auth-trigger-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #ffe0a6;
}

.pdx-auth-trigger-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.pdx-auth-trigger-label {
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdx-auth-trigger--logged-in .pdx-auth-trigger-label {
  max-width: 110px;
}

.pdx-auth-menu-status {
  flex-wrap: wrap;
}

.pdx-auth-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  padding: 10px;
  z-index: 3;
  display: none;
}

.pdx-auth-menu.is-open {
  display: block;
}

.pdx-auth-menu-head {
  padding: 4px 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 6px;
}

.pdx-auth-menu-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.pdx-auth-menu-email {
  font-size: 11px;
  color: #9a9a9a;
  word-break: break-all;
  margin-bottom: 4px;
}

.pdx-auth-menu-status {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffe0a6;
}

.pdx-auth-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pdx-auth-menu-item {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #ddd;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.pdx-auth-menu-item:hover {
  background: rgba(255, 224, 166, 0.08);
  color: #ffe0a6;
}

.pdx-auth-menu-item--logout {
  color: #aaa;
}

@media (max-width: 768px) {
  #pdx-auth-bar.pdx-auth-bar--header {
    position: fixed;
    top: max(10px, env(safe-area-inset-top, 10px));
    right: max(56px, calc(env(safe-area-inset-right, 12px) + 44px));
    transform: none;
  }

  body.admin-bar #pdx-auth-bar.pdx-auth-bar--header {
    top: calc(46px + max(8px, env(safe-area-inset-top, 8px)));
  }

  .pdx-auth-trigger {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  .pdx-auth-trigger-label {
    display: none;
  }
}

@media (min-width: 769px) {
  #pdx-auth-bar:not(.pdx-auth-bar--header) .pdx-auth-trigger-label {
    display: inline;
  }
}

/* Profile overlay */
#pdx-profile-overlay {
  position: fixed;
  inset: 0;
  z-index: 100011;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  padding: 16px;
}

#pdx-profile-overlay.is-open {
  display: flex;
}

.pdx-profile-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
}

.pdx-profile-card-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 14px;
}

.pdx-profile-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pdx-profile-label {
  font-size: 11px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pdx-profile-value {
  font-size: 13px;
  color: #eee;
  text-align: right;
  word-break: break-word;
}

.pdx-profile-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.pdx-error--premium {
  border: 1px solid rgba(255, 224, 166, 0.25);
  color: #ffe0a6;
}

/* ─── Auth overlay ───────────────────────────────────────── */
#pdx-auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 100010;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  padding: 20px;
}

#pdx-auth-overlay.is-open {
  display: flex;
}

.pdx-auth-wrapper {
  width: 100%;
  max-width: 420px;
  display: grid;
  place-content: center;
  background: black;
  position: relative;
}

.pdx-auth-form {
  padding: 1.9rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.25rem;
  border: 1px solid transparent;
  border-image: linear-gradient(transparent, #ffe0a6, transparent) 1;
  border-width: 0 2px 0 2px;
  background:
    radial-gradient(100% 61.73% at 100% 50%, rgba(255, 224, 166, 0.03) 0%, transparent 100%),
    radial-gradient(91.09% 56.23% at 0% 50%, rgba(255, 224, 166, 0.03) 0%, transparent 100%);
  position: relative;
  width: 100%;
  box-sizing: border-box;
  isolation: isolate;
}

.pdx-auth-form::before,
.pdx-auth-form::after {
  content: "";
  position: absolute;
  border: inherit;
  z-index: -1;
}

.pdx-auth-form::before {
  inset: -0.6rem;
  opacity: 8%;
}

.pdx-auth-form::after {
  inset: -1rem;
  opacity: 0;
}

.pdx-auth-form .pdx-auth-title {
  color: white;
  font-size: 1.55rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.42rem;
  text-transform: uppercase;
  background: linear-gradient(rgb(170, 170, 170), rgb(78, 78, 78));
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  margin: 0;
}

.pdx-auth-msg-slot {
  width: 100%;
  min-height: 0;
}

.pdx-auth-msg-slot:not(:empty) {
  margin-bottom: 0.15rem;
}

.pdx-auth-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  position: relative;
  z-index: 2;
}

.pdx-auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  position: relative;
  z-index: 1;
}

.pdx-auth-field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #9a9a9a;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
  position: relative;
  z-index: 2;
  pointer-events: auto;
}

.pdx-auth-field--error .pdx-auth-field-label {
  color: #d4a574;
}

.pdx-auth-field--error .pdx-auth-input-container {
  border-image: radial-gradient(circle, rgba(212, 165, 116, 0.8) 0%, rgba(0, 0, 0, 0) 100%) 1;
}

.pdx-auth-input-container {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  background: radial-gradient(47.3% 73.08% at 50% 94.23%, rgba(255, 255, 255, 0.1) 5%, rgba(0, 0, 0, 0) 100%);
  border: 1px solid transparent;
  border-image: radial-gradient(circle, rgba(255, 255, 255, 0.445) 0%, rgba(0, 0, 0, 0) 100%) 1;
  border-width: 0 0 1px 0;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

.pdx-auth-input-container svg {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin-left: 4px;
}

.pdx-auth-input-container svg g {
  transition: all 0.2s ease-in-out;
}

.pdx-auth-input-container .pdx-auth-input {
  background: none;
  border: none;
  padding: 0.65rem 1rem;
  color: white;
  width: 100%;
  min-width: 0;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}

.pdx-auth-input-container .pdx-auth-input:focus {
  outline: none;
  color: #ffe0a6;
}

.pdx-auth-input-container:focus-within {
  background: radial-gradient(47.3% 73.08% at 50% 94.23%, rgba(255, 224, 166, 0.1) 5%, rgba(0, 0, 0, 0) 100%);
  border-image: radial-gradient(circle, #ffe0a6 0%, transparent 100%) 1;
}

.pdx-auth-input-container:focus-within svg g {
  stroke: #ffe0a6;
}

.pdx-auth-submit-wrap {
  width: 100%;
  position: relative;
  z-index: 2;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.pdx-auth-submit-wrap .pdx-auth-submit {
  cursor: pointer;
  padding: 1rem;
  width: 100%;
  background: linear-gradient(180deg, rgba(255, 224, 166, 0.13) 0%, rgba(255, 224, 166, 0.04) 100%);
  border: 1px solid transparent;
  border-image: linear-gradient(transparent, #ffe0a6, transparent) 1;
  border-width: 0 1px 0 1px;
  text-align: center;
  color: #ffe0a6;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
}

.pdx-auth-submit-wrap::before {
  content: none;
}

.pdx-auth-submit-wrap:hover {
  filter: brightness(108%);
  transform: translateY(-1px);
}

.pdx-auth-submit-wrap:active {
  transform: translateY(0);
}

.pdx-auth-texture {
  position: absolute;
  background-image: linear-gradient(0deg, #ffffff 1px, transparent 1px);
  background-size: 1px 5px;
  inset: 0;
  mix-blend-mode: normal;
  mask-image:
    radial-gradient(30% 45% at 100% 50%, white 0%, transparent 100%),
    radial-gradient(30% 45% at 0% 50%, white 0%, transparent 100%);
  pointer-events: none;
  animation: none;
  opacity: 0.06;
  z-index: 0;
}

.pdx-auth-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  text-align: center;
  position: relative;
  z-index: 2;
}

.pdx-auth-link {
  background: none;
  border: none;
  color: #8b8b8b;
  font-size: 12px;
  cursor: pointer;
  padding: 4px;
  font-family: inherit;
  transition: color 0.15s;
}

.pdx-auth-link:hover {
  color: #ffe0a6;
}

.pdx-auth-message {
  width: 100%;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.pdx-auth-message--error {
  background: rgba(136, 136, 136, 0.15);
  color: #ccc;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pdx-auth-message--success {
  background: rgba(255, 224, 166, 0.08);
  color: #ffe0a6;
  border: 1px solid rgba(255, 224, 166, 0.2);
}

.pdx-auth-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: #555;
  font-size: 22px;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
  padding: 4px 8px;
}

.pdx-auth-close:hover {
  color: #ffe0a6;
}

@media (max-width: 768px) {
  #pdx-auth-overlay {
    padding: 16px;
    align-items: flex-start;
    overflow-y: auto;
  }

  .pdx-auth-wrapper {
    max-width: 100%;
    margin: auto 0;
  }

  .pdx-auth-form {
    padding: 1.5rem 1.35rem;
    gap: 1.1rem;
  }

  .pdx-auth-form .pdx-auth-title {
    font-size: 1.35rem;
    letter-spacing: 0.28rem;
  }

  .pdx-auth-fields {
    gap: 0.85rem;
  }
}

@media (max-width: 480px) {
  #pdx-auth-overlay {
    padding: 12px;
  }

  .pdx-auth-form {
    padding: 1.25rem 1rem;
  }

  .pdx-auth-form .pdx-auth-title {
    font-size: 1.2rem;
    letter-spacing: 0.2rem;
  }

  .pdx-auth-input-container .pdx-auth-input {
    font-size: 16px;
  }
}

@keyframes pdx-auth-flicker {
  0% { filter: brightness(100%); }
  10% { filter: brightness(80%); }
  20% { filter: brightness(120%); }
  30% { filter: brightness(90%); }
  40% { filter: brightness(110%); }
  50% { filter: brightness(100%); }
  60% { filter: brightness(85%); }
  70% { filter: brightness(95%); }
  80% { filter: brightness(105%); }
  90% { filter: brightness(115%); }
  100% { filter: brightness(100%); }
}

@keyframes pdx-auth-moving-lines {
  0% { background-position: 0 0; }
  100% { background-position: 0 5px; }
}

/* ─── Account dashboard (inside panel) ───────────────────── */
.pdx-account-dash {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 100%;
}

.pdx-account-nav {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  flex-shrink: 0;
}

.pdx-account-nav-btn {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #8b8b8b;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all 0.15s;
}

.pdx-account-nav-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.pdx-account-nav-btn.is-active {
  color: #ffe0a6;
  border-color: rgba(255, 224, 166, 0.35);
  background: rgba(255, 224, 166, 0.06);
}

.pdx-account-section {
  padding: 16px 20px;
  display: none;
}

.pdx-account-section.is-active {
  display: block;
}

.pdx-account-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}

.pdx-account-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.pdx-account-profile-head {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 10px;
}

.pdx-account-field {
  margin-bottom: 12px;
}

.pdx-account-field label {
  display: block;
  font-size: 11px;
  color: #8b8b8b;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pdx-account-field input {
  width: 100%;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
}

.pdx-account-field input:focus {
  outline: none;
  border-color: rgba(255, 224, 166, 0.4);
}

.pdx-account-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.pdx-account-status--verified {
  background: rgba(255, 224, 166, 0.1);
  color: #ffe0a6;
  border: 1px solid rgba(255, 224, 166, 0.25);
}

.pdx-account-status--pending {
  background: rgba(126, 126, 126, 0.15);
  color: #aaa;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pdx-api-key-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pdx-api-key-row:last-child {
  border-bottom: none;
}

.pdx-api-key-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.pdx-api-key-label {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.pdx-api-key-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 4px;
}

.pdx-api-key-status--connected,
.pdx-api-key-status--active {
  background: rgba(255, 224, 166, 0.12);
  color: #ffe0a6;
}

.pdx-api-key-status--disconnected {
  background: rgba(85, 85, 85, 0.2);
  color: #888;
}

.pdx-api-key-status--error {
  background: rgba(136, 136, 136, 0.2);
  color: #aaa;
}

.pdx-api-key-status--site_default {
  background: rgba(139, 139, 139, 0.15);
  color: #8b8b8b;
}

.pdx-api-key-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pdx-api-key-actions input {
  flex: 1;
  min-width: 160px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  font-family: inherit;
}

.pdx-account-btn {
  padding: 8px 14px;
  background: rgba(255, 224, 166, 0.08);
  border: 1px solid rgba(255, 224, 166, 0.25);
  border-radius: 6px;
  color: #ffe0a6;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: background 0.15s;
}

.pdx-account-btn:hover {
  background: rgba(255, 224, 166, 0.15);
}

.pdx-account-btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.12);
  color: #8b8b8b;
}

.pdx-account-btn--ghost:hover {
  color: #fff;
}

.pdx-license-placeholder {
  padding: 24px;
  text-align: center;
  color: #8b8b8b;
  font-size: 13px;
  line-height: 1.6;
}

.pdx-license-placeholder strong {
  color: #ffe0a6;
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
}

.pdx-auth-gate {
  padding: 32px 24px;
  text-align: center;
}

.pdx-auth-gate-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.pdx-auth-gate-desc {
  font-size: 13px;
  color: #8b8b8b;
  line-height: 1.5;
  margin-bottom: 20px;
}

/* Customer account — purchases, invoices, subscription */
.pdx-account-empty {
  font-size: 13px;
  color: #8b8b8b;
  line-height: 1.5;
  margin: 0;
}

.pdx-order-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pdx-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.pdx-order-row:last-child {
  border-bottom: none;
}

.pdx-order-product {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}

.pdx-order-meta {
  font-size: 11px;
  color: #777;
  margin-top: 2px;
}

.pdx-invoice-table-wrap {
  overflow-x: auto;
}

.pdx-invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.pdx-invoice-table th,
.pdx-invoice-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  vertical-align: middle;
}

.pdx-invoice-table th {
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
}

.pdx-invoice-actions {
  white-space: nowrap;
}

.pdx-pay-status {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.pdx-pay-status--paid {
  background: rgba(255, 224, 166, 0.12);
  color: #ffe0a6;
}

.pdx-pay-status--pending {
  background: rgba(126, 126, 126, 0.15);
  color: #aaa;
}

.pdx-pay-status--failed,
.pdx-pay-status--refunded {
  background: rgba(85, 85, 85, 0.2);
  color: #999;
}

.pdx-order-detail {
  font-size: 12px;
  color: #bbb;
  line-height: 1.6;
  padding: 8px 0;
}

.pdx-sub-summary {
  margin-top: 4px;
}

@media (max-width: 680px) {
  .pdx-invoice-table th:nth-child(2),
  .pdx-invoice-table td:nth-child(2) {
    display: none;
  }
}
