:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent: #10b981;
    --bg-card: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
}

.im-app-card {
    max-width: 850px;
    margin: 40px auto;
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.05);
    overflow: hidden;
    font-family: 'Inter', system-ui, sans-serif;
    border: 1px solid var(--border-color);
}

.im-header {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    padding: 40px 20px;
    text-align: center;
    color: white;
}

.im-header h2 { margin: 0; font-size: 28px; font-weight: 800; }
.im-header p { opacity: 0.9; margin-top: 8px; font-size: 15px; }

.im-body { padding: 40px; }

.im-steps { display: flex; justify-content: center; margin-bottom: 30px; gap: 10px; }
.im-step-dot { height: 8px; width: 40px; border-radius: 4px; background: #e5e7eb; transition: 0.4s; }
.im-step-dot.active { background: var(--primary); width: 60px; }

.im-upload-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

.im-drop-zone {
    border: 2px dashed #cbd5e1;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
    position: relative;
    height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Drag and Drop Hover Effect */
.im-drop-zone.drag-over {
    border-color: var(--primary);
    background: #eef2ff;
    transform: scale(1.02);
}

.im-drop-zone img.im-preview {
    position: absolute; width: 100%; height: 100%; object-fit: contain;
    border-radius: 18px; display: none; background: #fff; padding: 5px;
}

.im-drop-zone.has-img .im-icon-box, .im-drop-zone.has-img p { display: none; }
.im-drop-zone.has-img img.im-preview { display: block; }

.im-controls {
    display: flex; justify-content: center; background: #f1f5f9;
    padding: 8px; border-radius: 14px; margin-bottom: 30px; gap: 10px;
}

.im-option {
    flex: 1; text-align: center; padding: 12px; border-radius: 10px;
    cursor: pointer; font-weight: 600; color: var(--text-muted); transition: 0.3s;
}

.im-option.active { background: white; color: var(--primary); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }

.im-btn-main {
    background: var(--primary); color: white; width: 100%; padding: 18px;
    border-radius: 16px; font-weight: 700; font-size: 17px; border: none; cursor: pointer;
}

.im-btn-main:disabled { background: #cbd5e1; cursor: not-allowed; }

.im-result-view { display: none; text-align: center; }
.im-result-view.active { display: block; animation: fadeIn 0.5s ease; }

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

.im-merged-preview { max-width: 100%; border-radius: 16px; margin-bottom: 25px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }

.im-action-btns { display: flex; gap: 15px; }
.im-btn-download { background: var(--accent); flex: 2; }
.im-btn-reset { background: #f1f5f9; color: var(--text-main); flex: 1; text-decoration: none; display: flex; align-items: center; justify-content: center; border-radius: 16px; font-weight: 700;}

.im-loader { display: none; color: var(--primary); font-weight: 700; margin-top: 15px; text-align: center;}