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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Password Protection Styles */
.password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.password-container {
    background: white;
    border-radius: 16px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.password-container h1 {
    color: #1e293b;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.password-container p {
    color: #64748b;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.password-input-group {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.password-input-group input {
    flex: 1;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.password-input-group input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.password-input-group button {
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.password-input-group button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
}

.password-error {
    color: #ef4444;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-top: 1rem;
}

.password-error.hidden {
    display: none;
}

@media (max-width: 480px) {
    .password-container {
        padding: 2rem 1.5rem;
    }
    
    .password-container h1 {
        font-size: 1.75rem;
    }
    
    .password-input-group {
        flex-direction: column;
    }
    
    .password-input-group button {
        margin-top: 0.5rem;
    }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.form {
    padding: 2rem;
}

.form-section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.form-section h2 {
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: white;
}

.form-group input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group input:invalid {
    border-color: #ef4444;
}

.form-group input:invalid:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.btn-primary,
.btn-secondary {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
}

.btn-primary {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
    background: #f1f5f9;
    color: #64748b;
    border: 2px solid #e2e8f0;
}

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

.qr-section {
    padding: 2rem;
    text-align: center;
    background: #f8fafc;
    margin: 2rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.qr-section h2 {
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

#qrCodeContainer {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

#qrCodeContainer svg {
    border: 4px solid white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.hidden {
    display: none;
}

.loading {
    color: #6b7280;
    font-style: italic;
}

.error {
    color: #ef4444;
    background: #fef2f2;
    border: 1px solid #fecaca;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.success {
    color: #059669;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

/* Print Information Styling */
.print-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    color: #0c4a6e;
}

.print-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #0369a1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.print-recommendations {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.print-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #0284c7;
}

.print-item strong {
    color: #0369a1;
    font-weight: 600;
}

.print-note {
    font-size: 0.875rem;
    color: #64748b;
    font-style: italic;
}

.print-tips {
    margin-top: 0.5rem;
    padding: 1rem;
    background: #e0f2fe;
    border-radius: 8px;
    border-left: 4px solid #0891b2;
}

.print-tips strong {
    color: #0369a1;
    font-weight: 600;
    display: block;
    margin-bottom: 0.5rem;
}

.print-tips ul {
    margin: 0;
    padding-left: 1.25rem;
    color: #475569;
}

.print-tips li {
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* File Upload Styling */
.file-upload-container {
    position: relative;
    margin-bottom: 1rem;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.file-upload-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.5rem;
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    background: #f9fafb;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.file-upload-label:hover {
    border-color: #4f46e5;
    background: #f0f7ff;
    color: #4f46e5;
}

.file-upload-label svg {
    flex-shrink: 0;
}

.file-upload-text {
    font-size: 1rem;
}

.file-input:focus + .file-upload-label {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}

.logo-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.logo-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: #374151;
}

.remove-logo-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.remove-logo-btn:hover {
    background: #fef2f2;
}

.logo-preview-content {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 6px;
    min-height: 80px;
}

.logo-preview-content img,
.logo-preview-content svg {
    max-width: 60px;
    max-height: 60px;
    width: auto;
    height: auto;
}

.file-help-text {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* Drag and drop states */
.file-upload-label.drag-over {
    border-color: #4f46e5;
    background: #f0f7ff;
    color: #4f46e5;
}

/* Save/Load Styling */ 
.save-load-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.save-input-group,
.load-select-group {
    display: flex;
    gap: 0.5rem;
    align-items: end;
}

.save-input-group input,
.load-select-group select {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.95rem;
}

.load-select {
    background: white;
    cursor: pointer;
}

.load-select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.btn-delete {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #ef4444;
    color: white;
}

.btn-delete:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-delete:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.saved-item-info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #0c4a6e;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        margin: 0;
        border-radius: 0;
    }
    
    header {
        padding: 1.5rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .form {
        padding: 1.5rem;
    }
    
    .form-section {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        max-width: 300px;
    }
    
    .qr-section {
        margin: 1rem;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.75rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .form-section h2 {
        font-size: 1.25rem;
    }
    
    .print-info {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .print-info h3 {
        font-size: 1.1rem;
    }
    
    .print-item {
        padding: 0.5rem;
    }
    
    .print-tips {
        padding: 0.75rem;
    }
    
    .print-tips ul {
        padding-left: 1rem;
    }
    
    .save-input-group,
    .load-select-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .save-input-group input,
    .load-select-group select {
        margin-bottom: 0.5rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for better keyboard navigation */
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
input:focus-visible {
    outline: 2px solid #4f46e5;
    outline-offset: 2px;
}