/* =============================================================================
   STRIPE PAYMENT APP - RESPONSIVE MOBILE DESIGN
   ============================================================================= */

/* ---- CSS Reset & Base Styles ---- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #d2006f;
  --primary-dark: #820067;
  --primary-light: #818cf8;
  --success-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --border-radius: 8px;
  --transition: all 0.3s ease;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --box-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.15);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- Mobile Container ---- */
.mobile-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: #fff;
  max-width: 100%;
}

/* ---- Header Styling ---- */
.app-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 1.5rem 1rem;
  box-shadow: var(--box-shadow-lg);
  position: relative;
  overflow: hidden;
}

.app-header::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
  text-align: center;
  width: 100%;
  justify-content: center;
  flex-direction: column;
}

.company-logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  padding: 8px;
  object-fit: contain;
}

.app-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0;
}

.app-header .tagline {
  font-size: 0.875rem;
  opacity: 0.9;
  margin: 0.5rem 0 0 0;
  font-weight: 400;
}

/* ---- Main Content ---- */
main {
  flex: 1;
  padding: 0;
  background: #fff;
}

.payment-container {
  padding: 1.5rem;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* ---- Form Styles ---- */
.payment-wrapper,
.success-wrapper,
.failure-wrapper,
.customers-wrapper,
.home-wrapper,
.error-wrapper {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--box-shadow);
}

.payment-wrapper h2,
.success-wrapper h2,
.failure-wrapper h2,
.customers-wrapper h2,
.home-wrapper h2,
.error-wrapper h2 {
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.customer-info {
  background: var(--gray-50);
  border-left: 4px solid var(--primary-color);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
}

.customer-info p {
  margin: 0.5rem 0;
  font-size: 0.95rem;
}

/* ---- Payment Summary ---- */
.payment-summary {
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  margin-top: 1.5rem;
  border: 1px solid var(--gray-200);
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-300);
}

.summary-item:last-child {
  border-bottom: none;
}

.summary-item.total-due {
  background: var(--primary-color);
  color: white;
  padding: 1rem;
  border-radius: 4px;
  margin-top: 0.5rem;
  border: none;
}

.summary-label {
  font-weight: 500;
  color: var(--gray-700);
  font-size: 0.95rem;
}

.summary-item.total-due .summary-label {
  color: white;
}

.summary-value {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary-color);
}

.summary-item.total-due .summary-value {
  color: white;
  font-size: 1.3rem;
}

/* ---- Form Note ---- */
.form-note {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--gray-500);
  font-style: italic;
}

/* ---- Form Groups ---- */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--gray-700);
  font-size: 0.95rem;
}

select,
input[type='text'],
input[type='email'],
input[type='number'],
textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  transition: var(--transition);
  background: white;
}

select:focus,
input[type='text']:focus,
input[type='email']:focus,
input[type='number']:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  background: white;
}

input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type='number'] {
  -moz-appearance: textfield;
}

/* ---- Amount Input ---- */
.amount-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-symbol {
  position: absolute;
  left: 0.75rem;
  font-weight: 600;
  color: var(--gray-600);
  pointer-events: none;
  z-index: 1;
}

.amount-input-wrapper input {
  padding-left: 1.75rem;
}

#amountNote {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--gray-500);
}

/* ---- Card Element (Stripe) ---- */
.card-element {
  padding: 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  background: white;
  margin-bottom: 1rem;
}

.card-element.StripeElement--focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ---- Error Messages ---- */
.error-message {
  color: var(--danger-color);
  font-size: 0.875rem;
  margin-top: 0.5rem;
  display: block;
  min-height: 1.25rem;
}

#card-errors {
  margin-bottom: 1rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  width: 100%;
  margin-top: 1rem;
  padding: 0.875rem 1.5rem;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  box-shadow: var(--box-shadow-lg);
  transform: translateY(-2px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--gray-300);
  color: var(--gray-800);
  width: 100%;
  margin-top: 0.75rem;
}

.btn-secondary:hover {
  background: var(--gray-400);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  width: 100%;
  margin-top: 1rem;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  width: 100%;
}

