:root {
    --bg: #090d16;
    --card-bg: rgba(17, 24, 39, 0.94);
    --border: rgba(255, 255, 255, 0.08);
    --primary: #10b981;
    --primary-glow: rgba(16, 185, 129, 0.3);
    --amber: #f59e0b;
    --red: #ef4444;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --font: 'Cairo', system-ui, sans-serif;
    --font-en: 'Outfit', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 14px;
    position: relative;
    overflow-x: hidden;
}

.glow-bg {
    position: fixed;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(150px);
    background: radial-gradient(circle, rgba(16, 185, 129, 0.16) 0%, rgba(240, 185, 11, 0.12) 60%, transparent 80%);
    z-index: 0;
    pointer-events: none;
}

.pay-container {
    width: 100%;
    max-width: 490px;
    position: relative;
    z-index: 1;
}

.pay-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 26px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(20px);
}

/* Card Header */
.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.crypto-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #26a17b 0%, #10b981 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    font-weight: 900;
    color: #fff;
    box-shadow: 0 6px 18px var(--primary-glow);
}

.brand-row h2 {
    font-size: 1.25rem;
    font-weight: 800;
    line-height: 1.2;
}

.badge-direct {
    font-size: 0.72rem;
    color: #f0b90b;
    background: rgba(240, 185, 11, 0.12);
    border: 1px solid rgba(240, 185, 11, 0.3);
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 3px;
    font-weight: 700;
}

/* Timer Box */
.timer-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    padding: 6px 12px;
    border-radius: 10px;
    color: #fbbf24;
    font-family: var(--font-en);
    font-size: 0.95rem;
    font-weight: 800;
}

.timer-box.timer-urgent {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.5);
    color: #f87171;
    animation: urgentPulse 1s infinite alternate;
}

@keyframes urgentPulse {
    from { opacity: 0.85; }
    to { opacity: 1; transform: scale(1.03); }
}

.timer-icon {
    width: 16px;
    height: 16px;
}

/* Dropdown Section */
.dropdown-section {
    margin-bottom: 18px;
}

.dropdown-section label {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.select-wrapper {
    position: relative;
    width: 100%;
}

.select-wrapper select {
    width: 100%;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    padding-left: 36px;
    font-family: var(--font);
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text);
    outline: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.select-wrapper select:focus {
    border-color: var(--primary);
}

.select-wrapper select option {
    background: #0f172a;
    color: #fff;
    padding: 8px;
}

.dropdown-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

/* Amount Breakdown */
.amount-box {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 22px;
}

.amount-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 0.88rem;
}

.amount-title {
    color: var(--text-muted);
}

.amount-val {
    font-family: var(--font-en);
    font-weight: 700;
    color: var(--text);
}

.fee-row {
    color: #fbbf24;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    margin-bottom: 8px;
}

.fee-row .amount-title, .fee-row .amount-val {
    color: #fbbf24;
}

.total-row {
    padding-top: 4px;
}

.total-row .amount-title {
    font-weight: 800;
    color: var(--text);
    font-size: 0.95rem;
}

.total-val {
    font-family: var(--font-en);
    font-size: 1.35rem;
    font-weight: 900;
    color: #34d399;
}

.fee-note {
    font-size: 0.74rem;
    color: #fbbf24;
    line-height: 1.45;
    margin-top: 10px;
    background: rgba(245, 158, 11, 0.08);
    border-radius: 8px;
    padding: 8px 10px;
}

/* QR Code Section */
.qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.qr-frame-wrapper {
    position: relative;
    width: 175px;
    height: 175px;
}

.qr-frame {
    background: #ffffff;
    padding: 12px;
    border-radius: 20px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transition: filter 0.3s;
}

.qr-frame canvas, .qr-frame img {
    max-width: 100% !important;
    max-height: 100% !important;
}

.expired-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.92);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #f87171;
    font-size: 0.82rem;
    font-weight: 800;
    border: 2px dashed rgba(239, 68, 68, 0.6);
}

.expired-overlay svg {
    width: 32px;
    height: 32px;
}

.qr-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Address Box */
.address-section {
    margin-bottom: 20px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.address-section label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
}

.active-network-tag {
    font-size: 0.7rem;
    font-family: var(--font-en);
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 1px 7px;
    border-radius: 6px;
    font-weight: 700;
}

.copy-box {
    display: flex;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.copy-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    padding: 12px 14px;
    font-family: var(--font-en);
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 600;
}

.btn-copy {
    background: rgba(30, 41, 59, 0.8);
    border: none;
    color: var(--text);
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 0 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.btn-copy:hover {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.btn-copy svg {
    width: 15px;
    height: 15px;
}

/* Status Alert */
.status-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 18px;
    font-size: 0.82rem;
    animation: fadeIn 0.3s ease;
}

.status-alert.loading {
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: #38bdf8;
}

.status-alert.failed {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.status-alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.alert-content h4 {
    font-size: 0.88rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.alert-content p {
    font-size: 0.77rem;
    line-height: 1.4;
    color: inherit;
    opacity: 0.9;
}

/* Action Buttons */
.action-section {
    margin-top: 10px;
}

.btn-confirm {
    width: 100%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    color: #fff;
    font-family: var(--font);
    font-size: 1.05rem;
    font-weight: 800;
    padding: 15px;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 24px var(--primary-glow);
    transition: all 0.2s ease;
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(16, 185, 129, 0.45);
}

.btn-confirm.btn-loading {
    background: #334155;
    box-shadow: none;
    cursor: wait;
}

.btn-new-session {
    width: 100%;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    color: #0b0e11;
    font-family: var(--font);
    font-size: 1.02rem;
    font-weight: 800;
    padding: 15px;
    border-radius: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35);
    transition: all 0.2s ease;
}

.btn-new-session:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(245, 158, 11, 0.5);
}

.btn-new-session svg {
    width: 18px;
    height: 18px;
}

/* Success View */
.success-card {
    text-align: center;
    padding: 36px 24px;
}

.success-icon-wrap {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #fff;
    box-shadow: 0 0 30px var(--primary-glow);
}

.success-icon-wrap svg {
    width: 38px;
    height: 38px;
    stroke-width: 3;
}

.success-card h2 {
    font-size: 1.4rem;
    font-weight: 900;
    color: #34d399;
    margin-bottom: 6px;
}

.success-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 22px;
}

.receipt {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 22px;
    font-family: var(--font-en);
    font-size: 0.86rem;
    text-align: left;
}

.receipt-line {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.receipt-line:last-child {
    border-bottom: none;
}

.receipt-line span {
    color: var(--text-muted);
}

.receipt-line strong {
    color: var(--text);
}

.tx-link {
    color: #38bdf8;
    text-decoration: underline;
    font-size: 0.8rem;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.verified-tag {
    color: #34d399;
    font-weight: 700;
}

.btn-new-order {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 24px;
    border-radius: 12px;
    font-family: var(--font);
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-new-order:hover {
    background: rgba(30, 41, 59, 1);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #10b981;
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
    z-index: 100;
}

.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}
