/* =========================================================
   ExactSub Electricity
   Modern fintech electricity payment interface
   ========================================================= */

.electricity-page {
    --es-primary: #022A7B;
    --es-primary-dark: #011e59;
    --es-green: #29BA22;
    --es-danger: #dc3545;
    --es-text: #172033;
    --es-muted: #70798b;
    --es-border: #e4e8ef;
    --es-bg: #f5f7fb;
    --es-white: #ffffff;

    min-height: calc(100vh - 80px);
    background: var(--es-bg);
    padding: 28px 16px 80px;
    box-sizing: border-box;
    color: var(--es-text);
}

.electricity-shell {
    width: min(100%, 620px);
    margin: 0 auto;
}

.electricity-header {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    margin-bottom: 16px;
}

.electricity-header-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: var(--es-primary);
    color: #fff;
    font-size: 19px;
    box-shadow: 0 8px 20px rgba(2, 42, 123, .18);
}

.electricity-header-copy {
    min-width: 0;
}

.electricity-header h1 {
    margin: 0;
    color: var(--es-text);
    font-size: 23px;
    line-height: 1.2;
    font-weight: 800;
}

.electricity-header p {
    margin: 4px 0 0;
    color: var(--es-muted);
    font-size: 12px;
    line-height: 1.4;
}

.electricity-balance {
    min-width: 108px;
    padding: 9px 11px;
    border: 1px solid #e3e8f1;
    border-radius: 12px;
    background: #fff;
    text-align: right;
}

.electricity-balance span {
    display: block;
    margin-bottom: 3px;
    color: var(--es-muted);
    font-size: 9px;
    font-weight: 700;
}

.electricity-balance strong {
    display: block;
    color: var(--es-primary);
    font-size: 13px;
    font-weight: 800;
}

.electricity-card {
    background: var(--es-white);
    border: 1px solid #edf0f5;
    border-radius: 20px;
    padding: 22px;
    box-shadow: 0 12px 40px rgba(21, 35, 58, .07);
}

.electricity-field {
    margin-bottom: 18px;
}

.electricity-field label {
    display: block;
    margin-bottom: 7px;
    color: var(--es-text);
    font-size: 13px;
    line-height: 1.4;
    font-weight: 700;
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.field-status {
    min-height: 17px;
    font-size: 11px;
    font-weight: 800;
}

.field-control {
    position: relative;
    width: 100%;
    min-height: 51px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    border: 1px solid var(--es-border);
    border-radius: 13px;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.field-control:focus-within {
    border-color: var(--es-primary);
    box-shadow: 0 0 0 3px rgba(2, 42, 123, .08);
}

.field-control > .field-leading-icon {
    flex: 0 0 auto;
    margin-left: 15px;
    color: #8a93a4;
    font-size: 14px;
}

.field-control input,
.field-control select {
    width: 100%;
    height: 49px;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--es-text);
    font: inherit;
    font-size: 14px;
    box-sizing: border-box;
}

.field-control input {
    padding: 0 14px 0 11px;
}

.field-control select {
    appearance: none;
    cursor: pointer;
    padding: 0 40px 0 11px;
}

.field-control input::placeholder {
    color: #a2a9b6;
}

.select-arrow {
    position: absolute;
    right: 15px;
    margin: 0 !important;
    color: #7e8797 !important;
    pointer-events: none;
    font-size: 12px;
}

.field-hint,
.field-error {
    display: block;
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.45;
}

.field-hint {
    color: var(--es-muted);
}

.field-error {
    color: var(--es-danger);
    min-height: 0;
}

.input-loader {
    display: none;
    width: 16px;
    height: 16px;
    margin-right: 14px;
    border: 2px solid #dbe2ed;
    border-top-color: var(--es-primary);
    border-radius: 50%;
    animation: electricitySpin .7s linear infinite;
    flex: 0 0 16px;
}

.input-success {
    display: none;
    margin-right: 14px;
    color: var(--es-green);
    font-size: 17px;
}

.verification-message {
    display: none;
    margin-top: 9px;
    padding: 9px 11px;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1.4;
}

.verification-message.success {
    display: block;
    color: #197a18;
    background: #effbef;
    border: 1px solid #d7f1d5;
}

.verification-message.error {
    display: block;
    color: #b4232f;
    background: #fff2f3;
    border: 1px solid #f6d5d9;
}

.verification-message.loading {
    display: block;
    color: var(--es-primary);
    background: #f1f5fc;
    border: 1px solid #dfe8f7;
}

.customer-card {
    display: none;
    align-items: center;
    gap: 11px;
    margin: -2px 0 18px;
    padding: 12px;
    border: 1px solid #dcefdc;
    border-radius: 13px;
    background: #f5fcf5;
}

.customer-card.visible {
    display: flex;
}

.customer-card-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #e1f5df;
    color: var(--es-green);
    font-size: 14px;
}

