/* Clean style.css for the current EAA transaction workflow */
:root {
  --blue: #0057d9;
  --blue-dark: #003f9f;
  --blue-soft: #eaf2ff;
  --text: #102033;
  --muted: #627084;
  --border: #dce6f2;
  --white: #ffffff;
  --surface: #ffffff;
  --surface-soft: #fbfdff;
  --shadow: 0 20px 50px rgba(0, 57, 130, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  background: var(--white);
  color: var(--text);
}

main {
  flex: 1;
}

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

code {
  padding: 2px 6px;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue);
}

.hidden {
  display: none !important;
}

/* Header */
.top-header {
  background: var(--blue);
  color: var(--white);
  padding: 0 32px;
}

.header-inner {
  max-width: 1180px;
  min-height: 52px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand,
.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  position: relative;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--white);
  border-radius: 12px;
  overflow: hidden;
}

.brand-dot {
  width: 13px;
  height: 13px;
  display: block;
  border-radius: 50%;
  background: #00a3e0;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .95);
}

.brand strong {
  display: block;
  line-height: 1.1;
  font-size: 16px;
}

.brand span {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  opacity: .86;
}

.header-actions,
.campaign-actions,
.confirmation-actions,
.footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.header-login {
  color: var(--white) !important;
  border: 1px solid rgba(255, 255, 255, .85);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 900;
}

.header-login:hover {
  background: rgba(255, 255, 255, .12);
}

.header-join {
  background: var(--white);
  color: var(--blue) !important;
  padding: 11px 22px;
  border-radius: 999px;
  font-weight: 900;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  padding: 15px 23px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
  transition: .2s ease;
}

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

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

.btn-outline {
  background: var(--white);
  color: var(--blue);
  border: 1px solid var(--border);
}

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

/* Landing page */
.campaign {
  max-width: 820px;
  min-height: calc(100vh - 52px);
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.campaign-content {
  max-width: 760px;
  transform: translateY(-28px);
}

.campaign-label {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.campaign-content h1,
.confirmation-card h1,
.qr-left h1 {
  margin: 0 0 18px;
  font-size: 46px;
  line-height: 1.05;
  letter-spacing: -.03em;
}

.campaign-content h1 {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  font-size: 44px;
  line-height: 1.08;
}

.campaign-content p {
  max-width: 660px;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

/* How it works */
.usecases-section {
  max-width: 980px;
  min-height: calc(100vh - 120px);
  margin: 0 auto;
  padding: 72px 32px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-top: 1px solid var(--border);
}

.section-heading {
  margin-bottom: 24px;
  text-align: center;
}

.section-heading h2 {
  margin: 0 0 12px;
  font-size: 30px;
  line-height: 1.15;
}

.section-heading p {
  max-width: 760px;
  margin: 0 auto;
  color: var(--muted);
  line-height: 1.55;
}

.workflow-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 26px auto 20px;
}

.workflow-tab {
  min-width: 142px;
  padding: 13px 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  font-weight: 900;
}

.workflow-tab:hover,
.workflow-tab.active {
  background: var(--blue-soft);
  border-color: var(--blue);
}

.workflow-tab.active {
  background: var(--blue);
  color: var(--white);
}

.workflow-empty-state {
  max-width: 760px;
  margin: 0 auto 18px;
  padding: 16px 20px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.workflow-panels {
  max-width: 900px;
  margin: 0 auto;
}

.workflow-panel {
  display: none;
  grid-template-columns: 1fr 240px;
  gap: 22px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(0, 87, 217, .08);
}

.workflow-panel.active {
  display: grid;
}

.workflow-copy h3 {
  margin: 0 0 10px;
  font-size: 24px;
}

.workflow-copy>p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.6;
}

.workflow-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.workflow-list div,
.workflow-summary,
.workflow-detail-step {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-soft);
}

.workflow-list span,
.workflow-step-number,
.step-number {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 13px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 900;
}

.workflow-list p,
.workflow-detail-step p,
.step-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.workflow-summary ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.8;
}

.workflow-dialog-box {
  width: min(900px, 95vw);
}

.workflow-detail-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.workflow-detail-step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
}

