/*==============================
  Go Direct — Адаптер изображений
===============================*/

.gd-image-format {
    position: relative;
    overflow: visible;
    margin-top: 20px;
    padding: 60px 20px;
    background: radial-gradient(
        circle at top left,
        #035867 0%,
        #02333C 55%
    );
    font-family: 'Roboto', sans-serif;
    color: #B8D2D7;
    box-sizing: border-box;
}

.gd-image-format *,
.gd-image-format *::before,
.gd-image-format *::after {
    box-sizing: border-box;
}

.gd-image-format__container {
    position: relative;
    max-width: 1400px;
    margin: auto;
    padding: 60px;
    background: rgba(5, 54, 63, 0.92);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 30px;
    backdrop-filter: blur(12px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

/*==============================
  Заголовок
===============================*/

.gd-image-format__header {
    text-align: center;
    margin-bottom: 40px;
}

.gd-image-format__header h2 {
    margin: 0 0 20px;
    color: #B7D4DA;
    font-size: 30px;
    line-height: 1.1;
}

.gd-image-format__header p {
    margin: 0 auto;
    max-width: 1200px;
    color: #B7D4DA;
    font-size: 20px;
    line-height: 1.5;
}

/*==============================
  Загрузка
===============================*/

.gd-image-format__upload {
    position: relative;
    padding: 45px 30px;
    border: 1px dashed rgba(56,153,167,0.65);
    border-radius: 22px;
    background: rgba(2,42,49,0.75);
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
}

.gd-image-format__upload:hover,
.gd-image-format__upload.is-dragover {
    border-color: #3899A7;
    background: rgba(56,153,167,0.12);
    transform: translateY(-2px);
}

.gd-image-format__upload input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.gd-image-format__upload-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: rgba(56,153,167,0.18);
    color: #8ED6E0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.gd-image-format__upload-title {
    color: #FFFFFF;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.gd-image-format__upload-text {
    color: #B8D2D7;
    font-size: 16px;
}

.gd-image-format__upload-format {
    margin-top: 10px;
    color: #7EA1A8;
    font-size: 14px;
}

/*==============================
  Рабочая область
===============================*/

.gd-image-format__workspace {
    display: none;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 20px;
    margin-top: 40px;
}

.gd-image-format__workspace.is-visible {
    display: grid;
}

/*==============================
  Карточки
===============================*/

.gd-image-format__preview,
.gd-image-format__controls {
    padding: 30px;
    border-radius: 22px;
    background: rgba(2,42,49,0.9);
    border: 1px solid rgba(255,255,255,0.05);
    box-sizing: border-box;
}

.gd-image-format__preview-label {
    margin-bottom: 18px;
    color: #FFFFFF;
    font-size: 20px;
    font-weight: 600;
}

/*==============================
  Canvas
===============================*/

.gd-image-format__canvas-wrap {
    position: relative;
    min-height: 400px;
    padding: 20px;
    border-radius: 18px;
    background: radial-gradient(
        circle at center,
        #035867 0%,
        #022A31 70%
    );
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
}

.gd-image-format__canvas-wrap canvas {
    display: block;
    max-width: 100%;
    max-height: 650px;
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
    cursor: grab;
    touch-action: none;
}

.gd-image-format__canvas-wrap canvas.is-dragging {
    cursor: grabbing;
}

.gd-image-format__preview-hint {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    padding: 7px 12px;
    border-radius: 9px;
    background: rgba(2,42,49,0.75);
    color: rgba(255,255,255,0.72);
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s;
}

.gd-image-format__canvas-wrap:hover
.gd-image-format__preview-hint {
    opacity: 1;
}

.gd-image-format__image-info {
    margin-top: 14px;
    color: #7EA1A8;
    font-size: 13px;
    text-align: center;
}

/*==============================
  Управление
===============================*/

.gd-image-format__control {
    margin-bottom: 25px;
}

.gd-image-format__control > label {
    display: block;
    margin-bottom: 10px;
    color: #8ED6E0;
    font-size: 15px;
    font-weight: 600;
}

.gd-image-format__control select,
.gd-image-format__control input[type="text"],
.gd-image-format__control textarea,
.gd-image-format__control input[type="file"] {
    width: 100%;
    border: 1px solid #3899A7;
    border-radius: 14px;
    background: #022A31;
    color: #FFFFFF;
    font-size: 16px;
    outline: none;
}

.gd-image-format__control select,
.gd-image-format__control input[type="text"] {
    min-height: 50px;
    padding: 0 16px;
}

.gd-image-format__control textarea {
    min-height: 90px;
    padding: 13px 16px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.45;
}

.gd-image-format__control input[type="file"] {
    padding: 12px;
    font-size: 14px;
}

.gd-image-format__control select:focus,
.gd-image-format__control input[type="text"]:focus,
.gd-image-format__control textarea:focus {
    border-color: #6DD5E3;
}

/*==============================
  Размер
===============================*/

.gd-image-format__size-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
}

