:root {
    --portal-bg: #f5f5f5;
    --portal-surface: #ffffff;
    --portal-panel: #f2f2f2;
    --portal-border: #d6d8dc;
    --portal-border-soft: #e5e7eb;
    --portal-text: #1f2937;
    --portal-muted: #5f6875;
    --portal-faint: #8b94a1;
    --portal-red: #fa0032;
    --portal-red-soft: #fff1f4;
    --portal-red-panel: #fff4f6;
    --portal-code: #f6f7f8;
}

html {
    min-width: 1140px;
    background: var(--portal-bg);
    font-size: 14px;
}

* {
    box-sizing: border-box;
}

body {
    max-width: 1140px;
    min-width: 1140px;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--portal-surface);
    color: var(--portal-text);
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 12px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
}

.portal-page {
    max-width: 1140px;
    min-height: 100vh;
    margin: 0 auto;
    background: var(--portal-surface);
}

a {
    color: var(--portal-red);
    text-decoration: none;
}

a:hover {
    color: var(--portal-red);
    text-decoration: underline;
}

.portal-topbar {
    height: 61px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px 0 22px;
    background: var(--portal-surface);
    border-bottom: 1px solid var(--portal-border-soft);
}

.portal-brand {
    display: flex;
    align-items: center;
    height: 100%;
}

.bank-logo {
    display: inline-flex;
    align-items: center;
    width: 112px;
    height: 34px;
}

.bank-logo:hover {
    text-decoration: none;
}

.bank-logo img {
    display: block;
    width: auto;
    max-width: 112px;
    height: 34px;
}

.brand-separator {
    display: inline-block;
    width: 1px;
    height: 28px;
    margin: 0 18px 0 1px;
    background: #d5d9df;
}

.portal-title {
    color: #1f2933;
    font-size: 14px;
    font-weight: 600;
}

.top-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.top-links a {
    color: #2f3946 !important;
    font-size: 12px;
    font-weight: 500;
}

.app-shell {
    display: grid;
    grid-template-columns: 258px minmax(0, 1fr);
    min-height: calc(100vh - 85px);
    background: var(--portal-surface);
}

.sidebar {
    padding: 16px 21px 26px;
    background: var(--portal-surface);
    border-right: 1px solid var(--portal-border-soft);
}

.sidebar-section + .sidebar-section {
    margin-top: 18px;
}

.sidebar-heading {
    margin: 0 0 9px 3px;
    color: #4f5966;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .25px;
    line-height: 1;
    text-transform: uppercase;
}

.product-card,
.sidebar-menu {
    border: 1px solid var(--portal-border);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.sidebar-menu {
    margin-top: 14px;
    padding: 0 0 15px;
}

.sidebar-menu .sidebar-section {
    margin: 0;
    padding: 16px 11px 0;
}

.sidebar-menu .sidebar-section + .sidebar-section {
    border-top: 1px solid #e4e6ea;
    margin: 14px 11px 0;
    padding: 17px 0 0;
}

.product-link,
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 42px;
    color: #303b48 !important;
    font-size: 12px;
    font-weight: 600;
}

.product-link {
    padding: 0 13px;
}

.product-link + .product-link {
    border-top: 1px solid #ebecef;
}

.product-link.active {
    min-height: 40px;
    background: var(--portal-red);
    color: #fff !important;
}

.product-link i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    color: currentColor;
    font-size: 17px;
    line-height: 1;
}

.sidebar-link i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    color: currentColor;
    font-size: 17px;
    line-height: 1;
}

.sidebar-link {
    margin: 0 -1px;
    padding: 0 10px;
    color: #1f2933 !important;
    border-radius: 0;
}

.sidebar-link.active {
    position: relative;
    margin: 0 -2px;
    background: linear-gradient(90deg, #fff8fa 0%, #ffecef 100%);
    color: var(--portal-red) !important;
}

.sidebar-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--portal-red);
}

.reference-link {
    align-items: flex-start;
    min-height: 54px;
    padding-top: 8px;
}

.reference-link small,
.reference-link strong {
    display: block;
}

.reference-link strong {
    color: #293443;
    font-weight: 700;
}

.reference-link small {
    margin-top: 2px;
    color: #6e7783;
    font-size: 9px;
    font-weight: 500;
}

.content {
    padding: 0 0 12px;
    background: var(--portal-bg);
    min-width: 0;
    width: 100%;
}

.portal-hero {
    height: 74px;
    padding: 16px 30px 12px;
    background: var(--portal-surface);
    border-bottom: 1px solid var(--portal-border);
}

.eyebrow {
    margin: 0 0 2px;
    color: var(--portal-red);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 1.5px;
    line-height: 1.2;
    text-transform: uppercase;
}

