/* Shared layout styling */
.text-center {
  text-align: center;
}

.full-w {
  width: 100%;
}
/* Spacing utilities */
.m-0 {
  margin: 0;
}
.m-1 {
  margin: 0.25rem;
}
.m-2 {
  margin: 0.5rem;
}
.m-3 {
  margin: 1rem;
}
.m-4 {
  margin: 1.5rem;
}

.mt-0 {
  margin-top: 0;
}
.mt-1 {
  margin-top: 0.25rem;
}
.mt-2 {
  margin-top: 0.5rem;
}
.mt-3 {
  margin-top: 1rem;
}
.mt-4 {
  margin-top: 1.5rem;
}

.mr-0 {
  margin-right: 0;
}
.mr-1 {
  margin-right: 0.25rem;
}
.mr-2 {
  margin-right: 0.5rem;
}
.mr-3 {
  margin-right: 1rem;
}
.mr-4 {
  margin-right: 1.5rem;
}

.mb-0 {
  margin-bottom: 0;
}
.mb-1 {
  margin-bottom: 0.25rem;
}
.mb-2 {
  margin-bottom: 0.5rem;
}
.mb-3 {
  margin-bottom: 1rem;
}
.mb-4 {
  margin-bottom: 1.5rem;
}

.ml-0 {
  margin-left: 0;
}
.ml-1 {
  margin-left: 0.25rem;
}
.ml-2 {
  margin-left: 0.5rem;
}
.ml-3 {
  margin-left: 1rem;
}
.ml-4 {
  margin-left: 1.5rem;
}

.p-0 {
  padding: 0;
}
.p-1 {
  padding: 0.25rem;
}
.p-2 {
  padding: 0.5rem;
}
.p-3 {
  padding: 1rem;
}
.p-4 {
  padding: 1.5rem;
}

.pt-0 {
  padding-top: 0;
}
.pt-1 {
  padding-top: 0.25rem;
}
.pt-2 {
  padding-top: 0.5rem;
}
.pt-3 {
  padding-top: 1rem;
}
.pt-4 {
  padding-top: 1.5rem;
}

.pr-0 {
  padding-right: 0;
}
.pr-1 {
  padding-right: 0.25rem;
}
.pr-2 {
  padding-right: 0.5rem;
}
.pr-3 {
  padding-right: 1rem;
}
.pr-4 {
  padding-right: 1.5rem;
}

.pb-0 {
  padding-bottom: 0;
}
.pb-1 {
  padding-bottom: 0.25rem;
}
.pb-2 {
  padding-bottom: 0.5rem;
}
.pb-3 {
  padding-bottom: 1rem;
}
.pb-4 {
  padding-bottom: 1.5rem;
}

.pl-0 {
  padding-left: 0;
}
.pl-1 {
  padding-left: 0.25rem;
}
.pl-2 {
  padding-left: 0.5rem;
}
.pl-3 {
  padding-left: 1rem;
}
.pl-4 {
  padding-left: 1.5rem;
}