.customer-card-content {
    min-width: 0;
    flex: 1;
}

.customer-card-content span {
    display: block;
    margin-bottom: 2px;
    color: var(--es-green);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.customer-card-content strong {
    display: block;
    color: var(--es-text);
    font-size: 13px;
    line-height: 1.35;
    word-break: break-word;
}

.customer-card-content small {
    display: block;
    margin-top: 2px;
    color: var(--es-muted);
    font-size: 10px;
}

.customer-check {
    color: var(--es-green);
    font-size: 17px;
}

.amount-field {
    display: none;
}

.amount-field.visible {
    display: block;
}

.quick-amount-section {
    margin: 0 0 13px;
}

.quick-amount-label {
    display: block;
    margin-bottom: 7px;
    color: var(--es-text);
    font-size: 12px;
    font-weight: 800;
}

.quick-amounts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
}

.amount-payment-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 8px;
    align-items: stretch;
}

.amount-control {
    min-width: 0;
    padding-left: 14px;
}

.currency-symbol {
    color: var(--es-text);
    font-size: 17px;
    font-weight: 800;
}

.amount-control input {
    font-size: 18px;
    font-weight: 700;
}

.quick-amount-button {
    min-width: 0;
    min-height: 39px;
    padding: 7px 5px;
    border: 1px solid #dfe5ee;
    border-radius: 10px;
    background: #f8fafc;
    color: var(--es-text);
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .12s ease, box-shadow .16s ease;
}

.quick-amount-button:hover {
    border-color: var(--es-primary);
    color: var(--es-primary);
    background: #f3f6fc;
}

.quick-amount-button:active {
    transform: scale(.98);
}

.quick-amount-button.selected {
    border-color: var(--es-primary);
    background: var(--es-primary);
    color: #fff;
    box-shadow: 0 5px 13px rgba(2, 42, 123, .16);
}

.quick-amount-button:disabled {
    opacity: .55;
    cursor: not-allowed;
    transform: none;
}

.pay-button {
    width: 100%;
    min-height: 51px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    margin: 0;
    border: 0;
    border-radius: 13px;
    background: var(--es-primary);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .2s ease, opacity .2s ease;
}

.pay-button:not(:disabled):hover {
    box-shadow: 0 9px 22px rgba(2, 42, 123, .2);
    transform: translateY(-1px);
}

.pay-button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

.secure-note {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 11px;
    color: #8992a2;
    font-size: 10px;
}

/* =========================================================
   Confirmation modal
   ========================================================= */

.electricity-modal-backdrop,
.pin-modal-backdrop,
.electricity-loading {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

.electricity-modal-backdrop,
.pin-modal-backdrop {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(8, 18, 36, .58);
    backdrop-filter: blur(4px);
}

.electricity-modal-backdrop.visible,
.pin-modal-backdrop.visible {
    display: flex;
}

.electricity-confirm-modal,
.pin-modal {
    position: relative;
    width: min(100%, 420px);
    max-height: min(90vh, 700px);
    overflow-y: auto;
    box-sizing: border-box;
    padding: 24px 21px 20px;
    border-radius: 21px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .22);
    animation: modalIn .18s ease-out;
}

.modal-close,
.pin-close {
    position: absolute;
    top: 11px;
    right: 11px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #f4f6f9;
    color: #6d7584;
    cursor: pointer;
}

.confirm-icon,
.pin-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
    border-radius: 14px;
    background: #edf2fb;
    color: var(--es-primary);
    font-size: 18px;
}

.electricity-confirm-modal h2,
.pin-modal h2 {
    margin: 0;
    color: var(--es-text);
    text-align: center;
    font-size: 19px;
    line-height: 1.25;
    font-weight: 800;
}

