:root {
    /* Default colors (will be overridden by JavaScript) */
    --merchant-bg: rgb(44, 62, 80);
    --merchant-accent: rgb(74, 144, 226);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--merchant-bg) 0%, #1a1a1a 50%, var(--merchant-accent) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    max-width: 500px;
    width: 100%;
}

.card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    animation: slideUp 0.5s ease-out;
}

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

.header {
    text-align: center;
    margin-bottom: 40px;
}

.logo-img {
    width: 200px;
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
    animation: fadeIn 0.8s ease;
}

.icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

h1 {
    color: #2d3748;
    font-size: 28px;
    margin-bottom: 10px;
}

.subtitle {
    color: #718096;
    font-size: 16px;
}

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

label {
    display: block;
    color: #4a5568;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="tel"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #f7fafc;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
    outline: none;
    border-color: var(--merchant-accent);
    background: white;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--merchant-accent) 10%, transparent);
}

.shop-info {
    background: #f7fafc;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shop-info .label {
    color: #718096;
    font-weight: 600;
    font-size: 14px;
}

.shop-info .value {
    color: #2d3748;
    font-weight: 700;
    font-size: 16px;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--merchant-accent) 0%, color-mix(in srgb, var(--merchant-accent) 80%, white) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px color-mix(in srgb, var(--merchant-accent) 40%, transparent);
}

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

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 24px;
    transition: transform 0.3s ease;
}

.submit-btn:hover .btn-icon {
    transform: translateX(5px);
}

.success-message,
.error-message {
    text-align: center;
    padding: 30px;
    border-radius: 15px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.success-message {
    background: #f0fdf4;
    border: 2px solid #86efac;
}

.success-icon {
    font-size: 64px;
    color: #22c55e;
    margin-bottom: 15px;
}

.success-message h2 {
    color: #16a34a;
    margin-bottom: 10px;
}

.success-message p {
    color: #15803d;
    margin-bottom: 20px;
}

.error-message {
    background: #fef2f2;
    border: 2px solid #fca5a5;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.error-message p {
    color: #dc2626;
}

.download-btn {
    width: 100%;
    padding: 14px;
    background: #000;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.download-btn:hover {
    background: #333;
    transform: scale(1.02);
}

.demo-message {
    margin-top: 20px;
    padding: 20px;
    background: #fffbeb;
    border: 2px solid #fbbf24;
    border-radius: 10px;
    text-align: left;
}

.demo-message strong {
    color: #b45309;
}

.demo-message p {
    color: #92400e;
    font-size: 14px;
    margin-bottom: 10px;
}

.card-data {
    margin-top: 15px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #374151;
    white-space: pre-wrap;
    word-break: break-all;
}

.hidden {
    display: none !important;
}

.footer {
    text-align: center;
    margin-top: 20px;
    color: white;
    font-size: 14px;
    opacity: 0.9;
}

/* Card Details */
.card-details {
    margin: 25px 0;
    padding: 20px;
    background: white;
    border: 2px dashed #e2e8f0;
    border-radius: 12px;
}

.detail-label {
    font-weight: 600;
    color: #4a5568;
    font-size: 14px;
    margin-bottom: 10px;
}

.barcode-section {
    margin-bottom: 20px;
}

.barcode-display {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.barcode-display code {
    font-size: 24px;
    font-weight: 700;
    color: #2d3748;
    font-family: 'Courier New', monospace;
    letter-spacing: 3px;
}

.qrcode-container {
    text-align: center;
    margin-top: 20px;
}

.qrcode-container canvas {
    border: 3px solid #f7fafc;
    border-radius: 12px;
    max-width: 200px;
    height: auto;
}

.info-text {
    margin-top: 15px;
    font-size: 13px;
    color: #64748b;
    text-align: center;
    font-style: italic;
}

.secondary-btn {
    width: 100%;
    padding: 14px;
    background: #f7fafc;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.secondary-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e0;
}

/* Loading spinner */
.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 600px) {
    .card {
        padding: 30px 20px;
    }

    h1 {
        font-size: 24px;
    }

    .icon {
        font-size: 48px;
    }
}
