/* Payment Portal — Professional Stylesheet */
:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #DBEAFE;
    --secondary: #0F172A;
    --accent: #0EA5E9;
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --text: #1E293B;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 4px 24px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.1);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --container: 1280px;
}

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

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-inner {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-brand {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}
.nav-links {
    display: flex;
    gap: 8px;
}
.nav-links a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
    background: var(--primary-light);
    color: var(--primary);
}

/* Container */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 32px 24px;
}

/* Page Header */
.page-header {
    margin-bottom: 32px;
}
.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--secondary);
}
.page-header p {
    color: var(--text-muted);
    font-size: 16px;
    margin-top: 4px;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}
.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.card-header h2 {
    font-size: 20px;
    font-weight: 600;
}

/* Balance Card */
.balance-card {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius);
    padding: 32px;
    color: white;
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.balance-card.small {
    padding: 20px 24px;
}
.balance-label {
    font-size: 14px;
    opacity: 0.85;
    display: block;
}
.balance-value {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -1px;
}
.balance-card.small .balance-value {
    font-size: 28px;
}
.balance-actions {
    display: flex;
    gap: 12px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}
.stat-icon {
    font-size: 28px;
    margin-bottom: 8px;
    display: block;
}
.stat-value {
    font-size: 24px;
    font-weight: 700;
    display: block;
    color: var(--secondary);
}
.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    gap: 8px;
    font-family: var(--font);
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,99,235,0.25);
}
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-dark);
}
.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.3);
}
.btn-outline:hover {
    border-color: white;
    background: rgba(255,255,255,0.1);
}
.btn-full {
    width: 100%;
}
.btn-lg {
    padding: 14px 32px;
    font-size: 16px;
}
.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* Forms */
.form { max-width: 600px; }
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--text);
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: var(--font);
    transition: border-color 0.2s;
    background: var(--surface);
    color: var(--text);
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}
.form-group small {
    display: block;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Alerts */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 14px;
}
.alert-error {
    background: #FEF2F2;
    color: var(--error);
    border: 1px solid #FECACA;
}
.alert-success {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
}
.table {
    width: 100%;
    border-collapse: collapse;
}
.table th,
.table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.table tr:hover td {
    background: #F8FAFC;
}
.table code {
    background: #F1F5F9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
}
.badge-pending { background: #FEF3C7; color: #92400E; }
.badge-paid,
.badge-completed { background: #D1FAE5; color: #065F46; }
.badge-cancelled,
.badge-failed { background: #FEE2E2; color: #991B1B; }
.badge-processing { background: #DBEAFE; color: #1E40AF; }

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
}
.auth-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 440px;
}
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}
.auth-header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--secondary);
}
.auth-header p {
    color: var(--text-muted);
    margin-top: 4px;
}
.auth-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 4px;
}
.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    font-family: var(--font);
}
.tab-btn.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.auth-form { display: none; }
.auth-form.active { display: block; }

/* Invoice Page */
.invoice-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
}
.invoice-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    width: 100%;
    max-width: 520px;
}
.invoice-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.invoice-header h1 {
    font-size: 24px;
    font-weight: 700;
}
.ref-badge {
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.invoice-meta {
    margin-bottom: 24px;
}
.meta-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
.meta-row span:first-child {
    color: var(--text-muted);
}
.invoice-amount {
    text-align: center;
    padding: 24px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
}
.amount-label {
    display: block;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.amount-value {
    font-size: 40px;
    font-weight: 800;
    color: var(--secondary);
    letter-spacing: -1px;
}
.paid-badge {
    text-align: center;
    padding: 16px;
    background: #D1FAE5;
    border-radius: var(--radius-sm);
    color: #065F46;
    font-weight: 600;
}

/* Payment Options */
.payment-options h3 {
    margin-bottom: 16px;
    font-size: 16px;
}
.gateway-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}
.gateway-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}
.gateway-option:hover {
    border-color: var(--primary);
}
.gateway-option input[type="radio"]:checked + .gateway-info .gateway-name {
    color: var(--primary);
}
.gateway-option:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}
.gateway-info {
    display: flex;
    flex-direction: column;
}
.gateway-name {
    font-weight: 600;
    font-size: 14px;
}
.gateway-desc {
    font-size: 12px;
    color: var(--text-muted);
}

/* Invoice Result */
.invoice-result {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-bottom: 24px;
}
.invoice-result h3 {
    margin-bottom: 12px;
    color: var(--success);
}
.result-details p {
    margin-bottom: 8px;
    font-size: 14px;
}
.copy-link {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}
.copy-link input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--surface);
}
.hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}
.empty-state p {
    margin-bottom: 16px;
}

/* Success Icon */
.success-icon {
    font-size: 48px;
    text-align: center;
    margin-bottom: 16px;
}

/* Supported Countries */
.supported-countries p {
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-inner { padding: 0 16px; }
    .nav-links a { padding: 6px 10px; font-size: 13px; }
    .container { padding: 20px 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .balance-card { flex-direction: column; gap: 16px; text-align: center; }
    .balance-value { font-size: 28px; }
    .form-row { grid-template-columns: 1fr; }
    .auth-card { padding: 24px; }
    .invoice-card { padding: 24px; }
    .amount-value { font-size: 32px; }
    .page-header h1 { font-size: 24px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-value { font-size: 20px; }
    .nav-links { gap: 4px; }
    .nav-links a { padding: 4px 8px; font-size: 12px; }
}