.workflow-detail-step.endpoint-step {
  border-color: #cfe0ff;
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.endpoint-pill {
  display: inline-flex;
  max-width: 100%;
  margin: 4px 0 10px;
  padding: 8px 11px !important;
  border-radius: 12px !important;
  background: #102033 !important;
  color: #fff !important;
  font-weight: 900;
  overflow-wrap: anywhere;
  white-space: normal;
}

/* Generic forms/cards */
.steps-grid,
.form-grid,
.compact-dashboard-grid {
  display: grid;
  gap: 16px;
}

.steps-grid {
  grid-template-columns: repeat(4, 1fr);
}

.form-grid {
  grid-template-columns: repeat(2, 1fr);
}

.form-grid label {
  color: var(--text);
  font-weight: 800;
}

.form-grid input {
  width: 100%;
  padding: 14px;
  margin-top: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 15px;
  background: var(--white);
  color: var(--text);
}

.step-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--white);
  box-shadow: 0 12px 30px rgba(0, 57, 130, .06);
}

.step-number {
  width: 38px;
  height: 38px;
  margin-bottom: 18px;
  border-radius: 14px;
}

.step-card h3 {
  margin: 0 0 10px;
}

/* Verify / QR page */
.onboarding-page,
.confirmation-page {
  max-width: 1180px;
  width: 100%;
  margin: 0 auto;
  padding: 54px 32px 52px;
}

.qr-panel {
  display: grid;
  grid-template-columns: 1fr 430px;
  gap: 44px;
  align-items: start;
}

.qr-left {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.qr-left p,
.confirmation-text {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
}

.request-box,
.status-box,
.device-note {
  margin: 28px 0;
  padding: 22px;
  border: 1px solid #cfe0ff;
  border-radius: 24px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  box-shadow: 0 12px 30px rgba(0, 87, 217, .07);
}

.status-box {
  max-width: 640px;
  padding: 16px;
}

.request-summary {
  display: grid;
  gap: 12px;
}

.request-line {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid #e2ebf8;
  border-radius: 16px;
  background: var(--white);
}

.request-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 900;
}

.qr-card {
  padding: 32px;
  border-radius: 32px;
  background: var(--blue);
  color: var(--white);
  box-shadow: var(--shadow);
  text-align: center;
}

.qr-visual-wrap {
  width: 250px;
  height: 250px;
  margin: 0 auto 18px;
  padding: 14px;
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 18px 38px rgba(0, 0, 0, .18);
}

.dummy-qr-svg {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

.qr-payload-value {
  display: block;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 16px;
  background: rgba(255, 255, 255, .10);
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.verify-actions {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.verify-actions .btn {
  width: 100%;
  min-height: 54px;
}

/* Modal */
.modal,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(16, 32, 51, .58);
  backdrop-filter: blur(6px);
}

.modal.hidden,
.modal-backdrop.hidden,
.hidden.modal-backdrop {
  display: none !important;
}

.modal-box,
.wallet-modal,
.compact-wallet-modal {
  width: min(800px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--white);
  color: var(--text);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .30);
}

.modal-content {
  max-height: calc(86vh - 96px);
  overflow: auto;
}

.modal-actions,
.wallet-modal .compact-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.wallet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.modal-close {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}

/* Confirmation / dashboard */
.confirmation-card {
  max-width: 920px;
  margin: 0 auto;
  padding: 38px;
  border: 1px solid var(--border);
  border-radius: 32px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.success-circle {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin-bottom: 22px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--white);
  font-size: 42px;
  font-weight: 900;
}

.registration-preview,
.compact-preview {
  margin-top: 26px;
  padding: 26px;
  border-radius: 24px;
  background: var(--blue-soft);
}

.registration-preview h2,
.compact-preview h2 {
  margin: 0 0 20px;
  font-size: 22px;
}

.compact-section {
  margin-top: 22px;
}

.compact-section:first-of-type {
  margin-top: 0;
}

.compact-section h3 {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.verified-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.dashboard-page {
  max-width: 1180px !important;
  width: 100% !important;
  margin: 0 auto !important;
  padding: 54px 32px 52px !important;
}

.dashboard-page .dashboard-card {
  max-width: 920px !important;
}

.dashboard-section-switcher {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.dashboard-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.dashboard-toggle:hover,
.dashboard-toggle.active {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.dashboard-toggle strong,
.dashboard-toggle small {
  display: block;
}

.dashboard-toggle small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-toggle-icon {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--white);
  color: var(--blue);
  font-weight: 900;
  font-size: 18px;
}

.dashboard-empty-state {
  margin-top: 16px;
  padding: 16px 18px;
  border: 1px dashed var(--border);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

.dashboard-panels {
  margin-top: 16px;
}

.dashboard-panels .registration-preview {
  margin-top: 0 !important;
}

.dashboard-banking-area {
  margin-top: 24px !important;
}

.compact-dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Transaction login list */
.transaction-list,
.profile-list {
  display: grid;
  gap: 16px;
  margin-top: 28px;
}

.transaction-card,
.profile-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface-soft);
}

.transaction-card h3,
.profile-card h3 {
  margin: 6px 0;
  font-size: 22px;
}

.transaction-card p,
.profile-card p {
  margin: 0 0 6px;
  color: var(--muted);
}

.transaction-card small,
.profile-card small,
.profile-id {
  color: var(--blue);
  font-weight: 800;
}

/* Footer / Swagger */
.footer-box {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto 20px;
  padding: 0 32px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--white);
}

.footer-inner p {
  margin: 6px 0 0;
  color: var(--muted);
}

.footer-links a {
  color: var(--blue);
  font-weight: 900;
}

#swagger-ui {
  max-width: 1180px;
  margin: 24px auto;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--white);
}

