/* Fotodocolite — редактор фото для документов */

.foto-editor-section {
    padding: 80px 0 100px;
    background: rgba(0, 0, 0, 0.25);
}

.foto-editor-title {
    text-align: center;
    margin-bottom: 40px;
}

.foto-editor-title h2 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 12px;
}

.foto-editor-title p {
    color: var(--vt-gray);
    font-size: 18px;
}

.foto-privacy-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 18px;
    background: rgba(115, 186, 104, 0.12);
    border: 1px solid rgba(115, 186, 104, 0.35);
    border-radius: 999px;
    font-size: 14px;
    color: var(--vt-light-green);
}

.foto-editor-shell {
    display: grid;
    grid-template-columns: 320px 1fr 340px;
    gap: 24px;
    align-items: start;
}

.foto-panel {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.foto-panel-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--vt-theme);
    margin-bottom: 16px;
}

.foto-form-group {
    margin-bottom: 16px;
}

.foto-form-group:last-child {
    margin-bottom: 0;
}

.foto-form-label {
    display: block;
    font-size: 13px;
    color: var(--vt-gray);
    margin-bottom: 8px;
}

.foto-form-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.foto-input,
.foto-select {
    width: 100%;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-family: inherit;
}

.foto-input:focus,
.foto-select:focus {
    outline: none;
    border-color: var(--vt-theme);
}

.foto-input-sm {
    width: 80px;
    flex-shrink: 0;
}

