/* Receipt Paper Style */
body {
  font-family: 'Courier New', Courier, monospace;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.receipt-wrapper {
  background: #fff;
  width: 100%;
  max-width: 600px;
  padding: 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-left: 1px dashed #999;
  border-right: 1px dashed #999;
  position: relative;
  padding:2rem;
  transition: max-width 0.4s ease;
}

.receipt-wrapper-wide {
  max-width: 720px;
}

/* Site Header */
.receipt-header {
  text-align: center;
  border-top: 3px solid #333;
  border-bottom: 1px dashed #999;
  padding: 30px 30px 20px 30px;
}

.receipt-header::before {
  content: '###############################################';
  display: block;
  font-size: 10px;
  letter-spacing: -1px;
  color: #333;
  margin-bottom: 20px;
  overflow: hidden;
}

.site-logo {
  margin-bottom: 10px;
  display: none;
}

.site-description {
  font-size: 12px;
  color: #666;
  text-transform: lowercase;
  margin-top: 10px;
}

/* Content sections */
.receipt-section {
  padding: 30px;
  text-align: center;
  /*border-top: 1px dashed #999;*/
}

.receipt-section:first-child {
  /*border-top: none;*/
}

.receipt-content {
  padding: 30px;
}

.section-title {
  font-size: 14px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 15px;
  text-align: center;
}

/* Form styling */
form {
  text-align: center;
  margin: 20px 0;
}

label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 5px;
  color: #666;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"] {
  width: 100%;
  padding: 10px;
  border: 1px dashed #999;
  background: #fafafa;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  margin-bottom: 15px;
}

input:focus {
  outline: none;
  border: 1px dashed #333;
  background: #fff;
}

button {
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  font-weight: bold;
  text-transform: uppercase;
  padding: 12px 24px;
  border: none;
  border-top: 1px dashed #333;
  border-bottom: 1px dashed #333;
  background: transparent;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s ease;
}

button:hover {
  letter-spacing: 2px;
  border-top: 2px dashed #333;
  border-bottom: 2px dashed #333;
  font-weight: 900;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:disabled:hover {
  letter-spacing: 1px;
  border-top: 1px dashed #333;
  border-bottom: 1px dashed #333;
  font-weight: bold;
}

/* Auth section */
#auth {
  text-align: center;
  padding: 15px 30px;
  border-bottom: 1px dashed #999;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-buttons-flex {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-content: center;
    align-items: center;
    justify-content: center;
}

#auth button {
  font-size: 12px;
  padding: 8px 16px;
  margin: 0 5px;
}

#user-info {
  margin-top: 0.8rem;
  font-size: 12px;
  color: #666;
  margin-left: 10px;
}

/* Links */
a {
  color: #333;
  text-decoration: none;
  display: inline-block;
  -webkit-tap-highlight-color: transparent;
}

a:link,
a:visited {
  color: #333;
}

a:hover,
a:active {
  color: #000;
  font-weight: bold;
}

/* Preserve QR code character rendering */
.qr-display,
.qr-display-small {
  /* Keep existing styles from qr-render.css */
}

/* HR styling */
hr {
  border: none;
  border-top: 1px dashed #ccc;
  margin: 30px 0;
}

/* Output section */
#output {
  text-align: center;
  padding: 20px;
  background: #fafafa;
  border: 1px dashed #999;
  margin: 20px 0;
}

#output p {
  margin: 10px 0;
  font-size: 12px;
}

#output code {
  background: #fff;
  padding: 5px 10px;
  border: 1px dashed #ccc;
  display: inline-block;
  font-size: 11px;
}

/* Receipt footer */
.receipt-footer {
  border-top: 1px dashed #999;
  border-bottom: 3px solid #333;
  padding: 20px 30px 30px 30px;
  text-align: center;
}

.receipt-footer::after {
  content: '###############################################';
  display: block;
  font-size: 10px;
  letter-spacing: -1px;
  color: #333;
  margin-top: 20px;
  overflow: hidden;
}

/* Responsive */
@media (max-width: 650px) {
  .receipt-wrapper {
    max-width: 100%;
  }
  
  .receipt-header,
  .receipt-section,
  .receipt-content,
  #auth,
  .receipt-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 420px) {
  .receipt-header,
  .receipt-section,
  .receipt-content,
  #auth,
  .receipt-footer {
    padding-left: 15px;
    padding-right: 15px;
    padding-top: 20px;
    padding-bottom: 20px;
  }
  
  .receipt-header {
    padding-top: 20px;
    padding-bottom: 15px;
  }
  
  .receipt-footer {
    padding-top: 15px;
    padding-bottom: 20px;
  }

  .auth-buttons-flex {
    flex-direction: column;
  }
  
  .qr-item {
    padding: 10px;
  }
  
  .qr-item-container {
    gap: 15px;
  }
}

/* Dashboard QR items layout */
.qr-item {
  border: 1px dashed #999;
  padding: 15px;
  margin-bottom: 15px;
}

.qr-item-container {
  display: flex;
  gap: 20px;
  align-items: center;
}

.qr-item-footer::after {
  content: '###############################################';
  display: block;
  font-size: 10px;
  letter-spacing: -1px;
  color: #333;
  margin-top: 20px;
  overflow: hidden;
}

.qr-display-section {
  flex-shrink: 0;
  width: fit-content;
}