.gd-image-format__size-row input {
    width: 100%;
    min-height: 50px;
    padding: 0 14px;
    border: 1px solid #3899A7;
    border-radius: 14px;
    background: #022A31;
    color: #FFFFFF;
    font-size: 16px;
    outline: none;
}

.gd-image-format__size-row span {
    color: #7EA1A8;
    font-size: 18px;
}

/*==============================
  Ползунки
===============================*/

.gd-image-format input[type="range"] {
    width: 100%;
    margin: 5px 0 0;
    accent-color: #3899A7;
    cursor: pointer;
}

/*==============================
  Чекбоксы
===============================*/

.gd-image-format__checkbox {
    display: flex !important;
    align-items: center;
    gap: 9px;
    margin-top: 12px !important;
    margin-bottom: 0 !important;
    color: #B8D2D7 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    cursor: pointer;
}

.gd-image-format__checkbox input {
    width: 17px;
    height: 17px;
    accent-color: #3899A7;
}

/*==============================
  Кнопки
===============================*/

.gd-image-format__buttons,
.gd-image-format__mode-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gd-image-format__option,
.gd-image-format__mode {
    padding: 10px 15px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    color: #B8D2D7;
    font-size: 14px;
    cursor: pointer;
    transition: 0.3s;
}

.gd-image-format__option:hover,
.gd-image-format__mode:hover {
    background: rgba(56,153,167,0.18);
    border-color: #3899A7;
    color: #FFFFFF;
}

.gd-image-format__option.is-active,
.gd-image-format__mode.is-active {
    background: rgba(56,153,167,0.25);
    border-color: #3899A7;
    color: #FFFFFF;
}

.gd-image-format__small-button {
    width: 100%;
    min-height: 42px;
    margin-top: 12px;
    padding: 0 15px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 11px;
    background: rgba(255,255,255,0.04);
    color: #B8D2D7;
    cursor: pointer;
}

.gd-image-format__small-button:hover {
    border-color: #3899A7;
    color: #FFFFFF;
}

/*==============================
  Разделы
===============================*/

.gd-image-format__section {
    margin: 30px 0;
    padding: 22px;
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 18px;
    background: rgba(0,0,0,0.10);
}

.gd-image-format__section-title {
    margin-bottom: 22px;
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 700;
}

.gd-image-format__section
.gd-image-format__control:last-child {
    margin-bottom: 0;
}

.gd-image-format__hidden {
    display: none !important;
}

/*==============================
  Цвет
===============================*/

.gd-image-format__color-control {
    display: none;
}

.gd-image-format__color-control.is-visible {
    display: block;
}

.gd-image-format__color-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gd-image-format__color-row input[type="color"] {
    width: 52px;
    height: 42px;
    padding: 3px;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    background: #022A31;
    cursor: pointer;
}

.gd-image-format__color-row span {
    color: #B8D2D7;
    font-size: 14px;
}

/*==============================
  Скачать
===============================*/

.gd-image-format__download {
    width: 100%;
    min-height: 58px;
    margin-top: 10px;
    padding: 0 24px;
    border: none;
    border-radius: 14px;
    background: #F7575C;
    color: #FFFFFF;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 10px 30px rgba(247,87,92,0.25);
}

.gd-image-format__download:hover {
    transform: translateY(-3px);
    background: #ff6c70;
}

/*==============================
  Сброс
===============================*/

.gd-image-format__reset {
    width: 100%;
    min-height: 48px;
    margin-top: 12px;
    padding: 0 20px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    color: #B8D2D7;
    font-size: 15px;
    cursor: pointer;
    transition: 0.3s;
}

.gd-image-format__reset:hover {
    background: rgba(56,153,167,0.18);
    border-color: #3899A7;
    color: #FFFFFF;
}

