/* Base Styles */
:root {
    --primary-color: #1a73e8;
    --primary-dark: #0d47a1;
    --primary-light: #e8f0fe;
    --secondary-color: #34a853;
    --error-color: #ea4335;
    --warning-color: #fbbc04;
    --text-color: #202124;
    --text-secondary: #5f6368;
    --background-color: #fff;
    --surface-color: #fff;
    --divider-color: #dadce0;
    --shadow-color: rgba(60, 64, 67, 0.3);
    --border-radius: 8px;
    --transition-speed: 0.3s;
    --box-shadow: 0 1px 2px 0 rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
    --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --shimmer-color: rgba(227, 227, 227, 0.4);
    --focus-shadow: 0 0 0 2px rgba(26, 115, 232, 0.4);
    --hover-background: #f8f9fa;
}

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

body {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    background-color: #f5f5f5;
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8f0fe 100%);
}

.payment-container {
    max-width: 800px;
    width: 100%;
    background-color: var(--surface-color);
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06), 0 2px 10px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.3s ease;
}

.payment-container:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08), 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* Header Section */
.payment-header {
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid var(--divider-color);
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
}

.logo {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.logo img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.1));
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

.payment-header h1 {
    font-size: 26px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 12px;
}

.secure-badge {
    display: inline-flex;
    align-items: center;
    background-color: var(--primary-light);
    color: var(--primary-color);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 13px;
    margin-top: 10px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.secure-badge .material-icons-round {
    font-size: 16px;
    margin-right: 4px;
}

/* Main Content */
.payment-content {
    display: flex;
    flex-direction: column;
    padding: 0;
    background-color: var(--surface-color);
}

@media (min-width: 768px) {
    .payment-content {
        flex-direction: row;
    }
}

/* Order Summary */
.order-summary {
    padding: 28px;
    flex: 0 0 35%;
    border-bottom: 1px solid var(--divider-color);
    background-color: #fafafa;
    transition: background-color 0.3s ease;
}

.order-summary:hover {
    background-color: #f8f9fa;
}

@media (min-width: 768px) {
    .order-summary {
        border-bottom: none;
        border-right: 1px solid var(--divider-color);
    }
}

.order-summary h2 {
    font-size: 19px;
    font-weight: 500;
    margin-bottom: 24px;
    color: var(--text-color);
    position: relative;
    display: inline-block;
}

.order-summary h2:after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

.summary-content {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 14px;
    padding: 4px 0;
    transition: transform 0.2s ease;
}

.summary-row:hover {
    transform: translateX(3px);
}

.summary-row.total {
    margin-top: 10px;
    padding-top: 18px;
    border-top: 1px solid var(--divider-color);
    font-weight: 600;
    color: var(--text-color);
    font-size: 18px;
}

.payment-protection {
    display: flex;
    align-items: center;
    background-color: rgba(52, 168, 83, 0.05);
    padding: 12px 16px;
    border-radius: 12px;
    margin-top: 20px;
    border: 1px solid rgba(52, 168, 83, 0.1);
}

.protection-icon {
    margin-right: 12px;
}

.protection-icon .material-icons-round {
    color: var(--secondary-color);
    font-size: 24px;
}

.protection-text p {
    font-weight: 500;
    font-size: 14px;
    color: var(--text-color);
}

.protection-text span {
    font-size: 12px;
    color: var(--text-secondary);
}

/* Payment Form */
.payment-form-container {
    padding: 28px;
    flex: 1;
}

.payment-form-container h2 {
    font-size: 19px;
    font-weight: 500;
    margin-bottom: 28px;
    color: var(--text-color);
    position: relative;
    display: inline-block;
}

.payment-form-container h2:after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

.payment-form {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-group {
    width: 100%;
    margin-bottom: 0;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.input-container:focus-within + label,
.select-container:focus-within + label {
    color: var(--primary-color);
}

.input-container,
.select-container {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid var(--divider-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: all var(--transition-speed);
    background-color: var(--surface-color);
}

.input-container:hover,
.select-container:hover {
    border-color: #bdc1c6;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.input-container:focus-within,
.select-container:focus-within {
    border-color: var(--primary-color);
    box-shadow: var(--focus-shadow);
}

.input-focus-effect {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.input-container:focus-within .input-focus-effect,
.select-container:focus-within .input-focus-effect {
    width: 100%;
}

.input-container .material-icons-round,
.select-container .material-icons-round {
    padding: 0 12px;
    color: var(--text-secondary);
    font-size: 20px;
    transition: color 0.2s ease;
}

.input-container:focus-within .material-icons-round,
.select-container:focus-within .material-icons-round {
    color: var(--primary-color);
}

.input-validation-icon {
    position: absolute;
    right: 12px;
    display: none;
    color: var(--secondary-color);
}

.input-container.valid .input-validation-icon {
    display: block;
}

.input-container.valid .input-validation-icon:after {
    content: 'check_circle';
    font-family: 'Material Icons Round';
    color: var(--secondary-color);
}

.input-container.error .input-validation-icon {
    display: block;
}

.input-container.error .input-validation-icon:after {
    content: 'error';
    font-family: 'Material Icons Round';
    color: var(--error-color);
}

input, select {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-color);
    font-family: 'Google Sans', 'Roboto', sans-serif;
}

select {
    appearance: none;
    padding-right: 40px;
    cursor: pointer;
}

.select-container .material-icons-round {
    position: absolute;
    right: 10px;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.select-container:focus-within .material-icons-round {
    transform: rotate(180deg);
}

.pay-button {
    margin-top: 16px;
    padding: 0 24px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 52px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pay-button:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.pay-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.button-icon {
    margin-left: 8px;
    font-size: 18px;
}

.button-loader {
    display: none;
}

.pay-button.loading .button-text,
.pay-button.loading .button-icon {
    opacity: 0;
}

.pay-button.loading .button-loader {
    display: flex;
    position: absolute;
    justify-content: center;
    align-items: center;
}

.payment-methods {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.payment-methods-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.payment-icons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.payment-icon {
    width: 40px;
    height: 24px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.8;
}

.payment-icon:hover {
    transform: translateY(-2px);
    opacity: 1;
}

.payment-icon.visa {
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/thumb/5/5e/Visa_Inc._logo.svg/2560px-Visa_Inc._logo.svg.png');
}

.payment-icon.mastercard {
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/thumb/2/2a/Mastercard-logo.svg/1280px-Mastercard-logo.svg.png');
}

.payment-icon.amex {
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/thumb/f/fa/American_Express_logo_%282018%29.svg/1200px-American_Express_logo_%282018%29.svg.png');
}

.payment-icon.mobile-money {
    
}

/* Loader Animation */
.loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* Payment Messages */
.payment-message {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--surface-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    z-index: 10;
}

.payment-message.visible {
    opacity: 1;
    visibility: visible;
}

.success-animation {
    margin-bottom: 24px;
}

.checkmark-circle {
    width: 80px;
    height: 80px;
    position: relative;
    display: inline-block;
    vertical-align: top;
    border-radius: 50%;
    background-color: #ffffff;
    box-shadow: 0 0 0 2px var(--secondary-color) inset;
}

.checkmark-circle .checkmark {
    border-radius: 5px;
}

.checkmark-circle .checkmark.draw:after {
    animation-delay: 100ms;
    animation-duration: 1s;
    animation-timing-function: ease;
    animation-name: checkmark;
    transform: scaleX(-1) rotate(135deg);
    animation-fill-mode: forwards;
}

.checkmark-circle .checkmark:after {
    opacity: 0;
    height: 40px;
    width: 18px;
    transform-origin: left top;
    border-right: 5px solid var(--secondary-color);
    border-top: 5px solid var(--secondary-color);
    content: '';
    left: 22px;
    top: 40px;
    position: absolute;
}

@keyframes checkmark {
    0% {
        height: 0;
        width: 0;
        opacity: 1;
    }
    20% {
        height: 0;
        width: 18px;
        opacity: 1;
    }
    40% {
        height: 40px;
        width: 18px;
        opacity: 1;
    }
    100% {
        height: 40px;
        width: 18px;
        opacity: 1;
    }
}

.error-icon {
    font-size: 68px;
    color: var(--error-color);
    margin-bottom: 20px;
}

.payment-message h3 {
    font-size: 26px;
    margin-bottom: 16px;
    font-weight: 600;
}

.payment-message p {
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 15px;
}

.tx-reference {
    margin: 24px 0;
    padding: 16px 24px;
    background-color: var(--primary-light);
    border-radius: var(--border-radius);
    font-family: monospace;
    font-size: 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.close-message, .retry-button {
    margin-top: 30px;
    padding: 14px 28px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.close-message:hover, .retry-button:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(-1px);
}

.close-message:active, .retry-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.close-message .material-icons-round, 
.retry-button .material-icons-round {
    margin-left: 8px;
}

/* Skeleton Loading Effect */
.skeleton-loading {
    position: relative;
    overflow: hidden;
}

.skeleton-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--shimmer-color), transparent);
    animation: shimmer 1.5s infinite;
    z-index: 1;
}

.skeleton-loading > * {
    visibility: hidden;
}

.skeleton-loading.loaded::before {
    display: none;
}

.skeleton-loading.loaded > * {
    visibility: visible;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    .container {
        padding: 0 !important;
    }
    .form-row {
        flex-direction: column;
        gap: 22px;
    }
    
    .payment-container {
        border-radius: 12px;
    }
}