/* Visual feedback for copy actions (replaces alerts) */
.secondary-btn.copied {
  color: #999;
  opacity: 0.9;
}

.secondary-btn.failed {
  color: #e0001e;
  font-weight: bold;
}

.qr-info-section {
  flex-grow: 1;
  min-width: 0;
}

.qr-field {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.qr-field input {
    max-width: 360px;
}

.url-actions {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 5px;
  justify-content: center;
}

.url-actions a {
  flex-shrink: 1;
  overflow-wrap: break-word;
  word-break: break-all;
}

@media (max-width: 624px) {
  .qr-item-container {
    flex-direction: column;
  }
  
  .qr-display-section {
    text-align: center;
  }

  .qr-display-section, .qr-info-section {
    width: 100%;
  }
}

@media (max-width: 460px) {
  .receipt-wrapper{
    padding:1rem;
  }
}

@media (max-width: 340px) {
  body {
    padding:0;
  }
  .receipt-wrapper{
    padding-left:0;
    padding-right:0;
  }
}

/* QR Size Dropdown */
.qr-size-dropdown {
  position: relative;
  display: inline-block;
  margin-top: 10px;
}

.qr-size-toggle {
  cursor: pointer;
  /*text-decoration: underline;*/
  color: #333;
  border: none;
  background: none;
  padding: 0;
  font-family: 'Courier New', monospace;
}

.qr-size-toggle:hover {
  font-weight: bold;
}

/*animate lerter spacing on hover*/

button.qr-size-toggle {
    border: 0;
    margin-bottom:0;
}

button.qr-size-toggle:hover {
    letter-spacing: 0.24em;
    border: 0;
    margin-bottom:0;
    
}

.qr-size-options {
  display: none;
  position: absolute;
  background: #fff;
  border: 1px dashed #333;
  padding: 10px;
  margin-top: 5px;
  min-width: 150px;
  z-index: 1000;
  box-shadow: 2px 2px 0px #333;
  left: 50%;
  transform: translateX(-50%);
}

.qr-size-options.show {
  display: block;
}

.qr-size-options a {
  display: block;
  padding: 5px 0;
  color: #333;
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  cursor: pointer;
}

.qr-size-options a:hover {
  border-bottom: 1px dashed #333;
  font-weight: bold;
}

/* Page transition overlay to mask layout jumps during navigation */
.page-transition-overlay {
  position: fixed;
  inset: 0 0 0 0;
  background: #e8e8e8;
  color: #505050
  pointer-events: none;
  opacity: 0;
  transition: opacity 300ms ease;
  z-index: 9999;
}
.page-transition-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Optional small spinner center */
.page-transition-overlay .spinner,
.spinner-box {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #333;
  font-family: 'Courier New', Courier, monospace;
  /* match dashboard small QR visual: dashed border and white background */
  border: 2px dashed #999;
  border-radius: 4px;
  box-sizing: border-box;
}

.page-transition-overlay .spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.page-transition-overlay .spinner::before,
.page-transition-overlay .spinner::after {
  content: '###############################################';
  display: block;
  font-size: 10px;
  letter-spacing: -1px;
  color: #505050;
  margin: 6px 0 0 0;
  overflow: hidden;
}
.page-transition-overlay .spinner::after {
  margin: 8px 0 0 0;
}

.page-transition-overlay .spinner .spinner-animation {
  display: inline-block;
  /* fixed square area for QR matrix (21 modules * 6px = 126px) */
  width: 126px;
  height: 126px;
  padding: 0;
  background: transparent;
  margin: 8px 0 6px 0;
  box-sizing: border-box;
  /* allow either grid-of-spans or character `.qr-display` inside without wrapping */
  display: block;
}

.page-transition-overlay .spinner .spinner-text {
  font-size: 12px;
  font-weight: bold;
  margin-top: 0;
  letter-spacing: 2px;
}

/* Loading QR module styles (dense, small) */
.spinner-animation .loading-qr-module {
  display: inline-block;
  width: 4px;
  height: 4px;
  margin: 1px;
  background: #fff;
  opacity: 0;
  transition: opacity 60ms linear;
}
.spinner-animation .loading-qr-module.on { background: #111; }
.spinner-text { margin-top: 6px; }

/* QR module grid inside spinner-animation */
.spinner-animation {
  line-height: 0;
}
.spinner-animation .qr-row {
  display: block;
  height: auto;
}
.spinner-animation .loading-qr-module {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin: 1px;
  background: #fff;
  opacity: 0;
  transition: opacity 80ms linear;
  border-radius: 1px;
}
.spinner-animation .loading-qr-module.on {
  background: #111;
}

/* Spinner-specific overrides so the project's character `.qr-display` fits inside */
.page-transition-overlay .spinner .spinner-animation .qr-display {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.page-transition-overlay .spinner .spinner-animation .qr-display-row {
  display: block !important;
  font-size: 4px !important;
  line-height: 4px !important;
  height: 4px !important;
  white-space: pre !important;
}

/* Use shared `.spinner-box` for inline spinners (no forced width/height) */
.spinner-box { background: #fff; }
/* ensure spinner-box children match the overlay inner sizing for QR */
.spinner-box .spinner-animation {
  width: 126px;
  height: 126px;
  padding: 0;
  margin: 8px 0 6px 0;
  box-sizing: border-box;
  display: block;
  overflow: hidden;
}
