.withdraw-page {
    min-height: 100vh;
    min-height: 100dvh;
    font-family: var(--font-family);
    color: rgba(244, 244, 245, 0.92);
    background: var(--hz-bg-page);
}

.wfx-stage {
    position: relative;
    max-width: 480px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    isolation: isolate;
    padding: max(var(--space-sm), env(safe-area-inset-top)) var(--space-md) 0;
}

.wfx-atmosphere {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 90% 55% at 0% 0%, rgba(196, 30, 58, 0.18) 0%, transparent 52%),
        radial-gradient(ellipse 80% 50% at 100% 8%, rgba(30, 64, 175, 0.16) 0%, transparent 48%),
        #0a0a0a;
}

.wfx-top {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0 var(--space-md);
}

.wfx-back {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(244, 244, 245, 0.18);
    border-radius: 6px;
    background: rgba(15, 17, 24, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.wfx-back:hover {
    border-color: rgba(196, 30, 58, 0.5);
    box-shadow: 0 0 0 1px rgba(30, 64, 175, 0.28);
}

.wfx-back svg {
    width: 22px;
    height: 22px;
    color: #f4f4f5;
}

.wfx-top-copy {
    min-width: 0;
    text-align: center;
}

.wfx-eyebrow {
    margin: 0 0 2px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.32em;
    text-transform: uppercase;
    color: rgba(244, 244, 245, 0.45);
}

.wfx-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.45rem, 5vw, 1.75rem);
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #f4f4f5;
    line-height: 1.05;
}

.wfx-top-slot {
    width: 44px;
    height: 44px;
}

.wfx-wallet {
    position: relative;
    z-index: 2;
    padding: 0 0 var(--space-lg);
}

.wfx-wallet-frame {
    position: relative;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 24px) 100%, 0 100%);
}

.wfx-wallet-stripe {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background: var(--hz-gradient-primary);
    border-radius: 2px 0 0 2px;
    box-shadow: 0 0 22px var(--hz-accent-glow);
    z-index: 2;
}

.wfx-wallet-body {
    position: relative;
    margin-left: 6px;
    padding: 20px 20px 22px;
    background: linear-gradient(128deg, #ffffff 0%, #f4f4f5 42%, #e8ecf4 100%);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-left: none;
    border-radius: 0 4px 4px 0;
    box-shadow:
        14px 24px 44px rgba(0, 0, 0, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.wfx-wallet-label {
    margin: 0 0 var(--space-sm);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: rgba(15, 23, 42, 0.5);
}

.wfx-wallet-sum {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 11vw, 3.5rem);
    font-weight: 400;
    line-height: 0.95;
    letter-spacing: 0.02em;
    color: #0f172a;
}

.wfx-wallet-notch {
    position: absolute;
    bottom: -7px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #0a0a0a;
    box-shadow: inset 0 0 0 1px rgba(244, 244, 245, 0.06);
    z-index: 3;
}

.wfx-wallet-notch--left {
    left: 28px;
}

.wfx-wallet-notch--right {
    right: 28px;
}

.wfx-scroll {
    position: relative;
    z-index: 1;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 calc(-1 * var(--space-md));
    padding: 0 var(--space-md);
    padding-bottom: max(var(--space-xl), env(safe-area-inset-bottom));
}

.wfx-main {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    padding: var(--space-md) 0 var(--space-2xl);
}

.wfx-amounts {
    padding: var(--space-md) var(--space-lg);
    background: rgba(244, 244, 245, 0.96);
    border: 1px solid rgba(10, 10, 10, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.38);
    color: #0a0a0a;
}

.wfx-section-title {
    margin: 0 0 4px;
    font-size: var(--text-base);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--hz-text-primary);
}

.wfx-section-desc {
    margin: 0 0 var(--space-sm);
    font-size: 11px;
    line-height: 1.4;
    color: var(--text-muted);
}

.wfx-field-row {
    display: flex;
    align-items: center;
    border-radius: 8px;
    border: 1px solid rgba(10, 10, 10, 0.12);
    background: #ffffff;
    padding: 0 12px;
    transition: border-color 0.15s ease;
}

.wfx-field-row:focus-within {
    border-color: rgba(196, 30, 58, 0.45);
}

.wfx-dollar {
    font-family: var(--font-mono);
    font-size: var(--text-lg);
    font-weight: 700;
    color: rgba(15, 23, 42, 0.4);
    padding-right: 4px;
}

.wfx-amount {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-family: var(--font-mono);
    font-size: var(--text-lg);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--hz-text-primary);
    letter-spacing: -0.02em;
}

.wfx-amount:focus {
    outline: none;
}

.wfx-amount::placeholder {
    color: rgba(15, 23, 42, 0.28);
    font-weight: 500;
}

.wfx-amount.error {
    color: var(--danger);
}

.wfx-field-row:has(.wfx-amount.error) {
    border-color: var(--danger);
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.15);
}

.wfx-field-row:has(.wfx-amount.error) .wfx-dollar {
    color: var(--danger);
}