.btn-icon {
  display: inline-block;
  margin-right: 0.5rem;
  font-size: 1.25rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---- Payment Info ---- */
.payment-info {
  background: var(--gray-50);
  border-radius: var(--border-radius);
  padding: 1rem;
  margin-top: 1.5rem;
  border: 1px solid var(--gray-200);
}

.amount-display {
  text-align: center;
  font-size: 1.1rem;
  color: var(--gray-700);
}

.amount-display strong {
  color: var(--primary-color);
  font-size: 1.3rem;
}

/* ---- Success Icon ---- */
.success-icon,
.failure-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.success-icon {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
}

.failure-icon {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
}

/* ---- Success Message ---- */
.success-message,
.failure-message {
  text-align: center;
  font-size: 1rem;
  margin-bottom: 1.5rem;
  color: var(--gray-700);
}

/* ---- Transaction Details ---- */
.transaction-details {
  background: var(--gray-50);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  margin: 1.5rem 0;
  border: 1px solid var(--gray-200);
}

.transaction-details h3 {
  color: var(--gray-800);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-200);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  color: var(--gray-600);
  font-weight: 500;
  flex: 1;
}

.detail-value {
  color: var(--gray-800);
  font-weight: 600;
  text-align: right;
  flex: 1;
  word-break: break-word;
}

/* ---- Success/Failure Actions ---- */
.success-actions,
.failure-actions,
.error-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.success-actions .btn,
.failure-actions .btn,
.error-actions .btn {
  width: 100%;
  margin: 0;
}

/* ---- Receipt Notice ---- */
.receipt-notice,
.contact-notice {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.05), rgba(16, 185, 129, 0.02));
  border-left: 4px solid var(--success-color);
  padding: 1rem;
  border-radius: 4px;
  margin-top: 1.5rem;
  text-align: center;
  color: var(--gray-700);
  font-size: 0.95rem;
}

.contact-notice {
  border-left-color: var(--warning-color);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(245, 158, 11, 0.02));
  color: var(--gray-600);
}

/* ---- Error Details ---- */
.error-details {
  background: rgba(239, 68, 68, 0.05);
  border-left: 4px solid var(--danger-color);
  padding: 1rem;
  border-radius: 4px;
  margin: 1rem 0;
}

.error-details p,
.error-box p {
  margin: 0;
  color: var(--gray-700);
  font-size: 0.95rem;
}

.error-box {
  background: var(--gray-50);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--gray-200);
}

.error-box h3 {
  color: var(--danger-color);
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

/* ---- Failure Reasons ---- */
.failure-reasons {
  background: var(--gray-50);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  margin: 1.5rem 0;
  border: 1px solid var(--gray-200);
}

.failure-reasons h3 {
  color: var(--gray-800);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.failure-reasons ul {
  list-style: none;
  padding: 0;
}

.failure-reasons li {
  padding: 0.5rem 0;
  color: var(--gray-700);
  padding-left: 1.5rem;
  position: relative;
}

.failure-reasons li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--danger-color);
  font-weight: bold;
}

/* ---- Customers List ---- */
.customers-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.customer-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.customer-card:hover {
  box-shadow: var(--box-shadow);
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.customer-card-header {
  margin-bottom: 1rem;
}

.customer-card h3 {
  color: var(--gray-800);
  margin-bottom: 0.25rem;
  font-size: 1.1rem;
}

.customer-email {
  font-size: 0.85rem;
  color: var(--gray-500);
  display: block;
}

.security-key-display {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-300);
}

.security-key-display label {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-600);
  font-weight: 600;
 
  margin-bottom: 0.5rem;
}

.security-key-value {
  display: inline-block;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--gray-700);
  cursor: pointer;
  transition: var(--transition);
  user-select: all;
  word-break: break-all;
}

.security-key-value:hover {
  background: var(--primary-light);
  color: white;
  border-color: var(--primary-color);
}

.copy-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

.customer-card-amounts {
  background: var(--gray-50);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.amount-item {
  display: flex;
  flex-direction: column;
}

.amount-item.total {
  grid-column: 1 / -1;
}

.amount-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 600;
 
}

.amount-value {
  font-size: 1.25rem;
  color: var(--primary-color);
  font-weight: 700;
  margin-top: 0.25rem;
}

.amount-value.overdue {
  color: var(--danger-color);
}

.amount-item.total .amount-value {
  color: var(--gray-800);
}

.no-customers {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--gray-500);
}

/* ---- Home Section ---- */
.welcome-section {
  text-align: center;
  margin-bottom: 2rem;
}

.welcome-section h2 {
  margin-bottom: 0.5rem;
}

.welcome-section p {
  color: var(--gray-600);
  font-size: 1rem;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

/* ---- Features ---- */
.features {
  background: var(--gray-50);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  border: 1px solid var(--gray-200);
}

.features h3 {
  color: var(--gray-800);
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.features-list {
  list-style: none;
  padding: 0;
}

.features-list li {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem 0;
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-200);
}

.features-list li:last-child {
  border-bottom: none;
}

.feature-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
}

.features-list strong {
  color: var(--gray-800);
}

