/* Wallet modal namespace keeps styles scoped to recharge/withdraw dialogs */
:root {
    --wallet-modal-primary: #8b5cf6;
    --wallet-modal-primary-dark: #7c3aed;
    --wallet-modal-primary-light: rgba(139, 92, 246, 0.12);
    --wallet-modal-success: #10b981;
    --wallet-modal-danger: #ef4444;
    --wallet-modal-warning: #f59e0b;
    --wallet-modal-text: #1f2937;
    --wallet-modal-text-secondary: #6b7280;
    --wallet-modal-surface: #ffffff;
    --wallet-modal-surface-alt: #f9fafb;
    --wallet-modal-border: #e5e7eb;
    --wallet-modal-radius: 18px;
    --wallet-modal-radius-sm: 12px;
    --wallet-modal-shadow: 0 20px 45px rgba(15, 23, 42, 0.16);
}

/* Base container adjustments */
.wallet-modal {
    width: min(560px, 95vw);
    max-height: 92vh;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.wallet-modal__body {
    background: var(--wallet-modal-surface);
    border-radius: var(--wallet-modal-radius);
    box-shadow: var(--wallet-modal-shadow);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.wallet-modal__summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 18px;
    padding: 26px 28px 20px;
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.18), rgba(139, 92, 246, 0.05));
}

.wallet-modal__summary-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wallet-modal__summary-label {
    font-size: 13px;
    color: var(--wallet-modal-text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.wallet-modal__summary-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--wallet-modal-primary);
}

.wallet-modal__form {
    padding: 0 28px 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.wallet-modal__section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    border: 1px solid var(--wallet-modal-border);
    border-radius: var(--wallet-modal-radius-sm);
    background: var(--wallet-modal-surface);
}

.wallet-modal__section--info {
    background: var(--wallet-modal-surface-alt);
}

.wallet-modal__section--summary {
    background: rgba(139, 92, 246, 0.08);
}

.wallet-modal__section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 10px;
}

.wallet-modal__section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--wallet-modal-text);
    margin: 0;
}

.wallet-modal__section-subtitle {
    font-size: 13px;
    color: var(--wallet-modal-text-secondary);
}

