/* ============================================
   CSS Custom Properties (Design Tokens)

   These variables define the design system for
   DIY Accounting Submit. Use these throughout
   for consistent styling and easy theming.
   ============================================ */
:root {
  /* Brand Colors */
  --color-brand-primary: #2c5aa0;
  --color-brand-primary-dark: #1e3f73;
  --color-brand-primary-light: rgba(44, 90, 160, 0.1);

  /* Text Colors */
  --color-text-primary: #333;
  --color-text-secondary: #666;
  --color-text-muted: #737373;
  --color-text-hint: #505a5f;
  --color-text-inverse: #fff;

  /* Status Colors */
  --color-success: #28a745;
  --color-success-bg: #d4edda;
  --color-success-border: #c3e6cb;
  --color-success-text: #155724;

  --color-error: #dc3545;
  --color-error-bg: #f8d7da;
  --color-error-border: #f5c6cb;
  --color-error-text: #721c24;

  --color-warning: #ffc107;
  --color-warning-bg: #fff3cd;
  --color-warning-border: #ffeaa7;
  --color-warning-text: #856404;

  --color-info: #17a2b8;
  --color-info-bg: #d1ecf1;
  --color-info-border: #bee5eb;
  --color-info-text: #0c5460;

  /* UI Colors */
  --color-background: #f9f9f9;
  --color-surface: #fff;
  --color-border: #ddd;
  --color-border-dark: #0b0c0c;
  --color-input-prefix-bg: #f3f2f1;

  /* Focus Colors (WCAG 2.1 AA compliant) */
  --color-focus: #005ea5;
  --color-focus-ring: rgba(0, 94, 165, 0.3);

  /* Typography */
  --font-family-base: Arial, sans-serif;
  --font-family-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  --font-size-xs: 0.85em;
  --font-size-sm: 0.9em;
  --font-size-base: 1em;
  --font-size-lg: 1.1em;
  --font-size-xl: 1.2em;
  --font-size-2xl: 1.3em;
  --font-size-3xl: 1.5em;
  --font-size-4xl: 1.8em;
  --font-size-5xl: 2.2em;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Spacing */
  --spacing-xs: 0.25em;
  --spacing-sm: 0.5em;
  --spacing-md: 1em;
  --spacing-lg: 1.5em;
  --spacing-xl: 2em;

  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;

  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.1);

  /* Layout */
  --max-width-content: 800px;
  --max-width-form: 960px;
}

/* ============================================
   Reset and Base Styles
   ============================================ */

/* Basic reset and box-sizing */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* WCAG 2.1 AA: Skip link for keyboard navigation (2.4.1 Bypass Blocks) */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #000;
  color: #fff;
  padding: 8px;
  z-index: 100;
  text-decoration: underline;
}
.skip-link:focus {
  top: 0;
}

/* WCAG 2.1 AA: Links in text blocks must be distinguishable by more than color */
/* Fix for axe-core "link-in-text-block" violation */
p a,
li a,
td a,
.help-text a,
.footer-content a,
article a {
  text-decoration: underline;
}

/* Remove underline only for clearly navigational links (menus, buttons) */
nav a,
.menu-dropdown a,
.btn,
button {
  text-decoration: none;
}

/* WCAG 2.1 AA: Enhanced focus visibility (2.4.7 Focus Visible) */
/* All interactive elements need visible focus indicator */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

/* High contrast focus for buttons */
.btn:focus,
button:focus {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-family-base);
  background-color: var(--color-background);
  color: var(--color-text-primary);
  display: flex;
  flex-direction: column;
  padding: var(--spacing-md);
  max-width: var(--max-width-content);
  margin: 0 auto;
}

/* ============================================
   Typography - Headings
   ============================================ */

h1 {
  font-size: var(--font-size-5xl);
  margin-bottom: var(--spacing-sm);
  color: var(--color-brand-primary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

h2 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--spacing-md);
  color: var(--color-brand-primary);
}

