/* Payment Gateway Styles - Mobile First */

:root {
    --color-bg: #0f0f1a;
    --color-surface: #1a1a2e;
    --color-surface-hover: #252542;
    --color-primary: #6366f1;
    --color-primary-hover: #818cf8;
    --color-text: #ffffff;
    --color-text-muted: #a1a1aa;
    --color-border: #3f3f5a;
    --color-success: #10b981;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    --radius: 12px;
    --radius-sm: 8px;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
}

.container {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
}

/* Payment Container */
.payment-container {
    width: 100%;
    max-width: 440px;
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1rem;
}

.sandbox-banner {
    background: var(--color-warning);
    color: #000;
    text-align: center;
    padding: 0.5rem;
    margin: -1.5rem -1.5rem 1.5rem;
    border-radius: var(--radius) var(--radius) 0 0;
    font-weight: 600;
    font-size: 0.875rem;
}

.payment-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.payment-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.payment-header .price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
}

/* Form Styles */
.payment-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text);
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem; /* Prevents iOS zoom */
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23a1a1aa' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

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

/* Wallet Buttons */
.wallet-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.wallet-button {
    min-height: 48px;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.divider span {
    padding: 0 1rem;
}

/* Solidgate Form Container */
.solidgate-form {
    min-height: 200px;
}

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--color-text-muted);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 1.5rem;
    color: var(--color-error);
}

/* Email Prompt */
.email-prompt {
    text-align: center;
    padding: 1.5rem;
}

.email-prompt p {
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

.email-prompt .btn {
    width: 100%;
}

/* Footer */
.payment-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.secure-badge {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.secure-badge::before {
    content: '🔒';
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    min-height: 48px;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--color-primary-hover);
}

.btn-secondary {
    background: var(--color-surface-hover);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: var(--color-border);
}

/* Result Pages */
.result-container {
    width: 100%;
    max-width: 440px;
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    margin-top: 2rem;
    text-align: center;
}

.result-icon {
    margin-bottom: 1.5rem;
}

.result-container h1 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.result-message {
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.order-id {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-family: monospace;
    margin-bottom: 1.5rem;
}

.result-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.help-text {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    max-width: 280px;
}

/* Redirect Page */
.redirect-container {
    width: 100%;
    max-width: 440px;
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 2rem 1.5rem;
    margin-top: 2rem;
    text-align: center;
}

.redirect-container h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.redirect-message {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.redirect-instructions {
    text-align: left;
    margin-bottom: 2rem;
}

.instruction-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--color-primary);
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.instruction-step p {
    padding-top: 0.25rem;
}

.redirect-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.redirect-note {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 1rem;
}

/* Tablet and up */
@media (min-width: 640px) {
    .container {
        padding: 2rem;
    }

    .payment-container,
    .result-container,
    .redirect-container {
        padding: 2rem;
        margin-top: 2rem;
    }

    .payment-header h1 {
        font-size: 1.75rem;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation: none;
    }

    .btn {
        transition: none;
    }
}

/* Dark mode is default, but support light mode preference if needed */
@media (prefers-color-scheme: light) {
    /* Keep dark theme - it's more common for payment pages */
}
