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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    max-width: 900px;
    width: 100%;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

h1 {
    text-align: center;
    color: #2d3748;
    margin-bottom: 10px;
}

h2 {
    text-align: center;
    color: #4a5568;
    font-weight: 400;
    margin-bottom: 30px;
}

.packages {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.package-card {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.package-card:hover {
    transform: translateY(-5px);
    border-color: #667eea;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
}

.package-card h3 {
    color: #2d3748;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.package-card .price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
}

.package-card .details {
    font-size: 0.85rem;
    color: #718096;
}

.package-card .details span {
    display: block;
    margin: 3px 0;
}

.payment-form {
    background: #f7fafc;
    border-radius: 12px;
    padding: 25px;
    margin-top: 20px;
    animation: slideDown 0.5s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.payment-form h3 {
    color: #2d3748;
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    color: #4a5568;
    font-weight: 600;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

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

.form-group small {
    color: #718096;
    font-size: 0.85rem;
}

#selectedPackageDisplay {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.pay-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.pay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

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

.btn-loader {
    display: none;
}

#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
}

#loadingOverlay .loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

#loadingOverlay p {
    color: white;
    margin-top: 20px;
    font-size: 1.1rem;
}

#loadingOverlay .status-message {
    font-size: 0.95rem;
    opacity: 0.8;
    margin-top: 5px;
}

.success-page .success-icon {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 20px;
}

.credentials {
    background: #f7fafc;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.credential-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

.credential-item:last-child {
    border-bottom: none;
}

.credential-item .label {
    color: #718096;
    font-weight: 500;
}

.credential-item .value {
    color: #2d3748;
    font-size: 1.05rem;
}

.copy-btn {
    background: #e2e8f0;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: #cbd5e0;
}

.instructions {
    background: #ebf8ff;
    border-left: 4px solid #3182ce;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.instructions ol {
    padding-left: 20px;
    color: #2d3748;
}

.instructions li {
    margin: 5px 0;
}

.actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

.btn-print, .btn-home, .btn-retry {
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-print {
    background: #48bb78;
    color: white;
}

.btn-print:hover {
    background: #38a169;
}

.btn-home {
    background: #e2e8f0;
    color: #2d3748;
}

.btn-home:hover {
    background: #cbd5e0;
}

.btn-retry {
    background: #ed8936;
    color: white;
}

.btn-retry:hover {
    background: #dd6b20;
}

.note {
    text-align: center;
    color: #718096;
    margin-top: 20px;
}

.failure-page .failure-icon {
    font-size: 4rem;
    text-align: center;
    margin-bottom: 20px;
}

.error-details {
    background: #fff5f5;
    border-left: 4px solid #fc8181;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.support {
    text-align: center;
    margin-top: 20px;
    color: #718096;
}

.support a {
    color: #667eea;
    text-decoration: none;
}

.support a:hover {
    text-decoration: underline;
}

@media (max-width: 640px) {
    .container {
        padding: 20px;
    }
    
    .packages {
        grid-template-columns: 1fr 1fr;
    }
    
    .actions {
        flex-direction: column;
    }
    
    .btn-print, .btn-home, .btn-retry {
        width: 100%;
        text-align: center;
    }
}

/* Additional styles for username/password login */
.login-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 10px;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: white;
}

.login-input:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-input::placeholder {
    color: #a0aec0;
}

.btn-primary {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-success {
    background: #48bb78;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-success:hover {
    background: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.form-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.form-divider::before,
.form-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e2e8f0;
}

.form-divider span {
    padding: 0 15px;
    color: #a0aec0;
    font-size: 0.85rem;
}