/* ---- Footer ---- */
.app-footer {
  background: var(--gray-800);
  color: white;
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.85rem;
  margin-top: auto;
}

.app-footer p {
  margin: 0;
}

/* ---- Security Check Page ---- */
.security-wrapper {
  background: white;
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--box-shadow);
}

.security-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.1);
  color: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
}

.security-wrapper h2 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.5rem;
  text-align: center;
}

.security-message {
  text-align: center;
  color: var(--gray-600);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.customer-info-sec {
  background: var(--gray-50);
  border-left: 4px solid var(--primary-color);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  text-align: center;
}

.customer-info-sec p {
  margin: 0;
  color: var(--gray-700);
  font-size: 0.95rem;
}

.security-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--gray-500);
  font-style: italic;
}

#securityKey {
  letter-spacing: 0.2em;
}

.security-notice {
  background: rgba(16, 185, 129, 0.05);
  border-left: 4px solid var(--success-color);
  border-radius: 4px;
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.security-notice h3 {
  color: var(--gray-800);
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.security-notice p {
  color: var(--gray-700);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.security-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.security-actions .btn {
  width: 100%;
  margin: 0;
}

/* ---- Error Box (for security check errors) ---- */
.error-box {
  background: rgba(239, 68, 68, 0.05);
  border-left: 4px solid var(--danger-color);
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.error-box p {
  color: var(--danger-color);
  margin: 0;
  font-weight: 500;
}

/* ---- Statement Items Table ---- */
.statement-items {
  background: white;
  border-radius: var(--border-radius);
  border: 1px solid var(--gray-200);
  margin-top: 1.5rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.statement-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--gray-100) 100%);
  border-bottom: 1px solid var(--gray-200);
  cursor: pointer;
  transition: var(--transition);
  user-select: none;
}

.statement-header:hover {
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
}

.statement-header h3 {
  margin: 0;
  color: var(--gray-800);
  font-size: 1.1rem;
  font-weight: 600;
}

.statement-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-600);
  font-size: 0.9rem;
}

.statement-toggle-arrow {
  display: inline-block;
  transition: transform 0.3s ease;
  font-size: 1.1rem;
}

.statement-header.collapsed .statement-toggle-arrow {
  transform: rotate(-90deg);
}

.statement-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
}

.statement-table thead {
  background: var(--gray-50);
  border-bottom: 2px solid var(--gray-200);
}

.statement-table th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 600;
  color: var(--gray-700);
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.statement-table tbody tr {
  border-bottom: 1px solid var(--gray-200);
  transition: var(--transition);
}

.statement-table tbody tr:hover {
  background: var(--gray-50);
}

.statement-table tbody tr:last-child {
  border-bottom: none;
}

.statement-table td {
  padding: 1rem 1.25rem;
  color: var(--gray-700);
  font-size: 0.95rem;
}

.statement-table.collapsed {
  display: none;
}

.statement-table.collapsed thead {
  display: none;
}

