/* CSS Variables - Design Tokens */
:root {
    --background: #ffffff;
    --foreground: #111111;
    --card: #ffffff;
    --card-foreground: #111111;
    --primary: #e85a3a;
    --primary-foreground: #ffffff;
    --button: #ff5e2e;
    --button-foreground: #ffffff;
    --secondary: #fff5f2;
    --secondary-foreground: #111111;
    --muted: #737373;
    --muted-foreground: #737373;
    --accent: #ffeae5;
    --accent-foreground: #111111;
    --border: #f0e5e2;
    --ring: #e85a3a;
    --success: #10b981;
    --error: #ef4444;
    --google-blue: #4285F4;
    --visa-blue: #1565C0;
    --airtel-red: #ED1C24;
    --mtn-yellow: #FFCC00;
    --radius: 12px;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Base */
html {
    background-color: var(--background);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin-bottom: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--foreground);
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    flex: 1;
}

@media (min-width: 900px) {
    .main-content {
        grid-template-columns: 340px 1fr;
    }
}

/* Order Summary */
.order-summary {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    height: fit-content;
    border: 1px solid var(--border);
    order: 2;
}

@media (min-width: 900px) {
    .order-summary {
        order: 1;
        position: sticky;
        top: 24px;
    }
}

.order-summary h2 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--foreground);
}

.order-item {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.item-image {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--primary) 0%, #ff8c6b 100%);
    border-radius: 8px;
    flex-shrink: 0;
}

.item-details h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.item-details p {
    font-size: 13px;
    color: var(--muted);
}

.item-price {
    margin-left: auto;
    font-size: 16px;
    font-weight: 600;
}

.order-divider {
    height: 1px;
    background: var(--border);
    margin: 16px 0;
}

.order-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--muted-foreground);
    margin-bottom: 8px;
}

.order-total {
    font-size: 18px;
    font-weight: 700;
    color: var(--foreground);
    margin-top: 8px;
}

/* Payment Section */
.payment-section {
    background: var(--card);
    border-radius: var(--radius);
    padding: 32px;
    border: 1px solid var(--border);
    order: 1;
}

@media (min-width: 900px) {
    .payment-section {
        order: 2;
    }
}

.payment-section h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.payment-subtitle {
    color: var(--muted);
    font-size: 15px;
    margin-bottom: 32px;
}

/* Payment Methods */
.payment-methods h2 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    margin-bottom: 16px;
}

.methods-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

@media (min-width: 600px) {
    .methods-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.payment-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.payment-method:hover {
    border-color: var(--muted);
    background: var(--secondary);
}

.payment-method.active {
    border-color: var(--button);
    background: var(--secondary);
}

.method-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--secondary);
}

.method-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--foreground);
    text-align: center;
}

.method-check {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    background: var(--button);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.method-check svg {
    stroke: var(--primary-foreground);
}

.payment-method.active .method-check {
    opacity: 1;
    transform: scale(1);
}

/* Payment Forms */
.payment-forms {
    min-height: 280px;
}

.payment-form {
    animation: fadeIn 0.3s ease;
}

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

.form-header {
    margin-bottom: 24px;
}

.form-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.form-header p {
    color: var(--muted);
    font-size: 14px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--foreground);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--foreground);
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--button);
}

.form-group input::placeholder {
    color: var(--muted);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.input-with-icon {
    position: relative;
}

.input-with-icon input {
    padding-right: 48px;
}

.card-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.input-with-prefix {
    display: flex;
    border: 2px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: border-color 0.2s ease;
}

.input-with-prefix:focus-within {
    border-color: var(--button);
}

.prefix {
    padding: 14px 16px;
    background: var(--secondary);
    font-size: 16px;
    font-weight: 500;
    color: var(--foreground);
    border-right: 2px solid var(--border);
}

.mtn-prefix {
    background: var(--mtn-yellow);
    color: #000;
}

.input-with-prefix input {
    border: none;
    border-radius: 0;
    flex: 1;
}

.input-with-prefix input:focus {
    border: none;
}

/* Mobile Money Info */
.mobile-money-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    margin-bottom: 24px;
}

.mobile-money-info svg {
    flex-shrink: 0;
    color: var(--success);
}

.mobile-money-info p {
    font-size: 14px;
    color: var(--foreground);
}

.mtn-info {
    background: rgba(255, 204, 0, 0.15);
}

.mtn-info svg {
    color: #b38f00;
}

/* Submit Buttons */
.submit-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    background: var(--button);
    color: var(--button-foreground);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.submit-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.submit-btn:active {
    transform: translateY(0);
}

.airtel-btn {
    background: var(--airtel-red);
}

.mtn-btn {
    background: var(--mtn-yellow);
    color: #000;
}

/* Google Pay Button */
.google-pay-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.google-pay-button:hover {
    background: #222;
}

/* Default State */
.default-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.select-prompt {
    text-align: center;
    color: var(--muted);
}

.select-prompt svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.select-prompt p {
    font-size: 15px;
}

/* Security Footer */
.security-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.security-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
}

.security-item svg {
    color: var(--success);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--card);
    border-radius: var(--radius);
    padding: 40px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-icon.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.modal-icon.processing {
    background: var(--secondary);
}

.modal h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
}

.modal p {
    color: var(--muted);
    font-size: 15px;
    margin-bottom: 8px;
}

.transaction-id {
    font-family: monospace;
    background: var(--secondary);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    margin: 16px 0;
    display: inline-block;
}

.modal-btn {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    background: var(--button);
    color: var(--button-foreground);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 16px;
    font-family: inherit;
    transition: opacity 0.2s ease;
}

.modal-btn:hover {
    opacity: 0.9;
}

.processing-hint {
    font-size: 13px;
    color: var(--muted);
    font-style: italic;
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--button);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 16px;
    }
    
    .payment-section {
        padding: 24px;
    }
    
    .payment-section h1 {
        font-size: 24px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .security-footer {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .header {
        flex-direction: column;
        gap: 12px;
    }
}