.confirm-subtitle,
.pin-modal p {
    margin: 7px auto 15px;
    max-width: 320px;
    color: var(--es-muted);
    text-align: center;
    font-size: 11px;
    line-height: 1.5;
}

.confirm-customer {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 11px;
    border: 1px solid #e7ecf3;
    border-radius: 12px;
    background: #f8fafc;
}

.confirm-customer-icon {
    width: 35px;
    height: 35px;
    flex: 0 0 35px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #e9eef8;
    color: var(--es-primary);
}

.confirm-customer span {
    display: block;
    color: var(--es-muted);
    font-size: 9px;
    font-weight: 700;
}

.confirm-customer strong {
    display: block;
    margin-top: 2px;
    color: var(--es-text);
    font-size: 12px;
    word-break: break-word;
}

.confirm-rows {
    border: 1px solid #e7ebf1;
    border-radius: 12px;
    overflow: hidden;
}

.confirm-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 10px 11px;
    background: #fff;
    font-size: 11px;
}

.confirm-row + .confirm-row {
    border-top: 1px solid #edf0f4;
}

.confirm-row span {
    color: var(--es-muted);
}

.confirm-row strong {
    color: var(--es-text);
    font-size: 11px;
    font-weight: 800;
    text-align: right;
}

.confirm-row.confirm-total {
    background: #f7f9fd;
}

.confirm-row.confirm-total strong {
    color: var(--es-primary);
    font-size: 13px;
}

.confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 9px;
    margin-top: 14px;
}

.modal-secondary-button,
.modal-primary-button,
.confirm-payment-button {
    min-height: 48px;
    border-radius: 11px;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.modal-secondary-button {
    border: 1px solid #dfe4eb;
    background: #fff;
    color: #596273;
}

.modal-primary-button,
.confirm-payment-button {
    border: 0;
    background: var(--es-primary);
    color: #fff;
}

.modal-primary-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.modal-primary-button:disabled,
.confirm-payment-button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* =========================================================
   PIN modal
   ========================================================= */

.pin-modal {
    text-align: center;
}

.pin-modal p {
    margin-bottom: 18px;
}

.pin-input-wrap {
    display: flex;
    justify-content: center;
}

.pin-input-wrap input {
    width: 100%;
    height: 51px;
    border: 1px solid var(--es-border);
    border-radius: 12px;
    outline: 0;
    text-align: center;
    letter-spacing: 10px;
    font-size: 20px;
    font-weight: 800;
    color: var(--es-text);
    box-sizing: border-box;
}

.pin-input-wrap input:focus {
    border-color: var(--es-primary);
    box-shadow: 0 0 0 3px rgba(2, 42, 123, .08);
}

.pin-error {
    display: block;
    min-height: 17px;
    margin-top: 7px;
    color: var(--es-danger);
    font-size: 11px;
}

.confirm-payment-button {
    width: 100%;
    margin-top: 3px;
}

/* =========================================================
   Processing overlay
   ========================================================= */

.electricity-loading {
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(4px);
}

.electricity-loading.visible {
    display: flex;
}

.loading-card {
    width: min(100%, 300px);
    box-sizing: border-box;
    padding: 25px 20px;
    border: 1px solid #e7ebf2;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(15, 31, 55, .14);
    text-align: center;
}

.loading-spinner {
    width: 34px;
    height: 34px;
    margin: 0 auto 13px;
    border: 3px solid #dce4f1;
    border-top-color: var(--es-primary);
    border-radius: 50%;
    animation: electricitySpin .7s linear infinite;
}

.loading-card strong {
    display: block;
    color: var(--es-text);
    font-size: 13px;
}

.loading-card p {
    margin: 6px 0 0;
    color: var(--es-muted);
    font-size: 10px;
    line-height: 1.5;
}

@keyframes electricitySpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 576px) {
    .electricity-page {
        min-height: calc(100vh - 60px);
        padding: 17px 12px 70px;
    }

    .electricity-header {
        grid-template-columns: 43px minmax(0, 1fr);
        gap: 10px;
        margin-bottom: 12px;
    }

    .electricity-header-icon {
        width: 43px;
        height: 43px;
        border-radius: 12px;
        font-size: 17px;
    }

    .electricity-header h1 {
        font-size: 19px;
    }

    .electricity-header p {
        font-size: 10px;
    }

    .electricity-balance {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: space-between;
        box-sizing: border-box;
        padding: 8px 10px;
        text-align: left;
    }

    .electricity-balance span {
        margin: 0;
        font-size: 9px;
    }

    .electricity-balance strong {
        font-size: 12px;
    }

    .electricity-card {
        padding: 17px 14px;
        border-radius: 17px;
    }

    .electricity-field {
        margin-bottom: 15px;
    }

    .quick-amount-section {
        margin-bottom: 12px;
    }

    .quick-amount-label {
        margin-bottom: 6px;
        font-size: 11px;
    }

    .quick-amounts {
        gap: 6px;
        margin-top: 0;
    }

    .amount-payment-row {
        grid-template-columns: minmax(0, 1fr) 82px;
        gap: 7px;
    }

    .quick-amount-button {
        min-height: 37px;
        padding: 6px 4px;
        border-radius: 9px;
        font-size: 10px;
    }

    .pay-button {
        min-height: 42px;
        border-radius: 11px;
        font-size: 12px;
    }

    .electricity-confirm-modal,
    .pin-modal {
        width: 100%;
        padding: 22px 15px 16px;
        border-radius: 18px;
    }

    .confirm-row {
        padding: 9px 10px;
        font-size: 10px;
    }

    .confirm-row strong {
        max-width: 58%;
        font-size: 10px;
    }

    .confirm-actions {
        grid-template-columns: 1fr 1.35fr;
    }
}