.wfx-err {
    min-height: 16px;
    margin: 4px 0 0;
    font-size: 11px;
    font-weight: 600;
    color: var(--danger);
}

.wfx-fee {
    display: none;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f4f4f5;
    border: 1px solid rgba(10, 10, 10, 0.08);
    flex-direction: column;
    gap: 6px;
}

.wfx-fee.is-visible {
    display: flex;
}

.wfx-fee-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    font-weight: 600;
}

.wfx-fee-row span {
    color: var(--text-muted);
}

.wfx-fee-row strong {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
    color: #c41e3a;
}

.wfx-fee-row--net strong {
    color: #0f172a;
}

.wfx-amount-action {
    margin-top: var(--space-md);
}

.wfx-submit-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 12px var(--space-lg);
    border: 2px solid rgba(244, 244, 245, 0.12);
    border-radius: 10px;
    background: linear-gradient(135deg, #c41e3a 0%, #1e40af 100%);
    color: var(--text-inverse);
    font-size: var(--text-base);
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(196, 30, 58, 0.34);
    font-family: inherit;
    transition: var(--transition);
}

.wfx-submit-btn:hover {
    box-shadow: 0 12px 32px rgba(196, 30, 58, 0.42);
}

.wfx-submit-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.wfx-submit-btn-icon svg {
    width: 20px;
    height: 20px;
}

.wfx-guide {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(244, 244, 245, 0.08);
    background: rgba(18, 20, 26, 0.72);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.wfx-guide-banner {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(90deg, rgba(196, 30, 58, 0.16) 0%, rgba(30, 64, 175, 0.12) 100%);
    border-bottom: 1px solid rgba(244, 244, 245, 0.08);
}

.wfx-guide-banner-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(244, 244, 245, 0.06);
    border: 1px solid rgba(244, 244, 245, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wfx-guide-banner-icon svg {
    width: 18px;
    height: 18px;
    color: #f4f4f5;
}

.wfx-guide-banner-title {
    margin: 0;
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #f4f4f5;
}

.wfx-guide-steps {
    display: flex;
    flex-direction: column;
}

.wfx-step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid rgba(244, 244, 245, 0.06);
}

.wfx-step:first-child {
    border-top: none;
}

.wfx-step-num {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(196, 30, 58, 0.12);
    border: 1px solid rgba(196, 30, 58, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    color: #f87171;
}

.wfx-step-body {
    min-width: 0;
    padding-top: 2px;
}

.wfx-step-body h3 {
    margin: 0 0 var(--space-xs);
    font-size: var(--text-sm);
    font-weight: 700;
    color: rgba(244, 244, 245, 0.95);
}

.wfx-step-body p {
    margin: 0;
    font-size: 12px;
    line-height: 1.65;
    color: rgba(244, 244, 245, 0.55);
}

.toast {
    position: fixed;
    top: max(var(--space-lg), env(safe-area-inset-top));
    left: 50%;
    transform: translateX(-50%) translateY(-150%);
    background: #ffffff;
    color: var(--text-primary);
    padding: var(--space-md) var(--space-xl);
    border-radius: 999px;
    border: 1px solid rgba(17, 17, 17, 0.08);
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.14);
    z-index: var(--z-modal);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-slow) var(--ease-in-out);
    font-weight: var(--font-semibold);
    font-size: var(--text-sm);
    max-width: calc(100vw - var(--space-xl));
    text-align: center;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: var(--success);
    border-color: var(--success);
    color: var(--text-inverse);
}

.toast.error {
    background: var(--danger);
    border-color: var(--danger);
    color: var(--text-inverse);
}

.toast.warning {
    background: var(--warning);
    border-color: var(--warning);
    color: var(--text-inverse);
}

.toast.info {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--text-inverse);
}

.loading {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: calc(var(--z-modal) - 1);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal) var(--ease-in-out);
}

.loading.active {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 52px;
    height: 52px;
    border: 3px solid rgba(244, 244, 245, 0.08);
    border-top-color: var(--accent-primary);
    border-right-color: rgba(30, 64, 175, 0.5);
    border-radius: var(--radius-full);
    animation: wfx-spin 0.7s linear infinite;
}

@keyframes wfx-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (min-width: 600px) {
    .wfx-stage {
        padding-left: var(--space-xl);
        padding-right: var(--space-xl);
    }

    .wfx-scroll {
        margin-left: calc(-1 * var(--space-xl));
        margin-right: calc(-1 * var(--space-xl));
        padding-left: var(--space-xl);
        padding-right: var(--space-xl);
    }
}

@media (min-width: 900px) {
    .withdraw-page {
        background: radial-gradient(ellipse 70% 55% at 50% 0%, rgba(196, 30, 58, 0.14) 0%, #0a0a0a 62%);
    }

    .wfx-stage {
        padding-top: var(--space-xl);
    }
}

@media (max-width: 360px) {
    .wfx-wallet-sum {
        font-size: 2.35rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wfx-submit-btn,
    .wfx-field-row,
    .toast,
    .loading {
        transition-duration: 0.01ms;
    }

    .spinner {
        animation-duration: 0.01ms;
        animation-iteration-count: 1;
    }
}