.portal-hero h1 {
    margin: 0 0 2px;
    color: #151d2a;
    font-size: 20px;
    font-weight: 500;
    letter-spacing: -.2px;
    line-height: 24px;
}

.portal-hero p:last-child {
    margin: 0;
    color: #5f6875;
    font-size: 12px;
    line-height: 16px;
}

.flow-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(148px, 1fr));
    gap: 25px;
    padding: 16px 22px 19px;
    background: #f5f5f5;
}

.flow-card {
    height: 60px;
    min-height: 60px;
    padding: 12px 8px 10px;
    text-align: center;
    background: #fff;
    border: 1px solid #d7d9de;
    border-radius: 9px;
}

.flow-card strong,
.flow-card span {
    display: block;
}

.flow-card strong {
    color: #1c2532;
    font-size: 11px;
    font-weight: 500;
    line-height: 15px;
}

.flow-card span {
    margin-top: 2px;
    color: #526173;
    font-size: 9px;
    line-height: 12px;
    white-space: nowrap;
}

.quickstart-card {
    margin: 0 22px 11px;
    overflow: hidden;
    background: var(--portal-surface);
    border: 1px solid #d6d8dc;
    border-radius: 10px;
}

.quickstart-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 43px;
    padding: 0 14px;
    border-bottom: 1px solid #d8dadd;
}

.step-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 23px;
    height: 23px;
    flex: 0 0 23px;
    color: #fff;
    background: var(--portal-red);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    line-height: 23px;
}

.quickstart-card h2 {
    margin: 0;
    color: #121a27;
    font-size: 13px;
    font-weight: 600;
}

.quickstart-card__body {
    padding: 14px 14px 11px;
}

.quickstart-card__body p {
    margin: 0 0 10px;
    color: #566170;
    font-size: 12px;
    line-height: 19px;
}

.quickstart-card code {
    color: #445163;
    font-family: Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 11px;
}

.portal-alert {
    margin: 0 0 9px;
    padding: 8px 11px;
    font-size: 12px;
    border-radius: 6px;
}

.signup-form__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 130px;
    gap: 6px;
}

.signup-form input[type='email'] {
    width: 100%;
    height: 31px;
    padding: 0 16px;
    color: #344054;
    background: #fff;
    border: 1px solid #d7d9de;
    border-radius: 999px;
    font-size: 13px;
    outline: none;
}

.signup-form input[type='email']::placeholder {
    color: #6f7784;
}

.signup-form input[type='email']:focus {
    border-color: var(--portal-red);
    box-shadow: 0 0 0 3px rgba(255, 0, 63, .08);
}

.signup-form button,
.production-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 31px;
    padding: 0 17px;
    color: #fff;
    background: var(--portal-red);
    border: 1px solid var(--portal-red);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.signup-form button {
    font-weight: 500;
}

.signup-form button:hover,
.production-cta:hover {
    color: #fff;
    background: #e60039;
    text-decoration: none;
}

.signup-form button:disabled {
    cursor: wait;
    opacity: .82;
}

.button-spinner,
.loading-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 999px;
    animation: portal-spin .7s linear infinite;
}

.signup-form.is-submitting .button-spinner {
    display: inline-block;
}

.signup-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 12px;
    color: var(--portal-red);
    background: var(--portal-red-panel);
    border: 1px solid #ff9bad;
    border-radius: 7px;
}

.signup-loading .loading-spinner {
    display: inline-block;
    border-color: #ff9bad;
    border-top-color: var(--portal-red);
}

@keyframes portal-spin {
    to { transform: rotate(360deg); }
}

.consent-box {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    min-height: 0;
    margin: 7px 0 0;
    padding: 10px 11px;
    color: var(--portal-red);
    background: var(--portal-red-panel);
    border: 1px solid #ff9bad;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
}

.consent-box a {
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.consent-box input[type='checkbox'] {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    margin: 1px 0 0;
    accent-color: var(--portal-red);
}

.consent-validation-message {
    display: block;
    margin-top: 6px;
}

.platform-note {
    margin: 7px 0 0 !important;
    font-size: 12px;
    line-height: 15px !important;
}

.platform-note a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.language-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0 0 7px;
}

.language-tabs span {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 10px;
    color: #687386;
    background: #fff;
    border: 1px solid #d0d3d8;
    border-radius: 4px;
    font-size: 10px;
    line-height: 18px;
}

.language-tabs span.active,
.language-tabs span:first-child {
    color: #fff;
    background: var(--portal-red);
    border-color: var(--portal-red);
}

pre {
    margin: 0 0 7px;
    padding: 11px 13px;
    min-height: 132px;
    overflow: hidden;
    white-space: pre-wrap;
    color: #17435c;
    background: var(--portal-code);
    border: 1px solid #d8dadd;
    border-radius: 6px;
    font-family: Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 12px;
    line-height: 20px;
}