/* ============================================
   Layout - Header
   ============================================ */

header {
  margin-bottom: var(--spacing-xl);
  text-align: center;
  position: relative;
}

/* Spreadsheet grid receding behind the header into the horizon */
header::after {
  content: '';
  position: absolute;
  left: -5%;
  right: -5%;
  top: 2em;
  height: 20em;
  background:
    /* Two subtly shaded cells */
    linear-gradient(rgba(44, 90, 160, 0.15), rgba(44, 90, 160, 0.15)) 2em 1.8em / 5em 1.5em no-repeat,
    linear-gradient(rgba(44, 90, 160, 0.10), rgba(44, 90, 160, 0.10)) 14em 3.3em / 5em 1.5em no-repeat,
    /* Column header tint (top row) */
    linear-gradient(to bottom, rgba(44, 90, 160, 0.10) 0, rgba(44, 90, 160, 0.10) 1.5em, transparent 1.5em),
    /* Column lines (diffuse - wider and softer) */
    repeating-linear-gradient(90deg, rgba(44, 90, 160, 0.10) 0 3px, transparent 3px 5em),
    /* Row lines */
    repeating-linear-gradient(180deg, rgba(44, 90, 160, 0.17) 0 1px, transparent 1px 1.5em);
  transform: perspective(600px) rotateX(50deg);
  transform-origin: top center;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.95) 0%, transparent 90%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.95) 0%, transparent 90%);
  z-index: -1;
  pointer-events: none;
}


/* Header navigation */
.header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1em;
  position: relative;
}

/* Header left section with home icon and info icon */
.header-left {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.home-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-brand-primary);
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  transition: background-color 0.2s;
}

.home-link:hover {
  background-color: var(--color-brand-primary-light);
}

.home-link .home-icon {
  fill: currentColor;
}

/* Info/help icon link */
.info-link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-brand-primary);
  padding: var(--spacing-xs);
  border-radius: var(--radius-sm);
  transition: background-color 0.2s;
}

.info-link:hover {
  background-color: var(--color-brand-primary-light);
}

.info-link .info-icon {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* About page navigation links (Help / User Guide) */
.about-nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--spacing-xl);
  margin: var(--spacing-xl) 0 var(--spacing-lg) 0;
}

.about-nav-link {
  background: white;
  color: var(--color-brand-primary);
  text-decoration: underline;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  padding: var(--spacing-md) var(--spacing-xl);
  border: 2px solid transparent;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  flex: 1 1 28%;
}

.about-nav-link:hover {
  background-color: white;
  border-color: var(--color-brand-primary);
  text-decoration: underline;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

@media (orientation: portrait) {
  .about-nav-link {
    flex: 1 1 40%;
  }
}

/* ============================================
   Header - Auth Section
   ============================================ */

.auth-section {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.entitlement-status {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.auth-section > .entitlement-status {
  display: none;
}

.entitlement-status.status-granted {
  color: var(--color-success);
}

.entitlement-status.status-requires {
  color: var(--color-error);
}

.login-status {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.token-balance {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-left: var(--spacing-sm);
}

.token-count {
  white-space: nowrap;
}

.token-refresh-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--color-text-secondary);
  border-radius: var(--radius-sm);
  transition: color 0.2s;
}

.token-refresh-btn:hover {
  color: var(--color-brand-primary);
}

.login-link {
  color: var(--color-brand-primary);
  text-decoration: none;
  font-weight: var(--font-weight-bold);
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--color-brand-primary);
  border-radius: var(--radius-sm);
  transition: all 0.3s;
}

.login-link:hover {
  background-color: var(--color-brand-primary);
  color: var(--color-text-inverse);
}

/* Page subtitle (appears below h1) */
.subtitle {
  font-size: var(--font-size-lg);
  color: var(--color-text-secondary);
  margin-bottom: var(--spacing-md);
}

/* ============================================
   Main Navigation Bar
   ============================================ */

.main-nav {
  display: flex;
  justify-content: center;
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-sm) 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.main-nav a {
  color: var(--color-brand-primary);
  text-decoration: none;
  font-size: var(--font-size-base);
  padding: var(--spacing-sm) var(--spacing-md);
  transition:
    color 0.2s,
    background-color 0.2s,
    box-shadow 0.2s;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.main-nav a:hover {
  text-decoration: underline;
  background-color: var(--color-brand-primary-light);
}

.main-nav a.active {
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
}

/* Home icon in header */
.home-icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  vertical-align: middle;
  margin-right: var(--spacing-xs);
}

.home-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* Header title with home link */
.header-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
}