/* Flex utilities */
.flex {
  display: flex;
}
.inline-flex {
  display: inline-flex;
}
.flex-row {
  flex-direction: row;
}
.flex-col {
  flex-direction: column;
}
.flex-wrap {
  flex-wrap: wrap;
}
.items-start {
  align-items: flex-start;
}
.items-center {
  align-items: center;
}
.items-end {
  align-items: flex-end;
}
.justify-start {
  justify-content: flex-start;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.justify-around {
  justify-content: space-around;
}
.justify-end {
  justify-content: flex-end;
}
.gap-0 {
  gap: 0;
}
.gap-1 {
  gap: 0.25rem;
}
.gap-2 {
  gap: 0.5rem;
}
.gap-3 {
  gap: 1rem;
}
.gap-4 {
  gap: 1.5rem;
}
.gap-x-0 {
  column-gap: 0;
}
.gap-x-1 {
  column-gap: 0.25rem;
}
.gap-x-2 {
  column-gap: 0.5rem;
}
.gap-x-3 {
  column-gap: 1rem;
}
.gap-x-4 {
  column-gap: 1.5rem;
}
.gap-y-0 {
  row-gap: 0;
}
.gap-y-1 {
  row-gap: 0.25rem;
}
.gap-y-2 {
  row-gap: 0.5rem;
}
.gap-y-3 {
  row-gap: 1rem;
}
.gap-y-4 {
  row-gap: 1.5rem;
}

.self-end {
  align-self: flex-end;
}

.list {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.list-none-style {
  list-style-type: none;
  padding-left: 0;
}

.text-small {
  font-size: 0.875rem;
  line-height: 1.6;
  margin-top: 1rem;
  margin-bottom: 1rem;
}

.flash {
  padding: 0.75rem 1rem;
  border-radius: 6px;
}

.flash ul {
  margin-bottom: 0;
  list-style-type: none;
}

.flash.info {
  background: #e0f2fe;
  color: #075985;
}

.flash.error {
  background: #fee2e2;
  color: #991b1b;
}

.full-height {
  height: 100%;
}

.shell {
  width: calc(100% - 2rem);
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.main-wrapper {
  background: #fff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  width: 100%;
  max-width: 960px;
  margin: 2rem auto;
}

.main-wrapper.auth {
  max-width: 520px;
}

.auth-card form {
  margin: 1rem 0;
}

.user-menu {
  position: relative;
  display: inline-block;
  color: #e5e7eb;
}

.user-menu summary {
  list-style: none;
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-menu summary::after {
  content: "▾";
  font-size: 0.8rem;
  color: #cbd5e1;
}

.user-menu summary:focus {
  outline: 2px solid #93c5fd;
}

.user-menu .menu {
  position: absolute;
  right: 0;
  top: 110%;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 0.5rem;
  min-width: 160px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
  display: none;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 20;
}

.user-menu details[open] .menu {
  display: flex;
}

.user-menu .menu a,
.user-menu .menu button {
  color: #e5e7eb;
  text-decoration: none;
  background: transparent;
  border: none;
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  font-size: 0.875rem;
}

.user-menu .menu a:hover,
.user-menu .menu button:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* ================================================
   P4PDF - Pure CSS Styles for .NET MVC
   ================================================ */

/* CSS Variables */
:root {
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-hero-bg: #0f172a;
  --color-hero-foreground: #ffffff;
  --color-hero-muted: #94a3b8;
  --color-code-bg: #1e293b;
  --color-code-accent: #38bdf8;
  --color-code-string: #34d399;
  --color-card-bg: #ffffff;
  --color-card-border: #e2e8f0;
  --color-text: #0f172a;
  --color-text-muted: #64748b;
  --color-secondary-bg: #f1f5f9;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", Consolas, monospace;
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  --transition: 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ================================================
   HEADER
   ================================================ */
.header {
  background-color: var(--color-hero-bg);
  color: var(--color-hero-foreground);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.header-logo {
  text-decoration: none;
  color: white;
  width: 320px;
  height: 100%;
  padding: 0.75rem 0;
}

.header-logo > div:first-of-type {
  user-select: none;
  display: flex;
  gap: 0.5rem;
  width: 320px;
}

.header-logo-icon {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-lg);
  background-color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-logo-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  color: white;
}

.header-logo-text {
  display: flex;
  flex-direction: column;
}

.header-logo-name {
  font-weight: 700;
  color: white;
  line-height: 1;
  font-size: 1rem;
}

.header-logo-subtitle {
  font-size: 0.75rem;
  color: var(--color-hero-muted);
  line-height: 1;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header-nav a {
  font-size: 0.875rem;
  color: var(--color-hero-muted);
  transition: color var(--transition);
}

.header-nav a:hover {
  color: white;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.875rem;
  color: var(--color-hero-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.header-user:hover {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
}

.header-user svg {
  width: 1rem;
  height: 1rem;
}

/* Mobile nav hidden by default */
@media (max-width: 768px) {
  .header-nav {
    display: none;
  }
}

/* ================================================
   HERO SECTION
   ================================================ */
.hero {
  background-color: var(--color-hero-bg);
  color: var(--color-hero-foreground);
}

.hero-container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }

  .hero-container {
    padding: 7rem 1.5rem;
  }
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.875rem;
  font-weight: 500;
  width: fit-content;
}

.hero-badge svg {
  width: 1rem;
  height: 1rem;
  color: var(--color-code-accent);
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.1;
  text-wrap: balance;
}

@media (min-width: 1024px) {
  .hero-title {
    font-size: 3rem;
  }
}

@media (min-width: 1280px) {
  .hero-title {
    font-size: 3.75rem;
  }
}

.hero-description {
  font-size: 1.125rem;
  color: var(--color-hero-muted);
  line-height: 1.7;
  max-width: 32rem;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  height: 2.5rem;
}

.btn svg {
  width: 1rem;
  height: 1rem;
}

.btn-primary {
  padding: 0.75rem 1.1rem;
  background-color: var(--color-primary);
  color: #fff;
  transition: background-color var(--transition), box-shadow var(--transition);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
}

.btn-disabled {
  background-color: #6c757d;
  color: #fff;
  cursor: not-allowed;
}

.btn-disabled:hover {
  background-color: #6c757d;
}

.btn-secondary {
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  background-color: var(--color-card-bg);
  color: var(--color-text);
  border: 1px solid var(--color-card-border);
}

.btn-secondary:hover {
  background-color: var(--color-secondary-bg);
  border-color: rgba(37, 99, 235, 0.3);
}

.btn-outline {
  background-color: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-outline:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.btn-small {
  padding: 0.375rem 0.75rem;
  height: 2rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
}

.btn-template-builder-field {
  height: 1rem;
  border-radius: var(--radius-sm) !important;
  font-size: 0.5rem;
  font-weight: 400;
  margin: 0;
  padding: 0.1rem 0.4rem;
}

.btn-danger {
  background-color: #ef4444;
  color: #fff;
  transition: background-color var(--transition), box-shadow var(--transition);
}

.btn--warning:hover {
  background-color: rgba(234, 179, 8, 0.1);
  border-color: #ca8a04;
  color: #ca8a04;
}

.btn-error:hover {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: #dc2626;
  color: #dc2626;
}

/* Code block */
.hero-code {
  background-color: var(--color-code-bg);
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  box-shadow: var(--shadow-2xl);
}

.hero-code-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.hero-code-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
}

.hero-code-dot--red {
  background-color: rgba(239, 68, 68, 0.8);
}
.hero-code-dot--yellow {
  background-color: rgba(234, 179, 8, 0.8);
}
.hero-code-dot--green {
  background-color: rgba(34, 197, 94, 0.8);
}

.hero-code-label {
  margin-left: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-hero-muted);
}

.hero-code pre {
  color: var(--color-hero-muted);
  overflow-x: auto;
  margin: 0;
  white-space: pre;
}

.hero-code .code-accent {
  color: var(--color-code-accent);
}

.hero-code .code-dim {
  color: rgba(255, 255, 255, 0.5);
}

.hero-code .code-string {
  color: var(--color-code-string);
}

.hero-code .code-white {
  color: white;
}

.hero-code-footer {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--color-hero-muted);
}

/* ================================================
   FEATURES SECTION
   ================================================ */
.features {
  max-width: 72rem;
  margin: 0 auto;
  padding: 5rem 1.5rem;
}

@media (min-width: 1024px) {
  .features {
    padding: 7rem 1.5rem;
  }
}

.features-groups {
  display: flex;
  flex-direction: column;
  gap: 5rem;
}

.feature-group {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.feature-group-header {
  max-width: 42rem;
}

.feature-group-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1rem;
  text-wrap: balance;
}

@media (min-width: 1024px) {
  .feature-group-title {
    font-size: 1.875rem;
  }
}

.feature-group-description {
  color: var(--color-text-muted);
  line-height: 1.7;
}

.feature-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 768px) {
  .feature-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.feature-card {
  padding: 1.5rem;
  border-radius: var(--radius-2xl);
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  transition: all 300ms ease;
}

.feature-card:hover {
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.05);
}

.feature-card-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-xl);
  background-color: var(--color-secondary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  transition: background-color var(--transition);
}

.feature-card:hover .feature-card-icon {
  background-color: rgba(37, 99, 235, 0.1);
}

.feature-card-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--color-primary);
}

