 :root {
      --ink: #172554;
      --muted: #64748b;
      --line: #dbe5f2;
      --surface: #ffffff;
      --surface-soft: #f8fbff;
      --canvas: #eef4ff;
      --accent: #2563eb;
      --accent-deep: #4338ca;
      --success: #059669;
      --shadow: 0 16px 42px rgba(39, 72, 126, .12);
    }

.app-shell {
    width: 100%;
    min-height: calc(100 * min(var(--vh, 1vh), 1vh));
    padding: 28px 16px 42px;
    background:
        radial-gradient(circle at 9% 2%, rgba(147, 197, 253, .58), transparent 28rem),
        radial-gradient(circle at 94% 4%, rgba(199, 210, 254, .78), transparent 29rem),
        var(--canvas);
}

.app-frame {
    max-width: 1180px;
}

.page-hero-title {
    font-weight: 800;
    display: block;
    /* background: linear-gradient(90deg, #6c5ce7, #a866ff); */
    background: linear-gradient(to right, #a3c43a, #a866ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.utility-card {
      border: 1px solid var(--line);
      border-radius: 22px;
      background: var(--surface);
      box-shadow: var(--shadow);
    }



.drop-zone {
    border: 2px dashed var(--dark);
    border-radius: 22px;
    background: linear-gradient(135deg, #f8fbff, #f0f5ff);
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    cursor: pointer;
    transition: .2s ease;
    outline: none;
}

.drop-zone:hover,
.drop-zone:focus-visible,
.drop-zone.drag-active {
    border-color: var(--primary);
    background: #edf4ff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}



.upload-orb {
    width: 66px;
    height: 66px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 21px;
    color: #2563eb;
    background: #dbeafe;
    font-size: 1.65rem;
}

.btn-primary {
    border: 0;
    background: linear-gradient(135deg, var(--primary), var(--primary));
    box-shadow: 0 9px 16px rgba(67, 56, 202, .18);
    color: var(--dark);
    font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(135deg, var(--primary), var(--primary));
}

.btn-soft {
    color: #1d4ed8;
    background: #eaf1ff;
    border: 1px solid #c9dbff;
    font-weight: 600;
}

.btn-soft:hover {
    color: #1e40af;
    background: #dbeafe;
}

.preview-image-wrap,
.canvas-wrap {
    min-height: 250px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        linear-gradient(45deg, #e9eef6 25%, transparent 25%),
        linear-gradient(-45deg, #e9eef6 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e9eef6 75%),
        linear-gradient(-45deg, transparent 75%, #e9eef6 75%);
    background-size: 18px 18px;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

.preview-image-wrap img {
    max-width: 100%;
    max-height: 330px;
    object-fit: contain;
}

.canvas-wrap {
    padding: .75rem;
    position: relative;
    min-height: 360px;
}

.tool-canvas {
    max-width: 100%;
    max-height: 510px;
    width: auto;
    height: auto;
    touch-action: none;
    display: block;
}

#cropCanvas {
    cursor: crosshair;
}

.metadata-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem 0;
    border-bottom: 1px solid var(--line);
    font-size: .88rem;
}

.metadata-row:last-child {
    border-bottom: 0;
}

.metadata-row span:first-child {
    color: var(--muted);
}

.form-label {
    color: #334155;
    font-size: .87rem;
    font-weight: 700;
}

.form-text {
    color: var(--muted);
    font-size: .78rem;
}

.form-control,
.form-select {
    min-height: 46px;
    border-color: #cbd8eb;
    color: var(--ink);
    border-radius: 11px;
}

.form-control:focus,
.form-select:focus {
    border-color: #6e9df6;
    box-shadow: 0 0 0 .25rem rgba(37, 99, 235, .12);
}

.form-range::-webkit-slider-thumb {
    background: #2563eb;
}

.form-range::-moz-range-thumb {
    background: #2563eb;
}

.quality-chip {
    color: #1d4ed8;
    background: #eaf1ff;
    border-radius: 10px;
    padding: .35rem .58rem;
    font-weight: 700;
    min-width: 58px;
    text-align: center;
}

.control-panel {
    padding: 24px;
    height: 100%;
}

.section-heading {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1.15rem;
}

.section-heading i {
    color: var(--accent);
    margin-right: .45rem;
}

.options-note {
    color: var(--muted);
    background: var(--surface-soft);
    border-left: 3px solid #818cf8;
    border-radius: 0 10px 10px 0;
    padding: .7rem .8rem;
    font-size: .78rem;
    line-height: 1.45;
}

.results-section {
    display: none;
}

.results-section.visible {
    display: block;
    animation: rise .35s ease both;
}

.result-stat {
    border-radius: 14px;
    padding: 13px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.result-stat small {
    display: block;
    color: var(--muted);
    font-size: .73rem;
    margin-bottom: .22rem;
}

.result-stat strong {
    font-size: .93rem;
}

.savings-bar {
    height: 10px;
    overflow: hidden;
    background: #e5edf9;
    border-radius: 999px;
}

.savings-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #0ea5e9, #4f46e5);
    transition: width .55s ease;
}

.progress {
    height: 8px;
    border-radius: 999px;
    background: #e5edf9;
}

.progress-bar {
    background: linear-gradient(90deg, #2563eb, #4f46e5);
}

.tool-result {
    display: none;
}

.tool-result.visible {
    display: block;
    animation: rise .35s ease both;
}

.active-transform {
    display: none;
}

.active-transform.visible {
    display: inline-flex;
}

.toast-holder {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 1080;
    max-width: min(390px, calc(100% - 36px));
}

.dark-mode {
    --ink: #e5eefc;
    --muted: #a9bad3;
    --line: #2b3c5c;
    --surface: #12213b;
    --surface-soft: #172944;
    --canvas: #091426;
    --shadow: 0 16px 42px rgba(0, 0, 0, .25);
}

.dark-mode .app-shell {
    background:
        radial-gradient(circle at 9% 2%, rgba(30, 64, 175, .33), transparent 28rem),
        radial-gradient(circle at 94% 4%, rgba(67, 56, 202, .25), transparent 29rem),
        var(--canvas);
}

.dark-mode .drop-zone {
    border-color: #43659c;
    background: linear-gradient(135deg, #10223e, #142547);
}

.dark-mode .drop-zone:hover,
.dark-mode .drop-zone:focus-visible,
.dark-mode .drop-zone.drag-active {
    background: #172d52;
    border-color: #76a3ff;
}

.dark-mode .form-label,
.dark-mode .section-heading {
    color: var(--ink);
}

.dark-mode .form-control,
.dark-mode .form-select {
    color: var(--ink);
    background-color: #0e1b31;
    border-color: #334b72;
}

.dark-mode .form-select {
    background-image: var(--bs-form-select-bg-img);
}

.dark-mode .form-check-input {
    background-color: #0e1b31;
    border-color: #50678c;
}

.dark-mode .theme-toggle {
    color: var(--ink);
    background: #172944;
}

.dark-mode .metadata-row {
    border-color: var(--line);
}

.dark-mode .preview-image-wrap,
.dark-mode .canvas-wrap {
    background-color: #15233b;
    background-image:
        linear-gradient(45deg, #213450 25%, transparent 25%),
        linear-gradient(-45deg, #213450 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #213450 75%),
        linear-gradient(-45deg, transparent 75%, #213450 75%);
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 575.98px) {
    .app-shell {
        padding: 15px 11px 28px;
    }

    .header-card,
    .control-panel {
        padding: 18px;
    }

    .drop-zone {
        min-height: 235px;
        padding: 24px 16px;
    }

    .privacy-pill {
        font-size: .72rem;
    }

    .canvas-wrap {
        min-height: 270px;
        padding: .4rem;
    }

    .tool-tabs .nav-link {
        padding: .65rem .8rem;
        font-size: .86rem;
    }
}


/* =================================
   Common Section Styles
================================= */

.advantages-section,
.how-to-section {
    padding: 90px 0;
}

.advantages-section {
    background: #f8f9fc;
}

.how-to-section {
    background: #ffffff;
}

.section-badge {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 50px;
    background: rgba(108, 92, 231, 0.10);
    color: #6c5ce7;
    font-size: 14px;
    font-weight: 600;
}

.section-title {
    color: #101828;
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.section-description {
    max-width: 650px;
    color: #667085;
    font-size: 17px;
    line-height: 1.7;
}


/* =================================
   Advantages Cards
================================= */

.advantage-card {
    padding: 30px;
    background: #ffffff;
    border: 1px solid #eaecf0;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.advantage-card:hover {
    transform: translateY(-6px);
    border-color: rgba(108, 92, 231, 0.30);
    box-shadow: 0 15px 35px rgba(16, 24, 40, 0.08);
}

.advantage-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;

    border-radius: 12px;

    background: rgba(108, 92, 231, 0.10);
    color: #6c5ce7;

    font-size: 23px;
}

.advantage-card h3 {
    margin-bottom: 10px;
    color: #101828;
    font-size: 20px;
    font-weight: 650;
}

.advantage-card p {
    margin: 0;
    color: #667085;
    font-size: 15px;
    line-height: 1.7;
}


/* =================================
   How To Resize
================================= */

.step-card {
    position: relative;
    padding: 30px 25px;
    text-align: center;

    background: #ffffff;
    border: 1px solid #eaecf0;
    border-radius: 16px;

    transition: all 0.3s ease;
}

.step-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(16, 24, 40, 0.08);
}

.step-number {
    position: absolute;
    top: 15px;
    right: 18px;

    color: #eaecf0;
    font-size: 28px;
    font-weight: 800;
}

.step-icon {
    width: 62px;
    height: 62px;

    margin: 10px auto 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #6c5ce7;
    color: #ffffff;

    font-size: 24px;

    box-shadow: 0 8px 20px rgba(108, 92, 231, 0.25);
}

.step-card h3 {
    margin-bottom: 10px;

    color: #101828;
    font-size: 19px;
    font-weight: 650;
}

.step-card p {
    margin: 0;

    color: #667085;
    font-size: 15px;
    line-height: 1.7;
}


/* =================================
   Responsive
================================= */

@media (max-width: 767px) {

    .advantages-section,
    .how-to-section {
        padding: 65px 0;
    }

    .section-title {
        font-size: 29px;
    }

    .section-description {
        font-size: 16px;
    }

    .advantage-card {
        padding: 25px;
    }

}