body.electricity-modal-open {
    overflow: hidden;
}



/* =========================================================
   EXACTSUB ELECTRICITY — TRANSACTION RESPONSE MODAL
========================================================= */

.transaction-response-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.transaction-response-modal.is-visible {
    display: flex;
    visibility: visible;
    opacity: 1;
}

.transaction-response-modal__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(7, 18, 43, 0.68);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.transaction-response-modal__dialog {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 430px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 32px 26px 26px;
    border: 1px solid rgba(2, 42, 123, 0.08);
    border-radius: 22px;
    background: #ffffff;
    color: #172033;
    text-align: center;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
    animation: electricity-response-enter 0.22s ease-out;
}

.transaction-response-modal__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 62px;
    height: 62px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #fff3df;
    color: #b96a00;
    font-size: 34px;
    font-weight: 800;
    line-height: 1;
}

#transaction-response-title {
    margin: 0 0 12px;
    color: #022A7B;
    font-size: 23px;
    font-weight: 750;
    line-height: 1.35;
    letter-spacing: -0.4px;
}

#transaction-response-message {
    margin: 0;
    color: #566176;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.75;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

.transaction-response-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 11px;
    margin-top: 26px;
}

.transaction-response-modal__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.transaction-response-modal__button:hover {
    transform: translateY(-1px);
}

.transaction-response-modal__button:focus-visible {
    outline: 3px solid rgba(41, 186, 34, 0.4);
    outline-offset: 3px;
}

.transaction-response-modal__button--primary {
    background: #022A7B;
    color: #ffffff;
}

.transaction-response-modal__button--primary:hover {
    background: #031f5b;
    color: #ffffff;
}

.transaction-response-modal__button--secondary {
    border-color: #dce4f1;
    background: #f5f8fd;
    color: #022A7B;
}

.transaction-response-modal__button--secondary:hover {
    background: #eaf0fa;
}

.transaction-response-modal__button--close {
    border-color: #e5e7eb;
    background: #ffffff;
    color: #596273;
}

.transaction-response-modal__button--close:hover {
    background: #f7f8fa;
}

.transaction-response-modal [hidden] {
    display: none !important;
}

body.transaction-response-modal-open {
    overflow: hidden;
}

@keyframes electricity-response-enter {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 480px) {
    .transaction-response-modal {
        padding: 14px;
    }

    .transaction-response-modal__dialog {
        max-width: 100%;
        padding: 28px 20px 22px;
        border-radius: 18px;
    }

    .transaction-response-modal__icon {
        width: 56px;
        height: 56px;
        font-size: 30px;
    }

    #transaction-response-title {
        font-size: 21px;
    }

    #transaction-response-message {
        font-size: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .transaction-response-modal,
    .transaction-response-modal__button {
        transition: none;
    }

    .transaction-response-modal__dialog {
        animation: none;
    }
}