@media (max-width: 950px) {

  .qr-panel,
  .workflow-panel.active {
    display: block;
  }

  .qr-card,
  .workflow-summary {
    margin-top: 18px;
  }

  .steps-grid,
  .form-grid,
  .workflow-list,
  .compact-dashboard-grid,
  .dashboard-section-switcher {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {

  .top-header,
  .campaign,
  .usecases-section,
  .onboarding-page,
  .confirmation-page,
  .dashboard-page,
  .footer-box {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  .header-inner {
    min-height: auto;
    padding: 12px 0;
  }

  .header-actions,
  .transaction-card,
  .profile-card,
  .footer-inner,
  .confirmation-actions,
  .modal-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .campaign-content h1,
  .qr-left h1,
  .confirmation-card h1 {
    font-size: 34px;
  }

  .btn {
    width: 100%;
  }

  .qr-visual-wrap {
    width: 210px;
    height: 210px;
  }

  .modal,
  .modal-backdrop {
    align-items: flex-start;
    padding: 14px;
  }

  .modal-box,
  .wallet-modal,
  .compact-wallet-modal {
    width: 100%;
    max-height: calc(100vh - 28px);
    border-radius: 20px;
    padding: 22px;
  }
}

/* Login transaction spacing fix */
.transaction-list,
.profile-list {
  margin-bottom: 34px;
}

.transaction-card,
.profile-card {
  margin-bottom: 18px;
}

.confirmation-card>.confirmation-actions {
  margin-top: 34px;
  padding-top: 0;
}

.transaction-list+.confirmation-actions,
.profile-list+.confirmation-actions {
  margin-top: 38px;
}

@media (max-width: 650px) {

  .transaction-list,
  .profile-list {
    margin-bottom: 26px;
  }

  .transaction-list+.confirmation-actions,
  .profile-list+.confirmation-actions {
    margin-top: 30px;
  }
}

/* Hero button centering fix */
.campaign {
  width: 100%;
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}

.campaign-content {
  width: 100%;
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 32px;
  padding-right: 32px;
}

.campaign-actions {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
  justify-content: center;
}

@media (max-width: 650px) {
  .campaign {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .campaign-content {
    padding-left: 18px;
    padding-right: 18px;
  }
}

/* Workflow dialog: keep workflow inside dialog viewport */
.workflow-dialog-box {
  width: min(980px, 95vw);
  max-height: min(760px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workflow-dialog-content {
  max-height: none;
  overflow: auto;
  padding-right: 4px;
}

.workflow-dialog-box .modal-actions {
  flex: 0 0 auto;
  background: var(--white);
}

/* Bank-styled API error dialog */
.api-error-modal {
  width: min(760px, calc(100vw - 48px));
}

.api-error-summary {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid #f2c7c7;
  border-radius: 18px;
  background: #fff7f7;
}

.api-error-summary p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.api-error-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #d92020;
  color: #fff;
  font-weight: 900;
}

.api-error-details {
  max-height: 320px;
  margin: 0;
  padding: 16px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #102033;
  color: #fff;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.api-error-copy-toast {
  min-height: 24px;
  margin-right: auto;
  padding: 7px 10px;
  border: 1px solid #9ed7b2;
  border-radius: 999px;
  background: #f0fff4;
  color: #116329;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.api-error-copy-toast-error {
  border-color: #f2c7c7;
  background: #fff7f7;
  color: #b42318;
}

.api-error-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

#copyApiError.copy-success {
  border-color: #9ed7b2;
  background: #f0fff4;
  color: #116329;
}

@media (max-width: 650px) {
  .api-error-actions {
    align-items: stretch;
  }

  .api-error-copy-toast {
    order: -1;
    margin-right: 0;
    text-align: center;
    white-space: normal;
  }
}