.header-title a {
  color: inherit;
  text-decoration: none;
}

.header-title a:hover {
  text-decoration: none;
  opacity: 0.8;
}

@media (max-width: 600px) {
  .main-nav {
    flex-wrap: wrap;
    gap: var(--spacing-md);
  }

  .main-nav a {
    font-size: var(--font-size-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
  }
}

/* ============================================
   Layout - Main Content
   ============================================ */

#mainContent {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ============================================
   Form - Container and Groups
   ============================================ */

.form-container {
  background: var(--color-surface);
  padding: var(--spacing-xl);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--spacing-xl);
}

.form-group {
  margin-bottom: var(--spacing-lg);
}

/* ============================================
   Form - Labels
   ============================================ */

label {
  display: block;
  margin-bottom: var(--spacing-sm);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
}

/* ============================================
   Form - Text Inputs
   ============================================ */

input[type="text"],
input[type="number"] {
  width: 100%;
  padding: 0.75em;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-base);
  transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="number"]:focus {
  outline: none;
  border-color: #2c5aa0;
}

/* ============================================
   Form - Help Text and Hints
   ============================================ */

/* Legacy help text class - for backwards compatibility */
.help-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: var(--spacing-xs);
}

/* Hint text (GOV.UK Design System pattern for accessibility) */
.hint {
  font-size: var(--font-size-sm);
  color: var(--color-text-hint);
  margin-top: 0;
  margin-bottom: var(--spacing-sm);
}

/* ============================================
   Form - Error Messages (WCAG 2.2 AA Compliant)

   Following GOV.UK Design System pattern for
   accessible inline error messages.
   ============================================ */
.error-message {
  font-size: var(--font-size-sm);
  color: var(--color-error);
  font-weight: var(--font-weight-bold);
  margin-top: var(--spacing-xs);
  margin-bottom: var(--spacing-sm);
}

.error-message .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Error state for form groups */
.form-group--error {
  border-left: 5px solid var(--color-error);
  padding-left: var(--spacing-md);
}

/* Error state for inputs */
input.input--error,
select.input--error,
textarea.input--error {
  border-color: var(--color-error);
  border-width: 2px;
}

input.input--error:focus,
select.input--error:focus,
textarea.input--error:focus {
  outline: 3px solid var(--color-error);
  outline-offset: 0;
  border-color: var(--color-error);
}

/* Error state for input prefix wrapper */
.input-prefix:has(.input--error) .prefix {
  border-color: var(--color-error);
}

/* ============================================
   Form - Input Prefix (Currency Fields)

   GOV.UK Design System pattern for prefixed inputs.
   Used for currency fields with £ symbol.
   ============================================ */
.input-prefix {
  display: flex;
  align-items: stretch;
}

.input-prefix .prefix {
  display: flex;
  align-items: center;
  padding: 0 0.75em;
  background-color: var(--color-input-prefix-bg);
  border: 2px solid var(--color-border-dark);
  border-right: none;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-prefix input {
  flex: 1;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  min-width: 0;
}

/* Loading spinner */
.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #2c5aa0;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
  display: none;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Receipt display */
.receipt {
  background: white;
  padding: 2em;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-top: 2em;
  display: none;
}

.receipt h3 {
  color: #28a745;
  margin-bottom: 1em;
  font-size: 1.3em;
}

.receipt-details {
  background: #f8f9fa;
  padding: 1em;
  border-radius: 4px;
  margin-top: 1em;
}

.receipt-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5em;
  padding-bottom: 0.5em;
  border-bottom: 1px solid #eee;
}

