* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Tahoma, Arial, sans-serif;
    background: #edf0f3;
    color: #1f2937;
}

.page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px;
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    align-items: start;
}

.panel {
    background: #ffffff;
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

h1, h2 {
    margin-top: 0;
}

.form {
    display: grid;
    gap: 16px;
    margin-top: 20px;
}

.form label {
    display: grid;
    gap: 8px;
    font-weight: bold;
}

input[type="text"],
input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #fff;
}

button {
    border: 0;
    border-radius: 12px;
    padding: 14px 16px;
    background: #1f3444;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

button:hover {
    opacity: 0.95;
}

.download-btn {
    background: #d59c24;
    color: #1f2937;
    font-weight: 700;
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-top: 16px;
}

.alert.error {
    background: #fee2e2;
    color: #991b1b;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.preview-panel {
    overflow: auto;
}

.card-preview {
    position: relative;
    width: min(100%, 1280px);
    aspect-ratio: 1280 / 720;
    margin-top: 16px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    background: #dfe4ea;
}

.card-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-slot {
    position: absolute;
    left: 15.7%;
    top: 25.0%;
    width: 27.2%;
    height: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 36px;
}

.photo-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.photo-placeholder {
    width: 92%;
    height: 92%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    background: rgba(255,255,255,0.75);
    border: 2px dashed #9ca3af;
    border-radius: 28px;
    font-size: 24px;
    font-weight: bold;
}

.name-slot {
    position: absolute;
    right: 16.2%;
    top: 78.3%;
    width: 31%;
    min-height: 6%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px 10px;
    color: #d59c24;
    font-size: clamp(6px, 2.1vw, 14px);
    font-weight: 900;
    line-height: 1.15;
    text-shadow: 0 1px 2px rgba(0,0,0,0.28);
}

.name-slot.filled {
    background: transparent;
}

@media (max-width: 980px) {
    .page {
        grid-template-columns: 1fr;
    }
}