pre code {
    color: inherit;
    font: inherit;
}

.code-keyword { color: #006ecb; }
.code-fn { color: #c90039; }
.code-key { color: #0c8a60; }
.code-string { color: #027a48; }

.documentation-link {
    display: inline-block;
    margin-left: 2px;
    color: var(--portal-red);
    font-size: 12px;
}

.production-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 43px;
    margin: 0 22px 11px;
    padding: 14px 14px 11px;
    background: var(--portal-surface);
    border: 1px solid #d6d8dc;
    border-radius: 10px;
}

.production-card h2 {
    margin: 0 0 1px;
    color: #172033;
    font-size: 13px;
    font-weight: 700;
    line-height: 16px;
}

.production-card p {
    margin: 0;
    color: #5f6875;
    font-size: 11px;
    line-height: 14px;
}

.production-card .production-cta {
    min-height: 28px;
    color: var(--portal-red);
    background: #fff;
    font-size: 11px;
}

.production-card .production-cta:hover {
    color: #fff;
    background: var(--portal-red);
}

.placeholder-panel {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin: 22px;
    padding: 22px;
    background: #fff;
    border: 1px solid #d6d8dc;
    border-radius: 10px;
}

.placeholder-panel__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    color: var(--portal-red);
    background: var(--portal-red-soft);
    border-radius: 10px;
}

.placeholder-panel__icon svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.placeholder-panel h2 {
    margin: 1px 0 4px;
    color: #172033;
    font-size: 15px;
    font-weight: 600;
}

.placeholder-panel p {
    margin: 0;
    color: #5f6875;
    font-size: 12px;
    line-height: 18px;
}

.modules-page {
    min-height: calc(100vh - 85px);
    padding: 20px;
    background: #fff;
}

.modules-header {
    margin: 0 0 22px;
}

.modules-header h1 {
    margin: 0 0 2px;
    color: #05070a;
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -.2px;
    line-height: 24px;
}

.modules-header p {
    margin: 0;
    color: #111827;
    font-size: 12px;
    line-height: 17px;
}

.module-card {
    overflow: hidden;
    margin: 0 0 8px;
    background: #fff;
    border: 1px solid #d6d8dc;
    border-radius: 9px;
}

.module-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 54px;
    padding: 10px 14px;
}

.module-version-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 74px;
    padding: 10px 20px;
}

.module-version-row + .module-version-row {
    border-top: 1px solid #d8dadd;
}

.module-version-row--latest .module-platform small {
    margin-top: 1px;
    color: #4f5966;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .5px;
    line-height: 12px;
}

.module-platform {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.module-platform strong,
.module-platform small {
    display: block;
}

.module-platform strong {
    margin-bottom: 1px;
    color: #0c1118;
    font-size: 13px;
    font-weight: 700;
    line-height: 17px;
}

.module-platform small {
    color: #111827;
    font-size: 11px;
    font-weight: 400;
    line-height: 15px;
}

.module-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    color: #fff;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.module-logo--woo { background: #7f54b3; }
.module-logo--ps { background: #174ea6; }
.module-logo--oc { background: #42a8dc; }
.module-logo--abicart { background: #f97316; }

.module-card__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #657080;
}

.module-card__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    color: #657080;
    background: transparent;
    border: 0;
    border-radius: 4px;
}

.module-card__toggle:hover {
    color: #111827;
    background: #f3f4f6;
}

.module-card__toggle:focus-visible {
    outline: 2px solid #174ea6;
    outline-offset: 2px;
}

.version-badge {
    display: inline-flex;
    align-items: center;
    min-height: 16px;
    padding: 0 6px;
    color: #128c2e;
    background: #d7f7c7;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
}

.module-card__details {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 57px;
    padding: 10px 14px;
    border-top: 1px solid #d8dadd;
}

.module-version span,
.module-version strong {
    display: block;
}

.module-version span {
    color: #5f6875;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .5px;
    line-height: 10px;
}

.module-version strong {
    color: #111827;
    font-size: 11px;
    font-weight: 500;
    line-height: 14px;
}

.module-card__details p {
    margin: 0;
    color: #111827;
    font-size: 11px;
    line-height: 15px;
}

.module-card__details--module-version .module-version .version-badge {
    display: inline-flex;
    margin-top: 2px;
    line-height: 16px;
}

.module-card__details--module-version .module-version > span:first-child {
    font-size: 9px;
    letter-spacing: .2px;
    white-space: nowrap;
}

.module-card__details--module-version p {
    transform: translateY(4px);
}

.module-buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.module-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 78px;
    min-height: 36px;
    padding: 0 15px;
    color: #05070a !important;
    background: #fff;
    border: 1px solid #d6d8dc;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.module-button:hover {
    color: #05070a !important;
    background: #f7f8fa;
    text-decoration: none;
}

.module-pdf-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 78px;
    min-height: 36px;
    padding: 0 15px;
    color: #05070a;
    background: #fff;
    border: 1px solid #d6d8dc;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.module-pdf-button:disabled {
    color: #05070a;
    opacity: 1;
    cursor: not-allowed;
}