.receipt-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

footer {
  margin-top: 2em;
  font-size: 0.9em;
  color: #737373;
  padding-top: 1em;
  border-top: 1px solid #eee;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.footer-left {
  flex: 1;
  text-align: left;
}

.footer-center {
  flex: 2;
  text-align: center;
}

.footer-left a {
  color: #2c5aa0;
  text-decoration: none;
  font-size: 0.85em;
  transition: color 0.3s;
  /* WCAG 2.5.5 Target Size - minimum 24x24px touch target */
  display: inline-block;
  min-height: 24px;
  padding: 4px 0;
  line-height: 1.2;
}

.footer-left a:hover {
  color: #1a3d6b;
  text-decoration: underline;
}

/* Auth providers */
.auth-providers {
  display: flex;
  flex-direction: column;
  gap: 1em;
  margin: 2em 0;
}

.auth-provider {
  position: relative;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75em;
  padding: 0.75em 1.5em;
  font-size: 1em;
  border: 2px solid #ddd;
  background-color: white;
  color: #333;
  transition: all 0.3s;
}

.auth-btn:hover:not(:disabled) {
  background-color: #f8f9fa;
  border-color: #2c5aa0;
}

.google-btn {
  border-color: #4285f4;
}

.btn.google-btn:hover {
  background-color: #4285f4;
  color: white;
}

.disabled-btn {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: #f8f9fa;
}

.provider-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.coming-soon-text {
  font-size: 0.8em;
  color: #666;
  margin-top: 0.5em;
  font-style: italic;
}

.auth-provider.disabled .coming-soon-text {
  color: #999;
}

/* Coming soon page */
.coming-soon-message {
  padding: 2em;
  margin: 2em 0;
}

.coming-soon-icon {
  font-size: 4em;
  margin-bottom: 1em;
}

.coming-soon-message p {
  font-size: 1.1em;
  margin-bottom: 1em;
  color: #666;
}

.countdown {
  font-size: 3em;
  font-weight: bold;
  color: #2c5aa0;
  margin: 1em 0;
  padding: 0.5em;
  border: 3px solid #2c5aa0;
  border-radius: 50%;
  width: 2em;
  height: 2em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* bundles page */
.bundles-list {
  display: flex;
  flex-direction: column;
  gap: 1.5em;
  margin: 2em 0;
}

.service-item {
  background: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1.5em;
  text-align: left;
  transition: all 0.3s;
}

.service-item:not(.disabled):hover {
  border-color: #2c5aa0;
  box-shadow: 0 2px 8px rgba(44, 90, 160, 0.1);
}

.service-item.disabled {
  opacity: 0.7;
  background: #f5f5f5;
}

.service-item h3 {
  color: #2c5aa0;
  margin-bottom: 0.5em;
  font-size: 1.2em;
}

.service-item.disabled h3 {
  color: #666;
}

.service-description {
  color: #666;
  margin-bottom: 1em;
  font-size: 0.95em;
  line-height: 1.4;
}

.service-btn {
  margin-top: 1em;
  width: auto;
  padding: 0.75em 1.5em;
}

/* Responsive design */
@media (max-width: 600px) {
  body {
    padding: 0.5em;
  }

  .form-container {
    padding: 1em;
  }

  h1 {
    font-size: 1.8em;
  }

  .header-nav {
    flex-direction: row;
    justify-content: space-between;
  }

  .auth-section {
    gap: 0.5em;
  }

  .login-link {
    padding: 0.4em 0.8em;
    font-size: 0.9em;
  }
}

/* ============================================
   Buttons - Primary
   ============================================ */

.btn {
  background-color: var(--color-brand-primary);
  color: var(--color-text-inverse);
  padding: var(--spacing-md) var(--spacing-xl);
  border: none;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-lg);
  cursor: pointer;
  transition: background-color 0.3s;
  width: 100%;
}

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

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

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

