:root {
    color-scheme: light;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f6f8;
    color: #17202a;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f4f6f8;
}

.site-body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
}

.site-header {
    width: 100%;
    border-bottom: 1px solid #dce3ea;
    background: #ffffff;
}

.site-header__inner,
.site-footer__inner {
    width: min(100%, 960px);
    margin: 0 auto;
    padding-right: 20px;
    padding-left: 20px;
}

.site-header__inner {
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.site-brand {
    min-width: 0;
}

.site-brand__logo {
    display: block;
    width: auto;
    height: auto;
    max-width: 220px;
    object-fit: contain;
}

.site-brand__name {
    color: #12395f;
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.2;
}

.site-brand__tagline {
    margin-top: 4px;
    color: #4e6072;
    font-size: 1rem;
    line-height: 1.4;
}

.site-trust {
    flex: 0 0 auto;
    border: 1px solid #cbd7e3;
    border-radius: 999px;
    background: #f7fafc;
    color: #38546d;
    padding: 8px 12px;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.header-actions {
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 6px;
    min-width: 0;
    padding-top: 12px;
}

.header-logout-form {
    margin: 0;
    order: 1;
}

.logout-link {
    border: 0;
    background: transparent;
    color: #5f6f86;
    padding: 0;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
}

.logout-link:hover,
.logout-link:focus {
    color: #1769aa;
    text-decoration: underline;
    outline: 0;
}

.header-actions .site-trust {
    order: 2;
}

.page-shell {
    width: min(100%, 560px);
    margin: 0 auto;
    padding: 24px 20px 48px;
    flex: 1 0 auto;
}

.panel {
    background: #ffffff;
    border: 1px solid #d8e0e8;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 12px 28px rgba(23, 32, 42, 0.07);
}

.dues-panel {
    padding: 28px;
}

.portal-panel {
    padding: 28px;
}

.otp-panel {
    padding: 28px;
}

.page-title {
    margin: 0 0 6px;
    font-size: 1.5rem;
    line-height: 1.2;
}

.panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.panel-header .page-title {
    margin-bottom: 6px;
}

.logout-button {
    border: 1px solid #d6e0ea;
    border-radius: 6px;
    background: #ffffff;
    color: #657384;
    padding: 7px 10px;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.logout-button:hover,
.logout-button:focus {
    border-color: #1769aa;
    color: #1769aa;
    background: #f7fafc;
    outline: 0;
}

.muted {
    color: #657384;
    margin: 0 0 22px;
    line-height: 1.5;
}

.form-row {
    margin-bottom: 18px;
}

.form-hint {
    margin: 10px 0 0;
    color: #718092;
    font-size: 0.86rem;
    line-height: 1.45;
    text-align: center;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 46px;
    border: 1px solid #c7d1dc;
    border-radius: 6px;
    padding: 10px 12px;
    font: inherit;
    background: #ffffff;
    color: #17202a;
}

input:focus {
    border-color: #1769aa;
    box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.14);
    outline: 0;
}

.otp-form {
    margin-top: 18px;
}

.reference-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #cbd7e3;
    border-radius: 999px;
    background: #f7fafc;
    color: #38546d;
    padding: 7px 11px;
    margin: -6px 0 16px;
    font-size: 0.9rem;
    line-height: 1.2;
}

.reference-badge strong {
    color: #12395f;
    letter-spacing: 0.04em;
}

.reference-help {
    margin: 6px 0 18px;
    color: #718092;
    font-size: 0.84rem;
    line-height: 1.4;
}

.otp-inputs {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.otp-digit {
    width: 100%;
    min-height: 52px;
    padding: 8px 4px;
    text-align: center;
    font-size: 1.35rem;
    font-weight: 800;
    color: #12395f;
}

.otp-actions {
    display: grid;
    gap: 14px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #edf1f5;
}

.otp-actions a {
    color: #1769aa;
    font-size: 0.94rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.otp-actions a:hover,
.otp-actions a:focus {
    text-decoration: underline;
}

.resend-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #657384;
    font-size: 0.92rem;
    line-height: 1.35;
}

.resend-note button {
    border: 1px solid #d6e0ea;
    border-radius: 6px;
    background: #f7fafc;
    color: #718092;
    padding: 7px 10px;
    font: inherit;
    font-weight: 700;
    cursor: not-allowed;
}

.resend-note button:not(:disabled) {
    border-color: #1769aa;
    background: #ffffff;
    color: #1769aa;
    cursor: pointer;
}

.resend-note button:not(:disabled):hover,
.resend-note button:not(:disabled):focus {
    background: #f4f8fc;
    outline: 0;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 6px;
    background: #1769aa;
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 140ms ease, box-shadow 140ms ease;
}

.button:hover,
.button:focus {
    background: #12598f;
}

.button:focus {
    box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.22);
    outline: 0;
}

.button.secondary {
    background: #eef3f8;
    color: #17202a;
}

.button.secondary:hover,
.button.secondary:focus {
    background: #dfe8f1;
}

.alert {
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 18px;
    line-height: 1.45;
}

.alert.error {
    background: #fff0f0;
    color: #9f1d1d;
    border: 1px solid #f1c2c2;
}

.alert.info {
    background: #eef7ff;
    color: #1f5f8b;
    border: 1px solid #c5dff4;
}

.access-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 18px 0;
}

.access-steps span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #38546d;
    padding: 4px 2px;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
}

.access-steps strong {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cbd7e3;
    border-radius: 999px;
    background: #ffffff;
    color: #1769aa;
    font-size: 0.82rem;
    line-height: 1;
}

