
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f7fbff;
    color: #102a56;
    line-height: 1.6;
}

button,
input {
    font-family: inherit;
}

button {
    cursor: pointer;
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}


/* =========================
   HEADER
========================= */

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e5edf7;
    height: 88px;
}

.header-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.brand {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.brand-logo-svg {
    width: 180px;
    height: 52px;
    display: block;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 24px;
    flex-wrap: wrap;
}

.nav-link {
    color: #526987;
    font-size: 14px;
    font-weight: 600;
    transition: 0.2s ease;
}

.nav-link:hover {
    color: #146ee9;
}

.nav-link.active {
    color: #146ee9;
}


/* =========================
   HERO
========================= */

.tool-hero {
    text-align: center;
    padding: 70px 0 55px;
    background:
        radial-gradient(
            circle at top left,
            rgba(37, 99, 235, 0.12),
            transparent 35%
        ),
        radial-gradient(
            circle at top right,
            rgba(6, 182, 212, 0.10),
            transparent 35%
        ),
        #f7fbff;
}

.eyebrow {
    display: inline-block;
    color: #146ee9;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.8px;
    margin-bottom: 12px;
}

.tool-hero h1 {
    font-size: clamp(34px, 5vw, 52px);
    line-height: 1.1;
    margin-bottom: 16px;
    color: #102a56;
}

.tool-hero p {
    color: #607694;
    font-size: 17px;
}


/* =========================
   TOOL SECTION
========================= */

.tool-section {
    padding: 20px 0 90px;
}


/* =========================
   UPLOAD CARD
========================= */

.upload-card {
    background: #ffffff;
    border: 2px dashed #bdd8f8;
    border-radius: 22px;
    padding: 55px 30px;
    text-align: center;
    max-width: 850px;
    margin: 0 auto;
    transition: 0.2s ease;
}

.upload-card:hover {
    border-color: #146ee9;
}

.upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef6ff;
    color: #146ee9;
    font-size: 34px;
    font-weight: 700;
}

.upload-card h2 {
    font-size: 24px;
    color: #102a56;
    margin-bottom: 8px;
}

.upload-card p {
    color: #6a7f9c;
    font-size: 15px;
}

.upload-or {
    color: #9aaabd;
    margin: 16px 0;
    font-size: 14px;
}

.choose-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 24px;
    border-radius: 10px;
    background: #146ee9;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.choose-btn:hover {
    background: #0d5dcc;
    transform: translateY(-1px);
}

.upload-info {
    margin-top: 18px;
    color: #8a9ab0;
    font-size: 12px;
}


/* =========================
   EDITOR
========================= */

.editor {
    display: none;
    max-width: 1100px;
    margin: 0 auto;
}

.editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
    gap: 24px;
}


/* =========================
   PREVIEW CARD
========================= */

.preview-card,
.controls-card {
    background: #ffffff;
    border: 1px solid #e1ebf6;
    border-radius: 20px;
    box-shadow: 0 12px 35px rgba(25, 70, 120, 0.07);
}

.preview-card {
    padding: 20px;
}

.preview-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 15px;
    font-weight: 700;
    color: #102a56;
}

.preview-badge {
    padding: 5px 10px;
    border-radius: 20px;
    background: #eef6ff;
    color: #146ee9;
    font-size: 11px;
    font-weight: 700;
}

.preview-area {
    min-height: 430px;
    background:
        linear-gradient(45deg, #f0f4f8 25%, transparent 25%),
        linear-gradient(-45deg, #f0f4f8 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #f0f4f8 75%),
        linear-gradient(-45deg, transparent 75%, #f0f4f8 75%);
    background-size: 28px 28px;
    background-position: 0 0, 0 14px, 14px -14px, -14px 0;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#imagePreview {
    max-width: 90%;
    max-height: 400px;
    display: block;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.image-info {
    margin-top: 14px;
    color: #73869f;
    font-size: 12px;
    text-align: center;
}


/* =========================
   CONTROLS CARD
========================= */

.controls-card {
    padding: 24px;
}

.control-group {
    padding-bottom: 22px;
    margin-bottom: 22px;
    border-bottom: 1px solid #edf2f7;
}

.control-group:last-of-type {
    border-bottom: none;
}

.control-title {
    font-size: 14px;
    font-weight: 800;
    color: #102a56;
    margin-bottom: 12px;
}

.button-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.control-btn {
    flex: 1;
    min-width: 130px;
    border: 1px solid #d7e4f2;
    background: #ffffff;
    color: #24476f;
    border-radius: 10px;
    padding: 11px 12px;
    font-size: 13px;
    font-weight: 700;
    transition: 0.2s ease;
}

.control-btn:hover {
    border-color: #146ee9;
    color: #146ee9;
    background: #f7fbff;
}

.primary-btn {
    background: #146ee9;
    border-color: #146ee9;
    color: #ffffff;
}

.primary-btn:hover {
    background: #0d5dcc;
    color: #ffffff;
}

.secondary-btn {
    background: #f6f9fc;
}

.choose-another-btn,
.download-btn {
    flex: 1;
    min-width: 150px;
    padding: 12px 14px;
    border-radius: 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    transition: 0.2s ease;
}

.choose-another-btn {
    border: 1px solid #d7e4f2;
    background: #ffffff;
    color: #24476f;
}

.choose-another-btn:hover {
    border-color: #146ee9;
    color: #146ee9;
}

.download-btn {
    background: #102a56;
    color: #ffffff;
    border: 1px solid #102a56;
}

.download-btn:hover {
    background: #173c73;
}

.download-btn.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.bottom-actions {
    margin-top: 5px;
}

.result {
    min-height: 22px;
    margin-top: 15px;
    text-align: center;
    color: #146ee9;
    font-size: 13px;
    font-weight: 600;
}


/* =========================
   FOOTER
========================= */

.site-footer {
    background: #102a56;
    color: #b8c8dc;
    padding: 28px 0;
    text-align: center;
    font-size: 13px;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 900px) {

    .header-inner {
        gap: 15px;
    }

    .main-nav {
        gap: 14px;
    }

    .editor-grid {
        grid-template-columns: 1fr;
    }

    .preview-area {
        min-height: 380px;
    }
}


@media (max-width: 700px) {

    .site-header {
        height: auto;
    }

    .header-inner {
        padding: 14px 0;
        flex-direction: column;
    }

    .brand-logo-svg {
        width: 180px;
        height: 52px;
    }

    .main-nav {
        justify-content: center;
        gap: 12px 18px;
    }

    .tool-hero {
        padding: 50px 0 40px;
    }

    .tool-section {
        padding-bottom: 60px;
    }

    .upload-card {
        padding: 40px 20px;
    }

    .preview-area {
        min-height: 320px;
    }
}


@media (max-width: 450px) {

    .container {
        width: min(100% - 24px, 1180px);
    }

    .brand-logo-svg {
        width: 180px;
        height: 52px;
    }

    .main-nav {
        gap: 10px 14px;
    }

    .nav-link {
        font-size: 12px;
    }

    .tool-hero h1 {
        font-size: 34px;
    }

    .tool-hero p {
        font-size: 15px;
    }

    .upload-card h2 {
        font-size: 21px;
    }

    .preview-card,
    .controls-card {
        padding: 16px;
        border-radius: 16px;
    }

    .preview-area {
        min-height: 260px;
    }

    #imagePreview {
        max-height: 240px;
    }

    .button-row {
        flex-direction: column;
    }

    .control-btn,
    .choose-another-btn,
    .download-btn {
        width: 100%;
    }

}