:root {
    --id-photo-green: #059669;
    --id-photo-light: #DCFCE7;
    --id-photo-dark: #047857;
}

.id-photo-page {
    padding: 20px;
    max-width: var(--small-width);
    margin: 0 auto;
}

.id-photo-container {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
}

@media (max-width: 1024px) {
    .id-photo-container {
        grid-template-columns: 1fr;
    }
}

.id-photo-config {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 20px;
    height: fit-content;
}

.config-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

.upload-area {
    border: 2px dashed #e2e8f0;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: var(--id-photo-green);
    background: #f0fdf4;
}

.upload-area.dragover {
    border-color: var(--id-photo-green);
    background: var(--id-photo-light);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.upload-area p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #64748b;
}

.upload-tip {
    font-size: 12px !important;
    color: #94a3b8 !important;
}

.upload-preview {
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f8fafc;
    border-radius: 6px;
}

.upload-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.size-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.size-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.size-option:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.size-option input[type="radio"] {
    display: none;
}

.size-option input[type="radio"]:checked + .size-label {
    color: var(--id-photo-green);
    font-weight: 600;
}

.size-option input[type="radio"]:checked ~ .color-preview {
    border-color: var(--id-photo-green);
}

.size-option input[type="radio"]:checked {
    border-color: var(--id-photo-green);
    background: var(--id-photo-light);
}

.size-option input[type="radio"]:checked + .size-label {
    position: relative;
}

.size-option input[type="radio"]:checked + .size-label::after {
    content: '✓';
    position: absolute;
    right: -16px;
    top: -2px;
    font-size: 14px;
    color: var(--id-photo-green);
}

.size-label {
    font-size: 14px;
    color: #334155;
    margin-bottom: 4px;
}

.size-desc {
    font-size: 11px;
    color: #94a3b8;
}

.bg-color-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.bg-color-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.bg-color-item:hover {
    background: #f8fafc;
}

.bg-color-item.active {
    background: #f0fdf4;
}

.color-preview {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    transition: all 0.2s;
}

.bg-color-item.active .color-preview {
    border-color: var(--id-photo-green);
    transform: scale(1.1);
}

.bg-color-item span {
    font-size: 12px;
    color: #64748b;
}

.bg-color-item.active span {
    color: var(--id-photo-green);
    font-weight: 600;
}

.custom-color .color-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.custom-color input[type="color"] {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
}

.config-section {
    margin-bottom: 16px;
}

.config-section label {
    display: block;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 500;
}

.config-section input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e2e8f0;
    border-radius: 3px;
    cursor: pointer;
}

.config-section input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--id-photo-green);
    border-radius: 50%;
    cursor: pointer;
}

.config-section input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--id-photo-green);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.range-value {
    display: block;
    text-align: right;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-secondary {
    flex: 1;
    padding: 10px;
    background: #f1f5f9;
    color: #64748b;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-primary {
    flex: 2;
    padding: 10px;
    background: linear-gradient(135deg, var(--id-photo-green) 0%, var(--id-photo-dark) 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.id-photo-preview {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.preview-title {
    font-size: 16px;
    font-weight: 600;
    color: #334155;
}

.preview-box {
    width: 100%;
    aspect-ratio: 1/1;
    background: #f8fafc;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

#previewCanvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: none;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #94a3b8;
}

.placeholder-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.preview-placeholder p {
    margin: 0;
    font-size: 14px;
}

.download-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.btn-download {
    flex: 1;
    padding: 10px;
    background: var(--id-photo-light);
    color: var(--id-photo-green);
    border: 1px solid var(--id-photo-green);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-download:hover:not(:disabled) {
    background: var(--id-photo-green);
    color: white;
}

.btn-download:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.size-info {
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
}