/* =========================================================
   MERGE PDF
   ========================================================= */

/* =========================================================
   PAGE
========================================================= */

.merge-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 45px 20px 80px;
    color: #111827;
}


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

.merge-hero {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 32px;
}

.merge-hero h1 {
    margin: 0 0 12px;
    font-size: 42px;
    line-height: 1.15;
    font-weight: 750;
    letter-spacing: -0.8px;
    color: #111827;
}

.merge-hero p {
    max-width: 720px;
    margin: 0 auto;
    font-size: 16px;
    line-height: 1.7;
    color: #6b7280;
}


/* =========================================================
   MAIN TOOL
========================================================= */

.merge-tool {
    max-width: 900px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.07);
    overflow: hidden;
}

.merge-tool-header {
    padding: 27px 30px 21px;
    border-bottom: 1px solid #eef2f7;
}

.merge-tool-header h2 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: #111827;
}

.merge-tool-header p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
    line-height: 1.6;
}


/* =========================================================
   FORM
========================================================= */

#mergeForm {
    width: 100%;
}


/* =========================================================
   HIDDEN FILE INPUT
========================================================= */

#pdfInput {
    display: none;
}


/* =========================================================
   UPLOAD AREA
========================================================= */

.drop-zone {
    margin: 22px 30px 16px;
    min-height: 220px;
    border: 2px dashed #cbd5e1;
    border-radius: 15px;
    background: #f8fafc;

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

    text-align: center;
    cursor: pointer;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: #2563eb;
    background: #eff6ff;
}

.drop-zone.dragover {
    transform: scale(1.005);
}

.upload-icon {
    width: 62px;
    height: 72px;
    margin-bottom: 15px;

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

    border-radius: 10px;
    background: #fee2e2;
    color: #dc2626;

    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.3px;

    box-shadow: 0 5px 15px rgba(220, 38, 38, 0.10);
}

.drop-zone h3 {
    margin: 0 0 7px;
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.drop-zone p {
    margin: 0 0 13px;
    color: #6b7280;
    font-size: 14px;
}

.choose-files-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 18px;
    border-radius: 8px;

    background: #2563eb;
    color: #ffffff;

    font-size: 14px;
    font-weight: 650;

    pointer-events: none;
}


/* =========================================================
   UPLOAD LIMITS
========================================================= */

.upload-limits {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;

    margin: 0 30px 22px;
}

.limit-item {
    display: inline-flex;
    align-items: center;

    padding: 7px 11px;

    border-radius: 7px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;

    color: #64748b;
    font-size: 12px;
}


/* =========================================================
   SELECTED FILES
========================================================= */

.file-list {
    display: none;
    padding: 0 30px 5px;
}

.file-list-title {
    display: flex;
    justify-content: space-between;
    align-items: center;

    margin-bottom: 11px;

    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}

.file-list-hint {
    font-size: 12px;
    font-weight: 400;
    color: #94a3b8;
}

#fileItems {
    display: flex;
    flex-direction: column;
    gap: 8px;
}


/* =========================================================
   FILE ITEM
========================================================= */