/* ============================================
   Indicators - Sandbox Mode
   ============================================ */

.sandbox-indicator {
  background-color: var(--color-warning-bg);
  border: 2px solid var(--color-warning);
  color: var(--color-warning-text);
  padding: 0.75em var(--spacing-md);
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-md);
  text-align: center;
  font-weight: var(--font-weight-bold);
  display: none;
}

.sandbox-indicator.visible {
  display: block;
}

/* Test data link (sandbox mode only) */
.test-data-link {
  display: none;
  text-align: right;
  margin-bottom: var(--spacing-md);
  font-size: var(--font-size-sm);
}

.test-data-link.visible {
  display: block;
}

.test-data-link a {
  color: var(--color-brand-primary);
  text-decoration: none;
  cursor: pointer;
  padding: 0.3em 0.6em;
  border: 1px solid var(--color-brand-primary);
  border-radius: var(--radius-sm);
  transition:
    background-color 0.3s,
    color 0.3s;
}

.test-data-link a:hover {
  background-color: var(--color-brand-primary);
  color: var(--color-text-inverse);
}

/* ============================================
   Status Messages (Alerts)
   ============================================ */

.status-message {
  padding: var(--spacing-md);
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-md);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-message-content {
  flex: 1;
  margin-right: var(--spacing-md);
}

.status-close-button {
  background: none;
  border: none;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
  flex-shrink: 0;
}

.status-close-button:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

.status-success .status-close-button {
  color: var(--color-success-text);
}

.status-error .status-close-button {
  color: var(--color-error-text);
}

.status-info .status-close-button {
  color: var(--color-info-text);
}

.status-close-button:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.status-success {
  background-color: var(--color-success-bg);
  border: 1px solid var(--color-success-border);
  color: var(--color-success-text);
}

.status-error {
  background-color: var(--color-error-bg);
  border: 1px solid var(--color-error-border);
  color: var(--color-error-text);
}

.status-info {
  background-color: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  color: var(--color-info-text);
}

/* External link icon (new tab) */
a[target="_blank"]::after,
a.external-link::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-left: 4px;
  vertical-align: baseline;
  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAQElEQVR42qXKwQkAIAxDUUdxtO6/RBQkQZvSi8I/pL4BoGw/XPkh4XigPmsUgh0626AjRsgxHTkUThsG2T/sIlzdTsp52kSS1wAAAABJRU5ErkJggg==)
    no-repeat center / contain;
  opacity: 0.7;
}

/* Optional hover emphasis */
a[target="_blank"]:hover::after,
a.external-link:hover::after {
  opacity: 1;
}

/* Receipts page specific styles */
.data-table {
  border-collapse: collapse;
  width: 100%;
}

.data-table th,
.data-table td {
  border: 1px solid #ddd;
  padding: 0.75em;
  text-align: left;
}

.data-table th {
  background-color: #f8f9fa;
  font-weight: bold;
  color: #333;
}

.data-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.data-table tr:hover {
  background-color: #f5f5f5;
}

/* Clickable receipt label */
.receipt-label {
  color: #2c5aa0;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.3s;
}

.receipt-label:hover {
  color: #1e3f73;
  text-decoration: underline;
}

/* Download icon */
.download-icon {
  display: inline-block;
  margin-left: 0.5em;
  cursor: pointer;
  color: #2c5aa0;
  font-size: 1.1em;
  transition: color 0.3s;
  text-decoration: none;
}

.download-icon:hover {
  color: #1e3f73;
}

/* Small button variant */
.btn-small {
  background-color: #2c5aa0;
  color: white;
  padding: 0.5em 1em;
  border: none;
  border-radius: 4px;
  font-size: 0.9em;
  cursor: pointer;
  transition: background-color 0.3s;
  width: auto;
}

.btn-small:hover {
  background-color: #1e3f73;
}

