body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background: #f4f6f9;
}

/* Header */

header {
    background: #1976d2;
    color: white;
    text-align: center;
    padding: 30px 20px;
}

header h1 {
    margin: 0;
}

header p {
    margin-top: 10px;
}

/* Card */

.card {
    max-width: 500px;
    margin: 30px auto;
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    box-sizing: border-box;
}

/* Heading */

.card h2 {
    color: #1976d2;
    text-align: center;
}

.card h3 {
    color: #1976d2;
    text-align: center;
    margin-top: 20px;
}

/* Inputs */

input,
select {
    width: 100%;
    padding: 12px;
    margin-top: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 16px;
}

/* Buttons */

button,
.btn {
    width: 100%;
    background: #28a745;
    color: white;
    border: none;
    padding: 14px;
    font-size: 16px;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    box-sizing: border-box;
}

button:hover,
.btn:hover {
    background: #218838;
}

/* Price */

#total {
    color: #1976d2;
    text-align: center;
}

/* Images and Canvas Global Setup */

img, canvas {
    max-width: 100%;
    height: auto;
}

/* ID Crop Area Container - Updated for Canvas Stability */

.canvas-container {
    width: 100%;
    max-width: 400px;
    margin: 15px auto;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    box-sizing: border-box;
}

#frontCanvas,
#backCanvas {
    display: block;
    width: 100%;
    height: auto;
}

/* Legacy Image Viewports for compatibility */

#frontImage,
#backImage {
    display: block;
    max-width: 100%;
    max-height: 180px;
}

/* Crop Buttons */

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.controls button {
    flex: 1;
    min-width: 110px;
    width: auto;
    padding: 10px;
    font-size: 14px;
}

/* Mobile responsive adjustments */

@media (max-width: 480px) {

    .card {
        margin: 15px
