:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --success: #10b981;
    --success-hover: #059669;
    --secondary: #475569;
    --secondary-hover: #334155;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

.background-glow {
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(37,99,235,0.3) 0%, rgba(0,0,0,0) 70%);
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 0;
    filter: blur(60px);
}

.app-card {
    position: relative;
    z-index: 1;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 35px;
    max-width: 840px; /* Wider container for Side-by-Side layout */
    width: 100%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.app-header {
    text-align: center;
    margin-bottom: 25px;
}

.badge {
    display: inline-block;
    background: rgba(37, 99, 235, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.3);
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50px;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.app-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.app-header p {
    color: var(--text-muted);
    font-size: 14px;
}

.form-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-width: 500px;
    margin: 0 auto;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.file-dropzone {
    position: relative;
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    background: rgba(15, 23, 42, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-dropzone:hover {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.file-dropzone input[type="file"] {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-dropzone span {
    font-size: 13px;
    color: var(--text-muted);
}

input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    outline: none;
}

.btn-primary, .btn-success, .btn-single-dl {
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.3s ease;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    font-size: 15px;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-success {
    width: 100%;
    padding: 14px;
    background: var(--success);
    color: white;
    font-size: 15px;
    margin-top: 15px;
}

.btn-success:hover {
    background: var(--success-hover);
    transform: translateY(-1px);
}

.btn-single-dl {
    width: 100%;
    padding: 10px;
    background: var(--secondary);
    color: white;
    font-size: 13px;
    margin-top: 10px;
}

.btn-single-dl:hover {
    background: var(--secondary-hover);
}

.status-msg {
    margin-top: 15px;
    font-size: 14px;
    text-align: center;
    color: #38bdf8;
    font-weight: 500;
}

.preview-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.preview-section h3 {
    font-size: 16px;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-muted);
}

/* SIDE BY SIDE GRID FIX */
.card-preview-grid {
    display: flex;
    flex-direction: row; /* Horizontal Side-by-Side */
    gap: 25px;
    justify-content: center;
    align-items: flex-start;
    flex-wrap: wrap; /* Mobile friendly fallback */
}

.card-box {
    flex: 1;
    min-width: 320px;
    max-width: 370px;
    text-align: center;
}

.card-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.card-box canvas {
    width: 100%;
    height: auto;
    aspect-ratio: 85.6 / 53.98;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}