.btn-small:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Receipt display area */
.receipt-display {
  background: white;
  padding: 1.5em;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-top: 2em;
  display: none;
}

.receipt-display h3 {
  color: #2c5aa0;
  margin-bottom: 1em;
  font-size: 1.2em;
}

.receipt-display table {
  width: 100%;
  border-collapse: collapse;
}

.receipt-display th,
.receipt-display td {
  border: 1px solid #ddd;
  padding: 0.5em;
  text-align: left;
}

.receipt-display th {
  background-color: #f8f9fa;
  font-weight: bold;
}

.receipt-display tr:nth-child(even) {
  background-color: #f9f9f9;
}

/* Export controls at bottom */
.export-controls {
  margin-top: 1em;
  text-align: center;
}

/* Developer Controls & Test Scenario Styling */
.developer-controls {
  margin-top: 1.5em;
  padding: 1em;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  text-align: center;
}

.developer-button {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background-color 0.2s;
}

.developer-button:hover {
  background-color: #5a6268;
}

.developer-section {
  margin-top: 1em;
  padding: 1em;
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 6px;
}

.developer-section .form-group {
  margin-bottom: 1em;
}

.developer-section label {
  font-weight: 600;
  color: #856404;
}

.developer-section select {
  border: 1px solid #ffeaa7;
  background-color: #fff;
}

.developer-section .help-text {
  color: #856404;
  font-style: italic;
  font-size: 0.85em;
}

/* Results and Tables */
.results-container {
  margin-top: 2em;
  padding: 1.5em;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  background-color: white;
}

.results-table th,
.results-table td {
  padding: 10px;
  text-align: left;
  border: 1px solid #ddd;
}

.results-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #495057;
}

.results-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.results-table tr:hover {
  background-color: #f5f5f5;
}

.action-button {
  background-color: #007acc;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85em;
  text-decoration: none;
  display: inline-block;
  margin: 2px;
  transition: background-color 0.2s;
}

.action-button:hover {
  background-color: #005fa3;
}

.secondary-button {
  background-color: #6c757d;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  margin: 5px;
  transition: background-color 0.2s;
}

.secondary-button:hover {
  background-color: #5a6268;
}

.cancel-button {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  margin: 5px;
  transition: background-color 0.2s;
}

.cancel-button:hover {
  background-color: #c82333;
}

.form-toggle-buttons {
  margin-bottom: 10px;
}

.button-group {
  text-align: center;
  margin-top: 1.5em;
}

.status-open {
  color: #dc3545;
  font-weight: 600;
}

.status-fulfilled {
  color: #28a745;
  font-weight: 600;
}

.no-data {
  text-align: center;
  padding: 2em;
  color: #6c757d;
  font-style: italic;
}

/* Status Messages */
.status-message {
  padding: 10px 15px;
  margin: 10px 0;
  border-radius: 4px;
  font-weight: 500;
}

.status-message.info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.status-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.status-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-message.warning {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

/* Loading spinner */
.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007acc;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .results-table {
    font-size: 0.85em;
  }

  .results-table th,
  .results-table td {
    padding: 6px;
  }

  .action-button {
    padding: 4px 8px;
    font-size: 0.8em;
  }

  .developer-controls {
    padding: 0.5em;
  }
}

/* ============================================
   Simulator Mode Styles
   ============================================ */

/* Simulator banner - always visible at top */
.simulator-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(90deg, #ff6b6b 0%, #ff8e8e 50%, #ff6b6b 100%);
  color: white;
  text-align: center;
  padding: 10px 16px;
  font-weight: bold;
  z-index: 10000;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
  letter-spacing: 0.5px;
}

/* Offset body content to account for fixed banner */
html[data-simulator="true"] body {
  padding-top: 44px !important;
}

/* Visual indicator on buttons - show "(demo)" suffix */
html[data-simulator="true"] .btn::after,
html[data-simulator="true"] button[type="submit"]::after {
  content: " (demo)";
  font-size: 0.75em;
  opacity: 0.8;
  font-weight: normal;
}