.foto-preset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.foto-preset-btn {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.foto-preset-btn:hover {
    background: rgba(var(--vt-theme-rgb), 0.15);
    border-color: rgba(var(--vt-theme-rgb), 0.4);
}

.foto-preset-btn.active {
    background: rgba(var(--vt-theme-rgb), 0.25);
    border-color: var(--vt-theme);
    color: var(--vt-theme-light);
}

.foto-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.foto-slider-row:last-child {
    margin-bottom: 0;
}

.foto-slider-label {
    flex: 0 0 90px;
    font-size: 13px;
    color: var(--vt-gray);
}

.foto-slider {
    flex: 1;
    accent-color: var(--vt-theme);
    height: 6px;
}

.foto-slider-value {
    flex: 0 0 40px;
    text-align: right;
    font-size: 12px;
    color: var(--vt-gray);
}

.foto-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.foto-btn-sm {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.foto-btn-sm:hover {
    background: rgba(var(--vt-theme-rgb), 0.2);
    border-color: var(--vt-theme);
}

.foto-upload-zone {
    border: 2px dashed rgba(var(--vt-theme-rgb), 0.45);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.foto-upload-zone:hover,
.foto-upload-zone.dragover {
    background: rgba(var(--vt-theme-rgb), 0.08);
    border-color: var(--vt-theme);
}

.foto-upload-zone svg {
    color: var(--vt-theme);
    margin-bottom: 8px;
}

.foto-upload-zone p {
    font-size: 14px;
    color: var(--vt-gray);
    margin: 0;
}

.foto-upload-zone input {
    display: none;
}

/* Центральная область редактора */
.foto-workspace {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.foto-crop-area {
    position: relative;
    background: #1a1a1b;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.foto-crop-area.empty {
    background: repeating-conic-gradient(rgba(255,255,255,0.03) 0% 25%, transparent 0% 50%) 50% / 20px 20px;
}

.foto-crop-placeholder {
    text-align: center;
    color: var(--vt-gray);
    padding: 40px;
}

.foto-crop-placeholder svg {
    opacity: 0.4;
    margin-bottom: 16px;
}

.foto-crop-viewport {
    position: relative;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.65);
    background: white;
    cursor: grab;
    overflow: hidden;
}

.foto-crop-viewport:active {
    cursor: grabbing;
}

.foto-crop-viewport canvas {
    display: block;
    pointer-events: none;
}

.foto-crop-guides {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    --guide-crown-min: 6%;
    --guide-crown-ideal: 8%;
    --guide-crown-max: 10%;
    --guide-chin-min: 78%;
    --guide-chin-max: 88%;
    --guide-head-top: 8%;
    --guide-head-bottom: 88%;
}

.foto-guide-v {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 0;
    transform: translateX(-50%);
    border-left: 1px solid rgba(var(--vt-theme-rgb), 0.28);
}

.foto-guide-h {
    position: absolute;
    left: 0;
    right: 0;
    height: 0;
    border-top: 1px solid transparent;
}

.foto-guide-h span {
    position: absolute;
    right: 4px;
    top: -9px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(var(--vt-theme-rgb), 0.85);
    background: rgba(255, 255, 255, 0.92);
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1.2;
    white-space: nowrap;
}

/* Макушка (зелёная) */
.foto-guide-crown-min {
    top: var(--guide-crown-min);
    border-top-color: rgba(115, 186, 104, 0.3);
    border-top-style: dashed;
}

.foto-guide-crown-ideal {
    top: var(--guide-crown-ideal);
    border-top-color: rgba(115, 186, 104, 0.85);
    border-top-width: 1px;
}

.foto-guide-crown-ideal span {
    color: #2f7d22;
}

.foto-guide-crown-max {
    top: var(--guide-crown-max);
    border-top-color: rgba(115, 186, 104, 0.3);
    border-top-style: dashed;
}

/* Зона подбородка: голова 70–80% (оранжевая) */
.foto-guide-band {
    position: absolute;
    left: 0;
    right: 0;
}

.foto-guide-band.foto-guide-chin-band {
    top: var(--guide-chin-min);
    height: calc(var(--guide-chin-max) - var(--guide-chin-min));
    background: rgba(250, 127, 2, 0.06);
    border-top: 1px dashed rgba(250, 127, 2, 0.35);
}

.foto-guide-chin-min {
    top: var(--guide-chin-min);
    border-top-color: rgba(250, 127, 2, 0.4);
    border-top-style: dashed;
}

.foto-guide-chin-min span {
    color: #c86500;
}

.foto-guide-chin-max {
    top: var(--guide-chin-max);
    border-top-color: rgba(250, 127, 2, 0.85);
    border-top-width: 1px;
}

.foto-guide-chin-max span {
    color: #c86500;
}

/* Вертикальные границы зоны головы */
.foto-guide-zone.foto-guide-head-zone {
    position: absolute;
    left: 12%;
    right: 12%;
    top: var(--guide-head-top);
    height: calc(var(--guide-head-bottom) - var(--guide-head-top));
    border-left: 1px dashed rgba(115, 186, 104, 0.12);
    border-right: 1px dashed rgba(115, 186, 104, 0.12);
    pointer-events: none;
}

.foto-preset-doc {
    display: block;
    font-size: 10px;
    font-weight: 500;
    opacity: 0.65;
    line-height: 1.1;
}

.foto-guides-legend {
    text-align: center;
    font-size: 12px;
    color: var(--vt-gray);
    line-height: 1.5;
    margin: 0;
    padding: 0 12px;
}

.foto-crop-frame {
    position: absolute;
    inset: 0;
    border: 2px solid var(--vt-theme);
    pointer-events: none;
    z-index: 3;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.3);
}

.foto-crop-size-label {
    position: absolute;
    bottom: -28px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--vt-gray);
    white-space: nowrap;
}

.foto-preview-thumb {
    text-align: center;
}

.foto-preview-thumb canvas {
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 4px;
    background: white;
    max-width: 100%;
    height: auto;
}

.foto-preview-thumb-label {
    font-size: 12px;
    color: var(--vt-gray);
    margin-top: 8px;
}

/* Предпросмотр листа */
.foto-sheet-preview-wrap {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 12px;
    padding: 16px;
    overflow: auto;
    max-height: 320px;
}

.foto-sheet-preview {
    margin: 0 auto;
    background: white;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    position: relative;
}

.foto-sheet-preview .foto-sheet-cell {
    position: absolute;
    overflow: hidden;
    box-sizing: border-box;
    background: white;
}

.foto-sheet-preview .foto-sheet-cell img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.foto-sheet-preview.cut-lines .foto-sheet-cell {
    outline: 0.3mm dashed rgba(0,0,0,0.25);
}

.foto-sheet-preview .foto-sheet-cell.has-border {
    border: var(--foto-border-mm, 0mm) solid white;
    box-sizing: border-box;
}

.foto-sheet-info {
    margin-top: 12px;
    font-size: 13px;
    color: var(--vt-gray);
    line-height: 1.5;
}

.foto-sheet-info strong {
    color: var(--vt-light-green);
}

.foto-print-hint {
    margin-top: 16px;
    padding: 14px 16px;
    background: rgba(250, 127, 2, 0.1);
    border: 1px solid rgba(250, 127, 2, 0.3);
    border-radius: 10px;
    font-size: 13px;
    color: rgba(255,255,255,0.85);
    line-height: 1.5;
}

.foto-print-hint strong {
    color: var(--vt-accent-light);
}

.foto-actions-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.foto-copy-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.foto-copy-btn {
    padding: 10px 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.foto-copy-btn:hover {
    background: rgba(var(--vt-theme-rgb), 0.15);
    border-color: rgba(var(--vt-theme-rgb), 0.4);
}

.foto-copy-btn.active {
    background: rgba(var(--vt-theme-rgb), 0.25);
    border-color: var(--vt-theme);
    color: var(--vt-theme-light);
}

.foto-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 14px;
    cursor: pointer;
}

.foto-checkbox-row input {
    accent-color: var(--vt-theme);
    width: 18px;
    height: 18px;
}

#foto-print-container {
    position: absolute;
    left: -9999px;
    top: 0;
    visibility: hidden;
}

@media (max-width: 1100px) {
    .foto-editor-shell {
        grid-template-columns: 1fr;
    }

    .foto-crop-area {
        min-height: 360px;
    }
}

@media (max-width: 600px) {
    .foto-preset-grid {
        grid-template-columns: 1fr;
    }

    .foto-editor-title h2 {
        font-size: 32px;
    }
}

@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    @page {
        margin: 0;
    }

    body {
        visibility: hidden !important;
        background: white !important;
    }

    #foto-print-container.foto-print-active {
        visibility: visible !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        z-index: 99999 !important;
    }

    #foto-print-container.foto-print-active * {
        visibility: visible !important;
    }

    .foto-print-page {
        page-break-after: always;
        break-after: page;
        background: white !important;
        box-sizing: border-box;
        position: relative;
        overflow: hidden;
    }

    .foto-print-page:last-child {
        page-break-after: auto;
        break-after: auto;
    }

    .foto-print-cell {
        position: absolute;
        overflow: hidden;
        box-sizing: border-box;
        background: white;
    }

    .foto-print-cell img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

    .foto-print-cut-lines .foto-print-cell {
        outline: 0.3mm dashed rgba(0,0,0,0.3);
    }

    header,
    footer,
    .hero,
    .section,
    .foto-editor-section,
    nav {
        display: none !important;
    }
}