.trust-note {
    border: 1px solid #cbd7e3;
    border-radius: 8px;
    background: #f7fafc;
    color: #38546d;
    padding: 14px;
    margin-bottom: 18px;
    font-size: 0.94rem;
    line-height: 1.5;
}

.unit-list {
    display: grid;
    gap: 12px;
}

.unit-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border: 1px solid #d6e0ea;
    border-radius: 8px;
    padding: 16px;
    color: inherit;
    text-decoration: none;
    background: #ffffff;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.unit-card:hover,
.unit-card:focus {
    border-color: #1769aa;
    background: #f7fafc;
    box-shadow: 0 8px 18px rgba(23, 32, 42, 0.08);
    outline: 0;
    transform: translateY(-1px);
}

.unit-card:active {
    transform: translateY(0);
}

.unit-card__content {
    min-width: 0;
}

.unit-card strong {
    display: block;
    margin-bottom: 4px;
}

.unit-card__action {
    flex: 0 0 auto;
    color: #1769aa;
    font-size: 0.92rem;
    font-weight: 800;
}

.due-grid,
.line-item-grid {
    display: grid;
    gap: 14px;
}

.due-total-summary {
    display: grid;
    gap: 8px;
    border: 1px solid #cbd7e3;
    border-radius: 8px;
    background: #f7fafc;
    padding: 18px;
    margin: 20px 0 18px;
}

.due-total-summary span {
    color: #526477;
    font-size: 0.95rem;
    font-weight: 700;
}

.due-total-summary strong {
    color: #12395f;
    font-size: 2rem;
    line-height: 1.1;
}

.due-total-summary small {
    color: #657384;
    font-size: 0.95rem;
    line-height: 1.35;
}

.due-section {
    padding-top: 18px;
    margin-top: 18px;
    border-top: 1px solid #edf1f5;
}

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

.section-heading {
    margin-bottom: 10px;
}

.section-heading .section-title {
    margin-bottom: 4px;
}

.section-heading p {
    margin: 0;
    color: #657384;
    font-size: 0.92rem;
    line-height: 1.45;
}

.due-row,
.line-item-row,
.payment-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #edf1f5;
    padding-bottom: 10px;
    line-height: 1.4;
}

.due-row:last-child,
.line-item-row:last-child,
.payment-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.due-row span:first-child,
.line-item-row span:first-child,
.payment-row span:first-child {
    color: #657384;
}

.due-row strong,
.line-item-row strong {
    text-align: right;
}

.amount-total {
    font-size: 1.2rem;
    color: #1769aa;
}

.section-title {
    margin: 0 0 14px;
    font-size: 1rem;
    line-height: 1.3;
    color: #17202a;
}

.payment-grid {
    display: grid;
    gap: 12px;
}

.copy-value {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
    text-align: right;
}

.copy-value strong {
    overflow-wrap: anywhere;
}

.copy-button {
    flex: 0 0 auto;
    min-width: 36px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid #c7d1dc;
    border-radius: 6px;
    background: #ffffff;
    color: #1769aa;
    padding: 0 9px;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.copy-button:hover,
.copy-button:focus {
    border-color: #1769aa;
    background: #f4f8fc;
    outline: 0;
}

.copy-button svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.copy-toast {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%) translateY(12px);
    opacity: 0;
    pointer-events: none;
    border-radius: 6px;
    background: #17202a;
    color: #ffffff;
    padding: 10px 14px;
    font-weight: 700;
    transition: opacity 160ms ease, transform 160ms ease;
}

.copy-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.site-footer {
    width: 100%;
    border-top: 1px solid #dce3ea;
    background: #ffffff;
    color: #657384;
}

.site-footer__inner {
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    font-size: 0.9rem;
    line-height: 1.45;
}

@media (max-width: 640px) {
    .site-header__inner {
        min-height: auto;
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 14px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .site-trust {
        width: auto;
        border-radius: 8px;
        padding: 6px 10px;
        font-size: 0.78rem;
        white-space: nowrap;
        text-align: left;
    }

    .header-actions {
        align-items: flex-end;
        justify-content: flex-start;
        gap: 8px;
        flex: 0 0 auto;
        padding-top: 2px;
    }

    .site-brand__logo {
        max-width: 180px;
    }

    .page-shell {
        padding: 18px 16px 36px;
    }

    .panel {
        padding: 20px;
    }

    .dues-panel {
        padding: 20px;
    }

    .portal-panel {
        padding: 20px;
    }

    .otp-panel {
        padding: 20px;
    }

    .due-total-summary {
        padding: 16px;
    }

    .due-total-summary strong {
        font-size: 1.75rem;
    }

    .site-footer__inner {
        min-height: auto;
        flex-direction: column;
        align-items: flex-start;
        padding-top: 18px;
        padding-bottom: 18px;
    }
}

@media (max-width: 420px) {
    .access-steps {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .access-steps span {
        justify-content: flex-start;
        text-align: left;
    }

    .panel-header {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .logout-button {
        width: 100%;
    }

    .header-actions .logout-button {
        width: auto;
    }

    .otp-inputs {
        gap: 6px;
    }

    .otp-digit {
        min-height: 48px;
        font-size: 1.2rem;
    }

    .resend-note {
        align-items: stretch;
        flex-direction: column;
        text-align: center;
    }

    .unit-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .due-row,
    .line-item-row,
    .payment-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .due-row strong,
    .line-item-row strong,
    .copy-value {
        width: 100%;
        justify-content: space-between;
        text-align: left;
    }

    .copy-value {
        align-items: flex-start;
        flex-direction: column;
    }

    .copy-button {
        width: 100%;
    }
}
