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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000000;
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    gap: 20px;
}

.logo {
    height: 60px;
}

header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 300;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    margin: 0;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.form-section, .preview-section {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

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

.form-group label {
    display: block;
    margin-bottom: 2px;
    font-weight: 600;
    color: #555;
    font-size: 1rem;
}

.form-group input {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

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

.field-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
}

.char-counter {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: #e1e5e9;
    border-radius: 2px;
    margin-left: 15px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

.field-hint {
    font-size: 11px;
    color: #666;
    margin-top: 3px;
    font-style: italic;
}

.date-display {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
    margin-top: 5px;
}

.help-text {
    font-size: 11px;
    color: #666;
    margin-top: 3px;
    font-style: italic;
}

.validation-message {
    font-size: 12px;
    margin-top: 5px;
    min-height: 18px;
}

.validation-message.valid {
    color: #28a745;
}

.validation-message.invalid {
    color: #dc3545;
}

.date-display {
    padding: 12px 15px;
    background: #f8f9fa;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 5px;
}

.help-text {
    color: #666;
    font-style: italic;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.form-actions button {
    flex: 1;
    padding: 15px 25px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#generateBtn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

#generateBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

#downloadBtn {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

#downloadBtn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.preview-section h3 {
    margin-bottom: 20px;
    color: #555;
    font-size: 1.5rem;
    text-align: center;
}

.card-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #e1e5e9;
}

#cardCanvas {
    border: 2px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background: white;
    width: 508px;
    height: 319px;
    display: block;
}

.preview-info {
    text-align: center;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .form-section, .preview-section {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .container {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .form-section, .preview-section {
        padding: 15px;
    }
    
    .form-group input {
        padding: 10px 12px;
    }
    
    .form-actions button {
        padding: 12px 20px;
        font-size: 1rem;
    }
}

/* Instructions de sauvegarde */
.save-instructions {
    margin-top: 20px;
    padding: 15px;
    background-color: #fff5f5;
    border: 2px solid #ff4444;
    border-radius: 8px;
    text-align: center;
}

.save-instruction-primary {
    color: #ff0000;
    font-weight: bold;
    font-size: 12px;
    margin-bottom: 8px;
    animation: blink 1.5s infinite;
}

.save-instruction-secondary {
    color: #cc0000;
    font-weight: bold;
    font-size: 14px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* Copyright */
.copyright {
    margin-top: 15px;
    padding: 10px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

.copyright-text {
    color: #666666;
    font-size: 12px;
    font-style: italic;
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }
    
    .form-section, .preview-section {
        width: 100%;
    }
    
    .card-preview canvas {
        max-width: 100%;
        height: auto;
    }
    
    .save-instructions {
        margin-top: 15px;
        padding: 12px;
    }
    
    .save-instruction-primary {
        font-size: 14px;
    }
    
    .save-instruction-secondary {
        font-size: 12px;
    }
}