.file-item {
    display: grid;
    grid-template-columns: 30px 50px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 12px;

    padding: 10px 12px;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 11px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.file-item:hover {
    border-color: #bfdbfe;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05);
}

.file-item.dragging {
    opacity: 0.55;
    border-color: #2563eb;
    background: #eff6ff;
}

.file-item.drag-over {
    border-color: #2563eb;
    background: #eff6ff;
}


/* =========================================================
   DRAG HANDLE
========================================================= */

.drag-handle {
    color: #94a3b8;
    font-size: 17px;
    cursor: grab;
    user-select: none;
    text-align: center;
}

.drag-handle:active {
    cursor: grabbing;
}


/* =========================================================
   FILE NUMBER
========================================================= */

.file-number {
    width: 28px;
    height: 28px;

    border-radius: 50%;

    background: #eff6ff;
    color: #2563eb;

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

    font-size: 12px;
    font-weight: 700;
}


/* =========================================================
   PDF THUMBNAIL
========================================================= */

.pdf-thumbnail {
    width: 50px;
    height: 60px;

    border-radius: 7px;

    background: #fef2f2;
    border: 1px solid #fecaca;

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

    color: #dc2626;

    overflow: hidden;
}

.pdf-thumbnail-label {
    font-size: 11px;
    font-weight: 800;
}

.pdf-thumbnail-fold {
    margin-top: 3px;
    font-size: 9px;
    color: #ef4444;
}


/* =========================================================
   FILE INFO
========================================================= */

.file-info {
    min-width: 0;
}

.file-name {
    margin-bottom: 3px;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    color: #374151;
    font-size: 14px;
    font-weight: 600;
}

.file-meta {
    color: #94a3b8;
    font-size: 12px;
}


/* =========================================================
   REMOVE BUTTON
========================================================= */

.remove-file {
    width: 30px;
    height: 30px;

    border: none;
    border-radius: 7px;

    background: transparent;
    color: #94a3b8;

    cursor: pointer;

    font-size: 20px;
    line-height: 1;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.remove-file:hover {
    background: #fef2f2;
    color: #dc2626;
}


/* =========================================================
   ACTION AREA
========================================================= */

.merge-actions {
    padding: 18px 30px 25px;
}

.merge-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.add-more-btn {
    display: none;

    padding: 12px 18px;

    border: 1px solid #dbeafe;
    border-radius: 9px;

    background: #eff6ff;
    color: #2563eb;

    font-size: 14px;
    font-weight: 650;

    cursor: pointer;
}

.add-more-btn:hover {
    background: #dbeafe;
}


/* =========================================================
   MERGE BUTTON
========================================================= */

.merge-button {
    width: 100%;

    padding: 14px 20px;

    border: none;
    border-radius: 9px;

    background: #2563eb;
    color: #ffffff;

    font-size: 16px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.1s ease;
}

.merge-button:hover:not(:disabled) {
    background: #1d4ed8;
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.22);
}

.merge-button:active:not(:disabled) {
    transform: translateY(1px);
}

.merge-button:disabled {
    background: #94a3b8;
    cursor: not-allowed;
}


/* =========================================================
   PRIVACY NOTE
========================================================= */

.privacy-note {
    margin-top: 13px;

    text-align: center;

    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.privacy-note strong {
    color: #374151;
}


/* =========================================================
   ERROR
========================================================= */

.error-box {
    display: none;

    margin: 0 30px 20px;
    padding: 13px 15px;

    border-radius: 9px;

    background: #fef2f2;
    border: 1px solid #fecaca;

    color: #b91c1c;

    font-size: 13px;
    line-height: 1.5;
}


/* =========================================================
   STATUS / PROGRESS
========================================================= */

.status-box {
    display: none;

    margin: 0 30px 22px;
    padding: 17px;

    border-radius: 11px;

    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.status-text {
    margin-bottom: 10px;

    text-align: center;

    color: #374151;
    font-size: 13px;
    font-weight: 600;
}

.progress-container {
    width: 100%;
    height: 9px;

    overflow: hidden;

    background: #e5e7eb;
    border-radius: 999px;
}

.progress-bar {
    width: 0%;
    height: 100%;

    background: #2563eb;
    border-radius: 999px;

    transition: width 0.35s ease;
}


/* =========================================================
   SUCCESS
========================================================= */

.success-box {
    display: none;

    margin: 0 30px 25px;
    padding: 24px;

    border-radius: 13px;

    background: #f0fdf4;
    border: 1px solid #bbf7d0;

    text-align: center;
}

.success-icon {
    width: 48px;
    height: 48px;

    margin: 0 auto 10px;

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

    border-radius: 50%;

    background: #16a34a;
    color: #ffffff;

    font-size: 23px;
    font-weight: 800;
}

.success-box h3 {
    margin: 0 0 6px;

    color: #166534;
    font-size: 19px;
}

.success-box p {
    margin: 0 0 15px;

    color: #4b5563;
    font-size: 13px;
}

.download-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 12px 23px;

    border-radius: 8px;

    background: #16a34a;
    color: #ffffff;

    text-decoration: none;

    font-size: 14px;
    font-weight: 700;

    transition: background 0.2s ease;
}

.download-button:hover {
    background: #15803d;
    color: #ffffff;
    text-decoration: none;
}


/* =========================================================
   REQUIREMENTS
========================================================= */

.requirements {
    max-width: 900px;

    margin: 28px auto 0;
    padding: 18px 20px;

    border-radius: 11px;

    background: #f8fafc;
    border: 1px solid #e5e7eb;

    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
}

.requirements strong {
    color: #374151;
}


/* =========================================================
   INFORMATION SECTIONS
========================================================= */

.info-section {
    max-width: 900px;
    margin: 55px auto 0;
}

.section-heading {
    text-align: center;
    margin-bottom: 24px;
}

.section-heading h2 {
    margin: 0 0 7px;

    color: #111827;
    font-size: 27px;
    font-weight: 700;
}

.section-heading p {
    margin: 0;

    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
}


/* =========================================================
   HOW IT WORKS
========================================================= */

.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.step-card {
    padding: 21px 15px;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 13px;

    text-align: center;
}

.step-number {
    width: 35px;
    height: 35px;

    margin: 0 auto 11px;

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

    border-radius: 50%;

    background: #eff6ff;
    color: #2563eb;

    font-size: 14px;
    font-weight: 800;
}

.step-card h3 {
    margin: 0 0 7px;

    color: #1f2937;
    font-size: 15px;
}

.step-card p {
    margin: 0;

    color: #6b7280;
    font-size: 12px;
    line-height: 1.55;
}


/* =========================================================
   FEATURES
========================================================= */

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.feature-card {
    padding: 21px;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
}

.feature-card h3 {
    margin: 0 0 7px;

    color: #1f2937;
    font-size: 16px;
}

.feature-card p {
    margin: 0;

    color: #6b7280;
    font-size: 13px;
    line-height: 1.6;
}


/* =========================================================
   RELATED TOOLS
========================================================= */

.links-section {
    max-width: 900px;
    margin: 55px auto 0;
}

.links-section > h2 {
    margin: 0 0 20px;

    text-align: center;

    color: #111827;
    font-size: 25px;
}

.links-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.link-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;

    transition:
        border-color 0.2s ease,
        transform 0.15s ease;
}

.link-item:hover {
    border-color: #bfdbfe;
    transform: translateY(-1px);
}

.link-item a {
    display: block;

    padding: 13px 15px;

    color: #2563eb;
    text-decoration: none;

    font-size: 13px;
    font-weight: 600;
}


/* =========================================================
   FAQ
========================================================= */

.faqs {
    max-width: 900px;
    margin: 55px auto 0;
}

.faq-title {
    margin-bottom: 20px;
    text-align: center;
}

.faq-title h2 {
    margin: 0;

    color: #111827;
    font-size: 25px;
}

.faq-item {
    margin-bottom: 9px;

    overflow: hidden;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.faq-question {
    width: 100%;

    padding: 16px 17px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    border: none;
    background: transparent;

    text-align: left;

    color: #374151;
    font-size: 14px;
    font-weight: 650;

    cursor: pointer;
}

.faq-icon {
    flex-shrink: 0;

    color: #94a3b8;
    font-size: 20px;
    font-weight: 400;
}

.faq-answer {
    display: none;

    padding: 0 17px 17px;

    color: #6b7280;

    font-size: 13px;
    line-height: 1.65;
}

.faq-item.active .faq-answer {
    display: block;
}


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

@media (max-width: 850px) {

    .steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .links-container {
        grid-template-columns: repeat(2, 1fr);
    }
}


@media (max-width: 600px) {

    .merge-page {
        padding: 25px 12px 55px;
    }

    .merge-hero {
        margin-bottom: 22px;
    }

    .merge-hero h1 {
        font-size: 31px;
    }

    .merge-hero p {
        font-size: 14px;
    }

    .merge-tool {
        border-radius: 14px;
    }

    .merge-tool-header {
        padding: 21px 16px 16px;
    }

    .drop-zone {
        margin: 17px 16px 14px;
        min-height: 200px;
        padding: 25px 15px;
    }

    .upload-limits {
        margin-left: 16px;
        margin-right: 16px;
    }

    .file-list {
        padding-left: 16px;
        padding-right: 16px;
    }

    .file-list-hint {
        display: none;
    }

    .file-item {
        grid-template-columns: 24px 46px minmax(0, 1fr) 30px;
        gap: 8px;
        padding: 9px;
    }

    .pdf-thumbnail {
        width: 46px;
        height: 56px;
    }

    .file-name {
        font-size: 13px;
    }

    .file-meta {
        font-size: 11px;
    }

    .merge-actions {
        padding-left: 16px;
        padding-right: 16px;
    }

    .merge-actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .add-more-btn,
    .merge-button {
        width: 100%;
    }

    .error-box,
    .status-box,
    .success-box {
        margin-left: 16px;
        margin-right: 16px;
    }

    .steps-grid,
    .features-grid,
    .links-container {
        grid-template-columns: 1fr;
    }

    .info-section,
    .links-section,
    .faqs {
        margin-top: 42px;
    }

}