/* Don't add suffix to navigation buttons or icon buttons */
html[data-simulator="true"] .journey-btn::after,
html[data-simulator="true"] .about-nav-link::after,
html[data-simulator="true"] .main-nav a::after,
html[data-simulator="true"] .login-link::after,
html[data-simulator="true"] button.status-close-button::after,
html[data-simulator="true"] button[aria-label]::after {
  content: none;
}

/* Highlight animation for guided journeys */
.simulator-highlight {
  outline: 3px solid #ff6b6b !important;
  outline-offset: 2px;
  animation: pulse-highlight 1s ease-in-out infinite;
  position: relative;
  z-index: 1000;
}

@keyframes pulse-highlight {
  0%,
  100% {
    outline-color: #ff6b6b;
    box-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
  }
  50% {
    outline-color: #ff9999;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.8);
  }
}

/* Simulator page container */
.simulator-container {
  position: relative;
  width: 100%;
  height: calc(100vh - 300px);
  min-height: 600px;
  border: 3px solid #ff6b6b;
  border-radius: 8px;
  overflow: hidden;
  margin: 20px 0;
}

.simulator-overlay-label {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #ff6b6b;
  color: white;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: bold;
  z-index: 100;
  pointer-events: none;
  font-size: 12px;
}

.simulator-frame {
  width: 100%;
  height: 100%;
  border: none;
}

/* Lightbox expand button */
.simulator-expand-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 101;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.simulator-expand-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Open simulator in new tab link */
.simulator-open-btn {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  text-decoration: none;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 101;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background 0.2s;
}

.simulator-open-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  color: white;
}

/* Lightbox expanded state */
.simulator-container.simulator-expanded {
  position: fixed;
  inset: 2.5vh 2.5vw;
  width: 95vw;
  height: 95vh;
  z-index: 9999;
  margin: 0;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.7);
}

.simulator-container.simulator-expanded .simulator-expand-btn {
  background: rgba(220, 53, 69, 0.9);
}

.simulator-container.simulator-expanded .simulator-expand-btn:hover {
  background: rgba(220, 53, 69, 1);
}

/* Simulator notice styling */
.simulator-notice {
  background: var(--color-warning-bg);
  border: 1px solid var(--color-warning);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 20px;
}

/* Journey buttons for simulator */
.journey-buttons {
  display: flex;
  gap: 1em;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.5em 0;
}

.journey-btn {
  display: flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.75em 1.5em;
  background: var(--color-surface);
  border: 2px solid var(--color-brand-primary);
  border-radius: var(--radius-md);
  color: var(--color-brand-primary);
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.journey-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.journey-icon {
  font-size: 1.2em;
}

/* Journey status display */
.journey-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-info-bg);
  border: 1px solid var(--color-info-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 1em;
  min-height: 48px;
}

.journey-controls {
  display: flex;
  gap: 0.5em;
}

.journey-controls button {
  background: none;
  border: 1px solid var(--color-info-text);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  cursor: pointer;
  font-size: 1.2em;
  color: var(--color-info-text);
}

.journey-controls button:hover {
  background: var(--color-info-border);
}

/* FAQ Page Styles (merged from help.css) */

.help-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 1rem;
}

/* Search */
.faq-search-container {
  margin-bottom: 1.5rem;
}

#faq-search {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  border: 2px solid #ddd;
  border-radius: 8px;
  transition: border-color 0.2s;
}

#faq-search:focus {
  outline: none;
  border-color: #2c5aa0;
}

.search-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: #666;
}

/* FAQ List */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1rem;
  border: none;
  background: none;
  text-align: left;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.faq-question:hover {
  background: #f8f9fa;
}

.faq-question:focus {
  outline: 2px solid #2c5aa0;
  outline-offset: -2px;
}

.faq-question-text {
  flex: 1;
}

