@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@400;500;600;700&display=swap');

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

body {
    font-family: 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    padding-top: 40px;
}

#root {
    width: 100%;
    max-width: 440px;
}

.pay-container {
    width: 100%;
}

.pay-card {
    background: #ffffff;
    padding: 24px;
}

.pay-header {
    text-align: center;
    margin-bottom: 8px;
}

.logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 12px;
}

.onramp-title {
    font-size: 24px;
    font-weight: 700;
    color: #000;
    margin-bottom: 4px;
}

.pay-header p {
    color: #888;
    font-size: 13px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #333;
    font-size: 13px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e5e5;
    border-radius: 10px;
    font-size: 16px;
    color: #000;
    background: #fff;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #ed4c4c;
}

.form-group input:disabled {
    background: #fafafa;
    color: #999;
}

/* Crypto Selector */
.crypto-selector {
    margin-bottom: 20px;
}

.crypto-selector label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-size: 13px;
    font-weight: 500;
}

.crypto-options {
    display: flex;
    gap: 8px;
}

.crypto-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border: 2px solid #e5e5e5;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.crypto-option:hover {
    border-color: #ccc;
}

.crypto-option.selected {
    border-color: #ed4c4c;
    background: #fef2f2;
}

.crypto-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.crypto-label {
    font-size: 12px;
    font-weight: 500;
    color: #333;
}

.crypto-option.selected .crypto-label {
    color: #ed4c4c;
}

/* Amount Display */
.amount-display-container {
    width: 100%;
    margin-bottom: 24px;
}

.amount-display {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    background: #ffffff;
    border: none;
    cursor: text;
    transition: all 0.2s ease;
    min-height: 120px;
}

.amount-display:hover:not(.disabled) {
    opacity: 0.95;
}

.amount-display.focused {
    opacity: 1;
}

.amount-display.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.currency-symbol {
    font-size: 64px;
    font-weight: 700;
    color: #ccc;
    margin-right: 2px;
    transition: color 0.2s ease;
}

.currency-symbol.active {
    color: #000;
}

.amount-digits {
    font-size: 64px;
    font-weight: 700;
    color: #ccc;
    letter-spacing: -2px;
    font-variant-numeric: tabular-nums;
    transition: color 0.2s ease;
}

.amount-digits.active {
    color: #000;
}

.cursor-blink {
    font-size: 64px;
    font-weight: 300;
    color: #ed4c4c;
    animation: blink 1s step-end infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.amount-hidden-input {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.amount-error {
    color: #dc2626;
    font-size: 13px;
    margin-top: 8px;
    text-align: center;
    padding: 8px 12px;
    background: #fef2f2;
    border-radius: 8px;
}

.amount-group {
    position: relative;
}

.amount-hint {
    text-align: center;
    color: #999;
    font-size: 13px;
    margin-top: 4px;
}

/* Divider */
.form-divider {
    height: 1px;
    background: #eee;
    margin: 24px 0;
}

/* Amount Box */
.amount-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #fafafa;
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid #eee;
}

.amount-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.amount-value {
    font-size: 28px;
    font-weight: 700;
    color: #ed4c4c;
}

.crypto-destination {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

/* Onramp Container */
.onramp-container {
    min-height: 400px;
}

#onramp-element {
    min-height: 350px;
    margin-bottom: 16px;
}

/* Buttons */
.pay-button {
    width: 100%;
    padding: 16px;
    background: #ed4c4c;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.pay-button:hover:not(:disabled) {
    background: #d93c3c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(237, 76, 76, 0.3);
}

.pay-button:active:not(:disabled) {
    transform: translateY(0);
}

.pay-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pay-button.secondary {
    background: #f5f5f5;
    color: #333;
    margin-top: 12px;
}

.pay-button.secondary:hover:not(:disabled) {
    background: #e8e8e8;
    box-shadow: none;
}

.back-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: none;
    border: none;
    color: #666;
    font-size: 14px;
    padding: 12px;
    cursor: pointer;
    margin-top: 4px;
}

.back-btn:hover {
    color: #ed4c4c;
}

.secure-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: #059669;
    margin-top: 16px;
}

/* Results */
.result {
    text-align: center;
    padding: 20px 0;
}

.result-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin: 0 auto 20px;
}

.result-icon.success {
    background: #d1fae5;
    color: #059669;
}

.result-icon.error {
    background: #fee2e2;
    color: #dc2626;
}

.result h2 {
    font-size: 22px;
    color: #000;
    margin-bottom: 8px;
}

.result p {
    color: #666;
    font-size: 14px;
    margin-bottom: 24px;
}

.result-details {
    background: #fafafa;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: left;
    border: 1px solid #eee;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid #eee;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row span {
    color: #666;
}

.detail-row strong {
    color: #000;
}

.status-success {
    color: #059669 !important;
}

/* Footer */
.pay-footer {
    text-align: center;
    margin-top: 32px;
    color: #bbb;
    font-size: 12px;
}

/* Mobile responsive */
@media (max-width: 480px) {
    body {
        padding: 16px;
        padding-top: 24px;
    }
    
    .pay-card {
        padding: 16px;
    }
    
    .logo {
        max-width: 160px;
    }
    
    .amount-display {
        padding: 24px 12px;
        min-height: 100px;
    }
    
    .currency-symbol {
        font-size: 52px;
    }
    
    .amount-digits {
        font-size: 52px;
    }
    
    .cursor-blink {
        font-size: 52px;
    }
    
    .amount-value {
        font-size: 24px;
    }
    
    .crypto-option {
        padding: 10px 6px;
    }
    
    .crypto-icon {
        font-size: 20px;
    }
    
    .crypto-label {
        font-size: 11px;
    }
}