/* ---- Status Badge Styling ---- */
.status-badge {
  display: inline-block;
  padding: 0.375rem 0.875rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.status-badge.overdue {
  background: rgba(239, 68, 68, 0.1);
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge.outstanding {
  background: rgba(245, 158, 11, 0.1);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.paid {
  background: rgba(16, 185, 129, 0.1);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ---- Dark Mode for Statement Items ---- */
@media (prefers-color-scheme: dark) {
  .statement-items {
    background: var(--gray-700);
    border-color: var(--gray-600);
  }

  .statement-header {
    background: linear-gradient(135deg, var(--gray-700) 0%, var(--gray-600) 100%);
    border-bottom-color: var(--gray-600);
  }

  .statement-header:hover {
    background: linear-gradient(135deg, var(--gray-600) 0%, var(--gray-500) 100%);
  }

  .statement-header h3 {
    color: var(--gray-100);
  }

  .statement-toggle {
    color: var(--gray-400);
  }

  .statement-table {
    background: var(--gray-700);
  }

  .statement-table thead {
    background: var(--gray-600);
    border-bottom-color: var(--gray-500);
  }

  .statement-table th {
    color: var(--gray-300);
  }

  .statement-table tbody tr {
    border-bottom-color: var(--gray-600);
  }

  .statement-table tbody tr:hover {
    background: var(--gray-600);
  }

  .statement-table td {
    color: var(--gray-100);
  }

  .status-badge.overdue {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
  }

  .status-badge.outstanding {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
  }

  .status-badge.paid {
    background: rgba(16, 185, 129, 0.15);
    color: #86efac;
  }
}

@media (min-width: 768px) {
  .payment-container {
    padding: 2rem 1rem;
    margin: 2rem auto;
  }

  .payment-wrapper,
  .success-wrapper,
  .failure-wrapper,
  .customers-wrapper,
  .home-wrapper,
  .error-wrapper {
    padding: 2rem;
  }

  .header-content {
    flex-direction: row;
  }

  .app-header h1 {
    font-size: 2rem;
  }

  .company-logo {
    width: 80px;
    height: 80px;
  }

  .customer-card-amounts {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .amount-item.total {
    grid-column: 1 / -1;
  }

  .success-actions,
  .failure-actions,
  .error-actions {
    flex-direction: row;
    gap: 1rem;
  }

  .success-actions .btn,
  .failure-actions .btn,
  .error-actions .btn {
    flex: 1;
    margin: 0;
  }

  .action-buttons {
    flex-direction: row;
  }

  .action-buttons .btn {
    flex: 1;
  }
}

@media (min-width: 1024px) {
  .payment-container {
    max-width: 90%;
    padding: 2rem 1.5rem;
  }

  .payment-wrapper,
  .success-wrapper,
  .failure-wrapper,
  .customers-wrapper,
  .home-wrapper,
  .error-wrapper {
    padding: 2.5rem;
  }

  .success-icon,
  .failure-icon {
    width: 100px;
    height: 100px;
    font-size: 3rem;
  }
}

/* =============================================================================
   ACCESSIBILITY & PRINT STYLES
   ============================================================================= */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body {
    background: white;
  }

  .app-header,
  .app-footer,
  .btn {
    display: none;
  }

  .payment-container {
    padding: 0;
    max-width: 100%;
  }

  .payment-wrapper,
  .success-wrapper,
  .failure-wrapper,
  .customers-wrapper,
  .home-wrapper,
  .error-wrapper {
    box-shadow: none;
    border: 1px solid #333;
  }
}

/* ---- Focus Visible for Accessibility ---- */
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
}

/* ---- Dark Mode Support (Optional) ---- */
@media (prefers-color-scheme: dark) {
  body {
    background: var(--gray-900);
  }

  .mobile-container {
    background: var(--gray-800);
    color: var(--gray-100);
  }

  .payment-wrapper,
  .success-wrapper,
  .failure-wrapper,
  .customers-wrapper,
  .home-wrapper,
  .error-wrapper {
    background: var(--gray-800);
    border-color: var(--gray-700);
    color: var(--gray-100);
  }

  .payment-wrapper h2,
  .success-wrapper h2,
  .failure-wrapper h2,
  .customers-wrapper h2,
  .home-wrapper h2,
  .error-wrapper h2 {
    color: var(--primary-light);
  }

  label {
    color: var(--gray-300);
  }

  select,
  input[type='text'],
  input[type='email'],
  input[type='number'],
  textarea {
    background: var(--gray-700);
    border-color: var(--gray-600);
    color: var(--gray-100);
  }

  select:focus,
  input[type='text']:focus,
  input[type='email']:focus,
  input[type='number']:focus,
  textarea:focus {
    border-color: var(--primary-color);
  }

  .customer-info {
    background: var(--gray-700);
    color: var(--gray-100);
  }

  .transaction-details,
  .error-details,
  .failure-reasons,
  .features,
  .payment-info {
    background: var(--gray-700);
    border-color: var(--gray-600);
  }

  .detail-row,
  .features-list li {
    border-bottom-color: var(--gray-600);
  }

  .detail-label {
    color: var(--gray-400);
  }

  .detail-value,
  .customer-card h3,
  .transactions-details h3 {
    color: var(--gray-100);
  }

  .customer-card {
    background: var(--gray-700);
    border-color: var(--gray-600);
  }

  .customer-card-amounts {
    background: var(--gray-600);
  }

  .customer-email {
    color: var(--gray-400);
  }

  .amount-label {
    color: var(--gray-400);
  }

  .app-footer {
    background: var(--gray-900);
  }
}

/* ---- Dark Mode for Security Elements ---- */
@media (prefers-color-scheme: dark) {
  .security-key-value {
    background: var(--gray-600);
    border-color: var(--gray-500);
    color: var(--gray-100);
  }

  .security-key-value:hover {
    background: var(--primary-color);
  }

  .security-notice {
    background: rgba(16, 185, 129, 0.1);
  }

  .security-notice h3,
  .security-notice p {
    color: var(--gray-100);
  }

  .customer-info-sec {
    background: var(--gray-700);
    border-color: var(--primary-color);
  }

  .customer-info-sec p {
    color: var(--gray-100);
  }
}
