:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --success: #10b981;
    --danger: #ef4444;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --glass-bg: rgba(255, 255, 255, 0.95);
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1),
              0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1f2937;
}

#mainWrapper {
    max-width: 1100px;
    width: 95%;
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 25px;
    padding: 20px;
}

form {
    background: var(--glass-bg);
    padding: 30px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

h2 {
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 20px;
    background: linear-gradient(to right, #4f46e5, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.file-input-wrapper label {
    display: block;
    padding: 15px;
    background: var(--primary);
    color: #fff;
    text-align: center;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.file-input-wrapper label:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.file-input-wrapper input {
    display: none;
}

select {
    appearance: none;
    padding: 12px;
    border-radius: 10px;
    border: 1.5px solid #e5e7eb;
    background-color: #f9fafb;
    font-size: 15px;
}

select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

button {
    font-weight: 600;
    border: none;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
}

#submitBtn {
    background: var(--success);
    color: white;
}

#submitBtn.loading {
    opacity: 0.7;
    pointer-events: none;
}

#resetBtn {
    background: transparent;
    color: var(--danger);
    border: 1.5px solid var(--danger);
}

#resetBtn:hover {
    background: var(--danger);
    color: white;
}

#previewPlaceholder,
#previewContainer {
    background: var(--glass-bg);
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 30px;
    min-height: 450px;
}

#previewPlaceholder {
    border: 2px dashed #cbd5e1;
    display: none;
    gap: 20px;
    justify-content: center;
    align-items: flex-start;
    color: #64748b;
}

#previewPlaceholder.hidden {
    display: none;
}

#previewContainer {
    display: none;
    justify-content: space-around;
    align-items: center;
    gap: 20px;
}

h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-bottom: 15px;
}


#previewContainer img {
    width: 100%;
    max-width: 260px;
    object-fit: cover;
    background: #f1f5f9;
    border-radius: 12px;
    border: 4px solid white;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

img.carnet {
    aspect-ratio: 2 / 3;
}

img.producto {
    aspect-ratio: 1 / 1;
}

#downloadBtn {
    background: var(--primary);
    width: 100%;
    margin-top: 20px;
    font-size: 1rem;
    color: white;
}



@media (max-width: 768px) {
    #mainWrapper {
        grid-template-columns: 1fr;
    }

    #previewContainer {
        flex-direction: column;
    }
    .hidden {
    display: none;
}

}