.feature-card-title {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.feature-card-description {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.code-block {
  font-size: 0.9rem;
  word-break: break-all;
  color: white;
  background: #353535;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
}

/* Pricing */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  align-items: stretch;
  margin-top: 1.5rem;
}

.pricing-card {
  background: #f8fafc;
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.pricing-card--highlight {
  background: #eef2ff;
  border-color: #c7d2fe;
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.12);
}

.pricing-title {
  margin: 0 0 0.25rem;
}

.pricing-description {
  margin: 0 0 0.75rem;
}

.pricing-price {
  font-size: 2rem;
  font-weight: 800;
  margin: 0;
}

.pricing-note {
  margin: 0 0 1rem;
}

/* ================================================
   FOOTER
   ================================================ */
.footer {
  background-color: var(--color-hero-bg);
  color: var(--color-hero-foreground);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-company {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-logo-icon {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-lg);
  background-color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-logo-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  color: white;
}

.footer-logo-name {
  font-weight: 700;
  color: white;
}

.footer-company-text {
  font-size: 0.875rem;
  color: var(--color-hero-muted);
  line-height: 1.7;
}

.footer-contact-label {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
}

.footer-contact-email {
  font-size: 0.875rem;
  color: var(--color-hero-muted);
  transition: color var(--transition);
}

.footer-contact-email:hover {
  color: white;
}

.footer-links-section h4 {
  font-weight: 600;
  color: white;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  font-size: 0.875rem;
  color: var(--color-hero-muted);
  transition: color var(--transition);
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

.footer-copyright {
  font-size: 0.875rem;
  color: var(--color-hero-muted);
}

.footer-social {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.footer-social a {
  font-size: 0.875rem;
  color: var(--color-hero-muted);
  transition: color var(--transition);
}

.footer-social a:hover {
  color: white;
}

.content-box-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
}

/* ================================================
   BILLING PAGE
   ================================================ */

.billing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .billing-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Credits Card */
.card {
  padding: 1.75rem;
  border-radius: var(--radius-2xl);
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
}

.card-sm {
  padding: 0.65rem;
  border-radius: var(--radius-sm);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.billing-credits-remaining {
  margin-bottom: 0.25rem;
}

.billing-credits-remaining strong {
  font-weight: 600;
}

.billing-credits-note {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.billing-pricing-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.75rem;
}

.billing-pricing-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.billing-pricing-item {
  font-size: 0.9375rem;
  color: var(--color-text);
}

.billing-pricing-item .discount {
  font-weight: 600;
  color: var(--color-primary);
}

/* Buy Credits Card */
.billing-buy-description {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.billing-buy-label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.billing-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.billing-option {
  position: relative;
}

.billing-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.billing-option-label {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-card-border);
  background-color: var(--color-card-bg);
  cursor: pointer;
  transition: all var(--transition);
}

.billing-option-label:hover {
  border-color: rgba(37, 99, 235, 0.3);
}

.billing-option input[type="radio"]:checked + .billing-option-label {
  border-color: var(--color-primary);
  background-color: rgba(37, 99, 235, 0.02);
}

.billing-option-radio {
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  border: 2px solid var(--color-card-border);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.billing-option
  input[type="radio"]:checked
  + .billing-option-label
  .billing-option-radio {
  border-color: var(--color-primary);
}

.billing-option
  input[type="radio"]:checked
  + .billing-option-label
  .billing-option-radio::after {
  content: "";
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background-color: var(--color-primary);
}

.billing-option-credits {
  font-weight: 600;
  color: var(--color-text);
  font-size: 0.9375rem;
}

.billing-option-price {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-top: 0.125rem;
}

.billing-option-discount {
  font-size: 0.75rem;
  color: var(--color-primary);
  font-weight: 500;
  margin-top: 0.25rem;
}

.billing-payment-note {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.muted {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.muted a,
span a {
  color: var(--color-primary);
  text-decoration: underline;
}

.muted a:hover,
span a:hover {
  text-decoration: none;
}

input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  cursor: pointer;
  transition: all var(--transition);
  margin-right: 0.5rem;
}

/* Invoices Table */
.billing-invoices {
  margin-top: 2rem;
}

.billing-invoices-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-card-border);
  background-color: var(--color-card-bg);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.table th,
.table td {
  text-align: left;
  padding: 1rem 1.25rem;
}

.table th {
  font-weight: 600;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-card-border);
  background-color: var(--color-secondary-bg);
}

.table th:first-child {
  border-top-left-radius: var(--radius-xl);
}

.table th:last-child {
  border-top-right-radius: var(--radius-xl);
}

.table td {
  color: var(--color-text);
  border-bottom: 1px solid var(--color-card-border);
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background-color: rgba(37, 99, 235, 0.02);
}

.billing-status {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
}

.billing-status--paid {
  background-color: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.billing-status--pending {
  background-color: rgba(234, 179, 8, 0.1);
  color: #ca8a04;
}

.billing-download-link {
  color: var(--color-primary);
  font-weight: 500;
  transition: color var(--transition);
}

.billing-download-link:hover {
  color: var(--color-primary-hover);
  text-decoration: underline;
}

.tokens {
  max-width: 72rem;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.tokens-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 2rem;
}

/* Issue Token Form */
.tokens-form {
  background-color: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-2xl);
  padding: 1.75rem;
  margin-bottom: 2.5rem;
}

.tokens-form-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 1.5rem;
}

.tokens-form-row {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
  .tokens-form-row {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}

.form-group,
.tokens-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
}

.form-group-sm {
  gap: 0.25rem;
}

.tokens-form-group--inline,
.form-group--inline {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.tokens-label,
.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
}

.form-label-sm {
  font-size: 0.8125rem;
}

.tokens-input,
.form-input {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-family: var(--font-sans);
  color: var(--color-text);
  background-color: var(--color-card-bg);
  transition: all var(--transition);
  min-width: 200px;
  width: 100%;
}

.form-input-sm {
  padding: 0.3rem 0.4rem;
  font-size: 0.875rem;
  min-width: unset;
}

.tokens-input:focus,
.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.tokens-input::placeholder,
.form-input::placeholder {
  color: var(--color-text-muted);
}

.tokens-input[type="datetime-local"],
.form-input[type="datetime-local"] {
  min-width: 220px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 1rem 0;
}

.form-validation {
  margin-top: 0.25rem;
  color: #dc2626;
  font-size: 0.9rem;
  display: block;
}

.auth-form {
  margin-top: 1rem;
}

.auth-form button[type="submit"] {
  width: 100%;
}

.auth-form button[type="submit"]:hover {
  background-color: var(--color-primary-hover);
}

/* Usage Radio Group */
.tokens-usage {
  margin-bottom: 1.5rem;
}

.tokens-usage-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 0.75rem;
  display: block;
}

.tokens-usage-options {
  display: flex;
  gap: 1.5rem;
}

.tokens-radio-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.tokens-radio-label input[type="radio"] {
  appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  border: 2px solid var(--color-card-border);
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tokens-radio-label input[type="radio"]:checked {
  border-color: var(--color-primary);
}

.tokens-radio-label input[type="radio"]:checked::after {
  content: "";
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  background-color: var(--color-primary);
}

.tokens-radio-label input[type="radio"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-create-token {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  background-color: var(--color-primary);
  color: white;
  border: none;
}

.btn-create-token:hover {
  background-color: var(--color-primary-hover);
}

/* Existing Tokens Section */
.tokens-existing {
  margin-top: 2rem;
}

.tokens-existing-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.tokens-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-card-border);
  background-color: var(--color-card-bg);
}

.tokens-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.tokens-table th,
.tokens-table td {
  text-align: left;
  padding: 1rem 1.25rem;
  white-space: nowrap;
}

.tokens-table th {
  font-weight: 600;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-card-border);
  background-color: var(--color-secondary-bg);
}

.tokens-table th:first-child {
  border-top-left-radius: var(--radius-xl);
}

.tokens-table th:last-child {
  border-top-right-radius: var(--radius-xl);
}

.tokens-table td {
  color: var(--color-text);
  border-bottom: 1px solid var(--color-card-border);
}

.tokens-table tr:last-child td {
  border-bottom: none;
}

.tokens-table tr:hover td {
  background-color: rgba(37, 99, 235, 0.02);
}

.tokens-table td.muted {
  color: var(--color-text-muted);
}

/* Token Status */
.tokens-status {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8125rem;
  font-weight: 500;
}

.tokens-status--active {
  background-color: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

.tokens-status--revoked {
  background-color: rgba(239, 68, 68, 0.1);
  color: #dc2626;
}

/* Token Action Buttons */
.tokens-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-token-action {
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  background-color: var(--color-card-bg);
  color: var(--color-text);
  border: 1px solid var(--color-card-border);
}

.btn-token-action:hover {
  background-color: var(--color-secondary-bg);
  border-color: rgba(37, 99, 235, 0.3);
}

.btn-token-action--revoke:hover {
  background-color: rgba(234, 179, 8, 0.1);
  border-color: #ca8a04;
  color: #ca8a04;
}

.btn-token-action--delete:hover {
  background-color: rgba(239, 68, 68, 0.1);
  border-color: #dc2626;
  color: #dc2626;
}

/* ================================================
   UTILITIES
   ================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