/*==============================
  Сообщения
===============================*/

.gd-image-format__message {
    margin-top: 20px;
    color: #FF9DA0;
    font-size: 14px;
    text-align: center;
}

/*==============================
  Предпросмотр на компьютере
===============================*/

@media (min-width: 901px) {

    .gd-image-format__preview {
        position: relative;
        align-self: start;
    }

}

/*==============================
  Планшеты
===============================*/

@media (max-width: 900px) {

    .gd-image-format {
        padding: 40px 15px;
    }

    .gd-image-format__container {
        padding: 35px 25px;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .gd-image-format__workspace {
        grid-template-columns: 1fr;
        padding-top: 300px;
    }

    .gd-image-format__header h2 {
        font-size: 28px;
    }

    .gd-image-format__header p {
        font-size: 18px;
    }

    .gd-image-format__preview-hint {
        display: none;
    }

    .gd-image-format__preview {
        position: fixed;
        top: 15px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 30px);
        max-width: 860px;
        z-index: 100;
        padding: 14px;
        background: rgba(2,42,49,0.97);
        border: 1px solid rgba(255,255,255,0.12);
        border-radius: 18px;
        box-shadow: 0 10px 35px rgba(0,0,0,0.35);
    }

    .gd-image-format__canvas-wrap {
        min-height: 180px;
        max-height: 55vh;
    }

    .gd-image-format__canvas-wrap canvas {
        max-height: calc(55vh - 40px);
    }

}

/*==============================
  Телефоны
===============================*/

@media (max-width: 480px) {

    .gd-image-format {
        padding: 25px 10px;
    }

    .gd-image-format__container {
        padding: 25px 15px;
        border-radius: 22px;
    }

    .gd-image-format__header {
        margin-bottom: 30px;
    }

    .gd-image-format__header h2 {
        font-size: 25px;
    }

    .gd-image-format__header p {
        font-size: 16px;
    }

    .gd-image-format__upload {
        padding: 35px 20px;
    }

    .gd-image-format__preview,
    .gd-image-format__controls {
        padding: 20px;
    }

    .gd-image-format__workspace {
        padding-top: 250px;
    }

    .gd-image-format__preview {
        top: 8px;
        width: calc(100% - 20px);
        padding: 12px;
        border-radius: 16px;
        background: rgba(2,42,49,0.97);
    }

    .gd-image-format__preview-label {
        margin-bottom: 8px;
        font-size: 16px;
    }

    .gd-image-format__canvas-wrap {
        min-height: 160px;
        max-height: 36vh;
        padding: 6px;
    }

    .gd-image-format__canvas-wrap canvas {
        max-height: calc(36vh - 12px);
    }

    .gd-image-format__image-info {
        margin-top: 6px;
        font-size: 11px;
    }

    .gd-image-format__buttons {
        gap: 6px;
    }

    .gd-image-format__option,
    .gd-image-format__mode {
        font-size: 13px;
        padding: 9px 12px;
    }

    .gd-image-format__section {
        padding: 17px;
    }

}

/*==============================
  Донаты
===============================*/

.gd-image-format__donate {
    margin-top: 24px;
    padding: 18px 20px;
    border: 1px solid #B8D2D7;
    border-radius: 12px;
    background: #FFF9D9;
}

.gd-image-format__donate-text {
    margin-bottom: 12px;
    color: #02333C;
    font-size: 15px;
    line-height: 1.5;
}

.gd-image-format__donate-card {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.gd-image-format__donate-label {
    color: #035867;
    font-size: 14px;
}

.gd-image-format__donate-number {
    color: #02333C;
    font-size: 16px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.gd-image-format__donate-copy {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 7px 14px;
    border: 1px solid #077A86;
    border-radius: 8px;
    background: #077A86;
    color: #fff;
    font: inherit;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.gd-image-format__donate-copy:hover {
    background: #077A86;
    border-color: #077A86;
}

.gd-image-format__donate-copy.is-copied {
    background: #077A86;
    border-color: #077A86;
}

.gd-image-format__donate-message {
    min-height: 20px;
    margin-top: 7px;
    color: #077A86;
    font-size: 13px;
    line-height: 1.4;
}

@media (max-width: 600px) {

    .gd-image-format__donate-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .gd-image-format__donate-number {
        font-size: 15px;
    }

    .gd-image-format__donate-copy {
        width: 100%;
    }

}