.faq-category-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  background: #e8f0fe;
  color: #2c5aa0;
  white-space: nowrap;
  flex-shrink: 0;
}

.faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  transition: transform 0.2s;
}

.faq-question[aria-expanded="true"] .faq-chevron {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 1rem 1rem;
  color: #333;
  line-height: 1.6;
}

.faq-answer p {
  margin: 0 0 1rem;
}

.faq-answer p:last-child {
  margin-bottom: 0;
}

.faq-answer ul,
.faq-answer ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.faq-answer li {
  margin-bottom: 0.5rem;
}

.faq-answer a {
  color: #2c5aa0;
  text-decoration: none;
}

.faq-answer a:hover {
  text-decoration: underline;
}

.faq-answer strong {
  color: #1a1a1a;
}

/* FAQ Tables */
.faq-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.9rem;
}

.faq-table th,
.faq-table td {
  padding: 0.5rem;
  border: 1px solid #ddd;
  text-align: left;
}

.faq-table th {
  background: #f8f9fa;
  font-weight: 600;
}

/* Support Section */
.support-section {
  margin-top: 3rem;
  padding: 2rem;
  background: #f8f9fa;
  border-radius: 8px;
  text-align: center;
}

.support-section h2 {
  color: #2c5aa0;
  margin-bottom: 0.5rem;
}

.support-section > p {
  color: #666;
  margin-bottom: 1.5rem;
}

.support-options {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.support-button {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid #2c5aa0;
  transition: all 0.2s;
}

.support-button.primary {
  background: #2c5aa0;
  color: white;
}

.support-button.primary:hover {
  background: #1e3f73;
  border-color: #1e3f73;
}

.support-button.secondary {
  background: white;
  color: #2c5aa0;
}

.support-button.secondary:hover {
  background: #e8f0fe;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

.modal[hidden] {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h3 {
  color: #2c5aa0;
  margin-bottom: 1.5rem;
}

.modal-content label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
  margin-top: 1rem;
}

.modal-content label:first-of-type {
  margin-top: 0;
}

.modal-content input,
.modal-content textarea,
.modal-content select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
}

.modal-content input:focus,
.modal-content textarea:focus,
.modal-content select:focus {
  outline: none;
  border-color: #2c5aa0;
}

.modal-content textarea {
  resize: vertical;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

.form-actions button {
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.form-actions button.primary {
  background: #2c5aa0;
  color: white;
  border: 2px solid #2c5aa0;
}

.form-actions button.primary:hover {
  background: #1e3f73;
  border-color: #1e3f73;
}

.form-actions button.primary:disabled {
  background: #ccc;
  border-color: #ccc;
  cursor: not-allowed;
}

.form-actions button.secondary {
  background: white;
  color: #666;
  border: 2px solid #ddd;
}

.form-actions button.secondary:hover {
  background: #f8f9fa;
  border-color: #ccc;
}

/* No results */
.no-results {
  text-align: center;
  padding: 2rem;
  color: #666;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.link-button {
  background: none;
  border: none;
  color: #2c5aa0;
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
}

.link-button:hover {
  color: #1e3f73;
}

/* Responsive adjustments for FAQ */
@media (max-width: 600px) {
  .help-page {
    padding: 0.5rem;
  }

  .faq-question {
    padding: 0.75rem;
    font-size: 0.95rem;
    flex-wrap: wrap;
  }

  .faq-category-badge {
    order: -1;
    margin-bottom: 0.5rem;
  }

  .faq-question-text {
    width: 100%;
    padding-right: 2rem;
  }

  .faq-chevron {
    position: absolute;
    right: 0.75rem;
  }

  .faq-question {
    position: relative;
  }

  .support-section {
    padding: 1.5rem 1rem;
  }

  .support-options {
    flex-direction: column;
  }

  .support-button {
    width: 100%;
    text-align: center;
  }

  .modal-content {
    padding: 1.5rem;
    margin: 0.5rem;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .form-actions button {
    width: 100%;
  }
}