.module-download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 28px;
    padding: 0 10px;
    color: #05070a !important;
    background: #fff;
    border: 1px solid #d6d8dc;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.module-download-button:hover {
    color: #05070a !important;
    background: #f7f8fa;
    text-decoration: none;
}

.module-version-row .module-download-button {
    min-width: 135px;
    min-height: 42px;
    padding: 0 16px;
    font-size: 13px;
}

.module-card__details--module-version .module-download-button {
    min-width: 135px;
    min-height: 36px;
    padding: 0 16px;
    font-size: 13px;
}

.older-versions {
    min-height: 35px;
    padding: 0 14px;
    border-top: 1px solid #d8dadd;
}

.older-versions summary {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    color: #05070a;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    list-style: none;
}

.older-versions summary::-webkit-details-marker {
    display: none;
}

.older-versions summary::before {
    content: "⌄";
    color: #111827;
    font-size: 14px;
    line-height: 1;
}

.older-versions[open] summary::before {
    content: "⌃";
}

.older-versions p {
    margin: 0 0 11px 20px;
    color: #5f6875;
    font-size: 11px;
}

.older-version {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    margin: 0 0 10px 20px;
}

.older-version strong {
    color: #111827;
    font-size: 11px;
    font-weight: 500;
}

.module-section-heading {
    margin: 16px 0 14px;
    color: #5f6875;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .4px;
    line-height: 12px;
    text-transform: uppercase;
}

.module-card--contact {
    margin-top: 0;
}

.module-card--contact .module-card__header {
    min-height: 60px;
}

.api-documentation-page {
    min-height: calc(100vh - 85px);
    background: #fff;
}

.api-documentation-header {
    padding: 18px 30px 14px;
    background: #fff;
    border-bottom: 1px solid #d6d8dc;
}

.api-documentation-header h1 {
    margin: 0 0 3px;
    color: #151d2a;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -.2px;
    line-height: 24px;
}

.api-documentation-header p:last-of-type {
    margin: 0;
    color: #5f6875;
    font-size: 12px;
    line-height: 16px;
}

.api-documentation-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.api-documentation-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 7px 12px;
    color: #1f2933;
    background: #fff;
    border: 1px solid #d8dbe1;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 16px;
    text-decoration: none;
}

.api-documentation-tab:hover {
    color: var(--portal-red);
    border-color: rgba(255, 0, 68, .35);
    text-decoration: none;
}

.api-documentation-tab.active {
    color: #fff;
    background: var(--portal-red);
    border-color: var(--portal-red);
}

.api-documentation-shell {
    min-height: calc(100vh - 160px);
    background: #fff;
}

.api-documentation-shell redoc {
    display: block;
    min-height: calc(100vh - 160px);
}

.api-documentation-shell redoc search,
.api-documentation-shell redoc input[placeholder='Search'],
.api-documentation-shell redoc input[aria-label='Search'] {
    display: none !important;
}

.api-documentation-shell redoc > div > div:first-child {
    width: 260px !important;
    min-width: 260px !important;
}

.api-documentation-shell redoc > div > div:nth-child(3) {
    display: block !important;
    width: calc(100% - 260px) !important;
    max-width: none !important;
}

.api-documentation-shell redoc > div > div:nth-child(4),
.api-documentation-shell redoc .api-content > div > div > div:nth-child(2) {
    display: none !important;
}

.api-documentation-shell redoc .api-content > div > div > div:first-child {
    width: 100% !important;
    max-width: none !important;
}

.api-documentation-shell redoc pre,
.api-documentation-shell redoc code {
    white-space: pre-wrap !important;
}

.portal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 24px;
    padding: 0 22px;
    color: #7b8490;
    background: #fff;
    border-top: 1px solid var(--portal-border-soft);
    font-size: 10px;
    line-height: 24px;
}

.portal-footer strong,
.portal-footer a {
    color: var(--portal-red);
    font-weight: 700;
}

.portal-footer nav {
    display: flex;
    align-items: center;
    gap: 5px;
}

.field-validation-error,
.validation-summary-errors,
.text-danger {
    color: var(--portal-red) !important;
    font-size: 12px;
}

@media (max-width: 840px) {
    body { min-width: 0; }

    .portal-topbar {
        padding: 0 16px;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .flow-cards,
    .signup-form__row {
        grid-template-columns: 1fr;
    }
}