.wallet-modal__field-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wallet-modal__input {
    width: 100%;
    padding: 16px 18px;
    border: 2px solid var(--wallet-modal-border);
    border-radius: var(--wallet-modal-radius-sm);
    font-size: 15px;
    color: var(--wallet-modal-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.wallet-modal__input:focus {
    outline: none;
    border-color: var(--wallet-modal-primary);
    box-shadow: 0 0 0 4px var(--wallet-modal-primary-light);
    transform: translateY(-1px);
}

.wallet-modal__helper {
    font-size: 12px;
    color: var(--wallet-modal-text-secondary);
}

.wallet-modal__helper--warning {
    color: var(--wallet-modal-warning);
    font-weight: 500;
}

.wallet-modal__quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.wallet-modal__quick-option {
    padding: 14px;
    border: 2px solid var(--wallet-modal-border);
    border-radius: var(--wallet-modal-radius-sm);
    background: var(--wallet-modal-surface);
    font-size: 15px;
    font-weight: 600;
    color: var(--wallet-modal-text);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.wallet-modal__quick-option:hover {
    border-color: var(--wallet-modal-primary);
    background: var(--wallet-modal-primary-light);
    color: var(--wallet-modal-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(139, 92, 246, 0.18);
}

.wallet-modal__quick-option--active {
    border-color: var(--wallet-modal-primary-dark);
    background: linear-gradient(135deg, var(--wallet-modal-primary) 0%, var(--wallet-modal-primary-dark) 100%);
    color: #fff;
    box-shadow: 0 16px 32px rgba(139, 92, 246, 0.32);
    transform: translateY(-2px);
}

.wallet-modal__bullet-list {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: var(--wallet-modal-text-secondary);
    line-height: 1.6;
}

.wallet-modal__bullet-list--warning li::marker {
    color: var(--wallet-modal-warning);
}

.wallet-modal__address-box {
    padding: 16px;
    background: var(--wallet-modal-surface-alt);
    border-radius: var(--wallet-modal-radius-sm);
    border: 1px dashed var(--wallet-modal-primary-light);
    display: flex;
    align-items: center;
    gap: 12px;
}

.wallet-modal__address-text {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
    color: var(--wallet-modal-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wallet-modal__summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--wallet-modal-text);
}

.wallet-modal__summary-row strong {
    font-weight: 700;
}

.wallet-modal__actions {
    display: flex;
    gap: 14px;
    margin-top: 6px;
    justify-content: flex-end;
}

.wallet-modal__actions--spread {
    justify-content: space-between;
}

.wallet-modal__btn {
    min-width: 128px;
    padding: 12px 20px;
    border-radius: var(--wallet-modal-radius-sm);
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.wallet-modal__btn--compact {
    min-width: auto;
    padding: 10px 16px;
}

.wallet-modal__btn--ghost {
    background: var(--wallet-modal-surface-alt);
    color: var(--wallet-modal-text-secondary);
}

.wallet-modal__btn--primary {
    background: var(--wallet-modal-primary);
    color: #fff;
}

.wallet-modal__btn--danger {
    background: var(--wallet-modal-danger);
    color: #fff;
}

.wallet-modal__btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.14);
}
.wallet-modal__section--address-result {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(220px, 2fr);
    gap: 18px;
}

.wallet-modal__qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.wallet-modal__qr-image {
    width: 180px;
    height: 180px;
    border-radius: var(--wallet-modal-radius-sm);
    border: 1px solid var(--wallet-modal-border);
    padding: 12px;
    background: #fff;
}

.wallet-modal__qr-placeholder {
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--wallet-modal-radius-sm);
    border: 1px dashed var(--wallet-modal-border);
    color: var(--wallet-modal-text-secondary);
    font-size: 48px;
}

.wallet-modal__detail-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wallet-modal__address-box--editable {
    border-style: solid;
}

.wallet-modal__address-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--wallet-modal-border);
    border-radius: var(--wallet-modal-radius-sm);
    background: var(--wallet-modal-surface);
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
    color: var(--wallet-modal-text);
}

.wallet-modal__meta {
    margin: 0;
    display: grid;
    gap: 8px;
}

.wallet-modal__meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--wallet-modal-text-secondary);
}

.wallet-modal__meta-row dt {
    font-weight: 500;
}

.wallet-modal__meta-row dd {
    margin: 0;
    color: var(--wallet-modal-text);
    font-weight: 600;
}

.wallet-modal--deposit .wallet-modal__body {
    border-top: 6px solid var(--wallet-modal-primary);
}

.wallet-modal--withdraw .wallet-modal__body {
    border-top: 6px solid var(--wallet-modal-danger);
}

.wallet-modal--withdraw .wallet-modal__summary-value {
    color: var(--wallet-modal-danger);
}

/* Hide default modal footer only inside wallet modal */
/* ensure any default button container inside wallet modal stays hidden */
.wallet-modal .modal-buttons,
.wallet-modal .modal-buttons--hidden {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
}

@media (max-width: 520px) {
    .wallet-modal__summary {
        grid-template-columns: 1fr;
        padding: 20px 16px;
        gap: 14px;
    }

    .wallet-modal__form {
        padding: 0 16px 16px;
        gap: 14px;
    }

    .wallet-modal__section {
        padding: 14px;
    }

    .wallet-modal__actions {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .wallet-modal__btn {
        width: 100%;
        min-width: 0;
        padding: 12px;
        font-size: 15px;
    }

    .wallet-modal__quick-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .wallet-modal__section--address-result {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .wallet-modal__qr {
        flex-direction: row;
        justify-content: center;
        gap: 16px;
    }

    .wallet-modal__qr-image,
    .wallet-modal__qr-placeholder {
        width: 140px;
        height: 140px;
        padding: 10px;
    }
}

