.card-page {
    max-width: var(--medium-width);
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 24px;
}

.form-section {
    flex: 1;
    max-width: 320px;
}

.form-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
}

.form-header {
    font-size: 14px;
    font-weight: 600;
    color: #3b82f6;
    background: #eff6ff;
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.label-icon {
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    background: #f9fafb;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #3b82f6;
}

.form-input::placeholder {
    color: #9ca3af;
}

.upload-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-btn:hover {
    background: #e5e7eb;
}

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

.template-item {
    width: calc(50% - 5px);
    aspect-ratio: 1.66;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.template-item:hover {
    border-color: #3b82f6;
}

.template-item.active {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.template-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.template-item span {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 10px;
    text-align: center;
    padding: 3px 0;
}

.template-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-input {
    display: none;
}

.upload-hint {
    display: block;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 6px;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.btn-download {
    flex: 1;
    padding: 10px 16px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-download:hover {
    background: #2563eb;
}

.preview-section {
    flex: 2;
}

.preview-header {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 16px;
}

.card-preview-wrap {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
    min-height: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-image: 
        linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
        linear-gradient(-45deg, transparent 75%, #e5e7eb 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.card-front, .card-back {
    width: 972px;
    height: 584px;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

.card-front-content {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 50px 60px;
    height: 100%;
    color: #000000;
}

.front-main {
    flex: 1;
    padding: 0 40px;
}

.name {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 12px;
}

.title {
    font-size: 28px;
    opacity: 0.9;
    margin-bottom: 82px;
}

.front-contacts {
    margin-left: 50px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.contact-text {
    font-size: 24px;
    opacity: 0.9;
}

.qrcode {
    margin-top: 70px;
    width: 180px;
    height: 180px;
    border-radius: 16px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.back-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.company-name {
    font-size: 60px;
    font-weight: 700;
    color: #374151;
}

@media (max-width: 768px) {
    .card-page {
        flex-direction: column;
    }
    
    .form-section {
        max-width: 100%;
    }
    
    .card-front, .card-back {
        width: 100%;
        max-width: 320px;
    }
}