/* Responsive presentation shared by the customer, login and admin screens. */
html { scroll-behavior: smooth; }
body { overflow-x: hidden; }
button, input { font: inherit; }
a, button, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #5aa8ff; outline-offset: 3px; }

.code-page .container { width: 100%; min-width: 0; }
.code-page .apple-card { min-width: 0; box-shadow: 0 20px 50px rgba(0, 0, 0, .10); }
.code-page .generator-input { min-width: 0; width: 100%; }
.code-page .input-wrapper .secondary-btn { flex: 0 0 auto; min-height: 52px; }
.code-page .field-hint { line-height: 1.5; }
.code-page .intro-copy { margin-bottom: 24px !important; }
.code-page .quick-steps { list-style: none; display: grid; gap: 12px; padding: 0; margin: 0 0 26px; }
.code-page .quick-steps li { display: flex; align-items: flex-start; gap: 11px; color: #424245; font-size: 14px; line-height: 1.45; }
.code-page .step-number { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #e8e8ed; color: #1d1d1f; font-size: 12px; font-weight: 700; }
.code-page .request-status { margin: 0 0 20px; padding: 12px 14px; border-radius: 12px; font-size: 14px; line-height: 1.45; border: 1px solid transparent; }
.code-page .request-status:empty { position: absolute; width: 1px; height: 1px; margin: 0; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.code-page .request-status[data-state="loading"] { background: #eaf3ff; border-color: #c9e0ff; color: #174a87; }
.code-page .request-status[data-state="success"] { background: #e9f7ef; border-color: #c6e9d3; color: #176039; }
.code-page .request-status[data-state="error"] { background: #fff0ee; border-color: #ffd2cd; color: #9d2b22; }
.code-page .request-status[data-state="info"] { background: #f5f5f7; border-color: #e5e5ea; color: #424245; }
.code-page #codeNumber { display: block; max-width: 100%; overflow-wrap: anywhere; font-size: clamp(2.25rem, 12vw, 3.5rem); }
.code-page .toast-container { width: min(420px, calc(100vw - 28px)); }
.code-page .toast { max-width: 100%; border-radius: 18px; line-height: 1.4; }
.code-page .footer-col a { display: inline-block; padding: 3px 0; }
.code-page .footer-social a { min-width: 40px; min-height: 40px; align-items: center; justify-content: center; }

.admin-page .table-scroll { width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; }
.admin-page .table-scroll .table { min-width: 670px; }
.admin-page .table-scroll--accounts .table { min-width: 850px; }
.admin-page .table td { vertical-align: middle; }
.admin-page .table td code { white-space: nowrap; }
.admin-page .table-hint { display: none; }
.admin-page .modal-content { max-height: calc(100dvh - 32px); overflow-y: auto; }
.admin-page .close { border: 0; font: inherit; font-size: 28px; flex: 0 0 auto; }
.admin-page .btn, .admin-page .close { min-height: 44px; }

.login-page .login-container { max-width: 420px; }
.login-page .form-group input, .login-page .login-btn { min-height: 48px; }

@media (max-width: 768px) {
  .code-page .container { padding-top: 112px !important; padding-bottom: 44px; }
  .code-page .page-header { margin-bottom: 24px; }
  .code-page .page-header p { font-size: clamp(16px, 3.5vw, 20px); line-height: 1.4; }
  .code-page .brand-row { margin-bottom: 22px !important; }
  .code-page .brand-row img { max-width: min(52vw, 210px); max-height: 80px; object-fit: contain; }
  .code-page .apple-card { padding: clamp(24px, 5vw, 36px); }
  .code-page .footer-grid { gap: 28px; }
  .admin-page .container { padding: 28px 16px 48px; }
  .admin-page .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .admin-page .stat-card { padding: 20px 16px; }
  .admin-page .section { margin-bottom: 24px; }
  .admin-page .section-header { gap: 14px; padding: 20px; }
  .admin-page .section-body { padding: 16px !important; }
  .admin-page .table-hint { display: block; color: #6e6e73; font-size: 13px; margin: 0 0 8px; }
  .admin-page .modal-content { margin: 16px auto; width: calc(100% - 32px); padding: 24px; }
}

@media (max-width: 480px) {
  .code-page .container { padding-left: 14px; padding-right: 14px; }
  .code-page .apple-card { border-radius: 20px; padding: 24px 20px; }
  .code-page .page-header h1 { font-size: clamp(30px, 9vw, 42px); }
  .code-page .page-header > img { max-width: 58vw; max-height: 54px; }
  .code-page .brand-row img { max-width: 52vw; max-height: 68px; }
  .code-page .primary-btn { max-width: none; min-height: 52px; }
  .code-page .secondary-btn { min-height: 48px; }
  .code-page .footer-note { font-size: 12px; line-height: 1.5; }
  .code-page .site-footer { padding: 28px 0 20px; }
  .code-page .footer-container { padding: 0 20px; }
  .code-page .footer-grid { gap: 18px 16px; padding-bottom: 18px; margin-bottom: 16px; }
  .code-page .footer-col { gap: 6px; min-width: 0; }
  .code-page .footer-col ul { gap: 3px; }
  .code-page .footer-col.brand-col { min-width: 0; flex-direction: row; align-items: center; text-align: left; padding-top: 12px; margin-top: 0; }
  .code-page .brand-col img { width: 30px; height: 30px; margin-bottom: 0; }
  .code-page .brand-col p { max-width: none; }
  .code-page .footer-bottom { gap: 10px; }
  .code-page .footer-social { padding-bottom: 8px; margin-bottom: 0; }
  .code-page .footer-note { margin-top: 30px !important; margin-bottom: 10px !important; }
  .code-page .quick-steps { gap: 10px; margin-bottom: 20px; }
  .code-page .quick-steps li { font-size: 14px; }
  .admin-page .header { padding: 10px 16px; }
  .admin-page .header h1 { font-size: 1rem; line-height: 1.35; }
  .admin-page .container { padding: 20px 12px 36px; }
  .admin-page .stats-grid { gap: 10px; }
  .admin-page .stat-card { padding: 16px 12px; }
  .admin-page .stat-card h3 { font-size: .8rem; line-height: 1.35; }
  .admin-page .stat-card .number { font-size: 1.6rem; }
  .admin-page .section-header { align-items: stretch; flex-direction: column; padding: 18px 16px; }
  .admin-page .section-header h2 { font-size: 1.1rem; }
  .admin-page .section-header .btn { width: 100%; }
  .admin-page .section-body { padding: 14px !important; }
  .admin-page .modal-content { width: calc(100% - 20px); margin: 10px auto; padding: 20px; max-height: calc(100dvh - 20px); }
  .login-page { padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); }
  .login-page .login-container { padding: 28px 22px; }
}

@media (max-width: 360px) {
  .code-page .input-wrapper { flex-wrap: wrap; }
  .code-page .input-wrapper .secondary-btn { width: 100%; }
  .code-page .validation-icon { right: 14px !important; top: 15px; }
  .admin-page .stats-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
