body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f7fb;
}

/* Hero section */

header h1 {
    font-weight: 700;
}

.hero-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 50%, #eef2ff 100%);
    border-radius: 1rem;
    padding: 2rem 1.75rem;
}

.hero-icon-wrapper {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #4a6cf7 0, #8b9ffb 40%, #e2e7ff 100%);
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(74, 108, 247, 0.35);
}

.hero-icon {
    font-size: 2rem;
}

/* Donation cards under hero card */

.donation-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
}

.donation-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.donation-card {
    background: #ffffff;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    padding: 0.7rem 0.8rem 0.85rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 100%;
    color: inherit;
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.donation-card:hover,
.donation-card:focus {
    color: inherit;
    text-decoration: none;
    border-color: rgba(74, 108, 247, 0.55);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
    transform: translateY(-2px);
}

.donation-card:focus {
    outline: none;
}

.donation-card:focus-visible {
    outline: 3px solid rgba(74, 108, 247, 0.28);
    outline-offset: 3px;
}

.donation-card-header {
    margin-bottom: 0.35rem;
}

.donation-label {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b7280;
}

.donation-card-body {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.donation-icon {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    color: #ffffff;
    flex-shrink: 0;
}

.paypal-icon {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.patreon-icon {
    background: linear-gradient(135deg, #ec4899, #ef4444);
}

.btcpay-icon {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.donation-text {
    min-width: 0;
}

.donation-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.donation-copy {
    font-size: 0.8rem;
    color: #4b5563;
    margin: 0.15rem 0 0;
}

.donation-card-footer {
    margin-top: 0.5rem;
}

.donation-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    border-radius: 999px;
    padding: 0.3rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
}

.donation-helper-text {
    margin-top: 0.5rem;
    margin-bottom: 0;
    font-size: 0.78rem;
    color: #6b7280;
    text-align: left;
}

@media (max-width: 767.98px) {
    .donation-cards {
        grid-template-columns: minmax(0, 1fr);
    }

    .donation-helper-text {
        text-align: left;
    }
}

.provider-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    background-color: #e3ecff;
    color: #2643a0;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.mt-vip-promo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 1.25rem;
    margin: 0 0 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(34, 211, 238, 0.42);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(12, 54, 79, 0.97) 55%, rgba(14, 116, 144, 0.92) 100%);
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: #e6fbff;
    overflow: hidden;
}

.mt-vip-promo__content {
    min-width: 0;
    max-width: 760px;
}

.mt-vip-promo__badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 0.4rem;
    padding: 0.16rem 0.58rem;
    border: 1px solid rgba(125, 211, 252, 0.52);
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.16);
    color: #bae6fd;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: uppercase;
}

.mt-vip-promo__title {
    margin: 0;
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.22;
}

.mt-vip-promo__text {
    margin: 0.38rem 0 0;
    color: #d7f7ff;
    font-size: 0.88rem;
    line-height: 1.45;
}

.mt-vip-promo__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
    margin-top: 0.65rem;
}

.mt-vip-promo__chips span {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0.22rem 0.58rem;
    border: 1px solid rgba(186, 230, 253, 0.24);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #effcff;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.mt-vip-promo__actions {
    display: flex;
    flex: 0 0 210px;
    flex-direction: column;
    align-items: stretch;
    gap: 0.48rem;
}

.mt-vip-promo__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.58rem 0.95rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #22d3ee, #38bdf8 48%, #60a5fa);
    color: #082f49;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(34, 211, 238, 0.22);
}

.mt-vip-promo__cta:hover,
.mt-vip-promo__cta:focus {
    color: #06283f;
    text-decoration: none;
    box-shadow: 0 12px 26px rgba(34, 211, 238, 0.3);
}

.mt-vip-promo__cta:focus-visible {
    outline: 3px solid rgba(186, 230, 253, 0.48);
    outline-offset: 3px;
}

.mt-vip-promo__note {
    color: #bfecf7;
    font-size: 0.76rem;
    line-height: 1.35;
    text-align: center;
}

#drop-area {
    border: 1px dashed #c3cbe5;
    border-radius: 16px;
    background: radial-gradient(circle at top left, #f2f5ff 0, #f7f9fc 40%, #ffffff 100%);
    padding: 32px 18px;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease,
        transform 0.1s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

#drop-area::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(135deg, rgba(74, 108, 247, 0.06), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

#drop-area.dragover {
    background: linear-gradient(135deg, #eef3ff, #f8f9ff);
    border-color: #4a6cf7;
    box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.2), 0 12px 20px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

#drop-area.dragover::before {
    opacity: 1;
}

#drop-area .drop-inner {
    pointer-events: none;
}

.mt-upload-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin: 0.75rem 0 0.6rem;
    padding: 0.55rem 1.15rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.24);
}

#drop-area:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.32);
    outline-offset: 4px;
}

.mt-language-step,
#progress-card {
    scroll-margin-top: 96px;
}

.mt-language-step {
    border-radius: 14px;
}

#target-lang-select {
    min-height: 42px;
    border-color: #cbd5e1;
    border-radius: 12px;
    color: #111827;
}

#target-lang-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.16);
}

#target-lang-select.mt-select-border-glow {
    animation: mtSelectBorderGlow 1.9s ease-out;
    border-color: #2563eb;
}

@keyframes mtSelectBorderGlow {
    0% {
        border-color: #93c5fd;
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.18);
    }
    42% {
        border-color: #2563eb;
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14), 0 8px 18px rgba(15, 23, 42, 0.08);
    }
    100% {
        border-color: #cbd5e1;
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

.mt-step-glow {
    animation: mtStepGlow 1.8s ease-out;
}

@keyframes mtStepGlow {
    0% {
        border-color: rgba(37, 99, 235, 0.22);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.16);
    }
    42% {
        border-color: rgba(37, 99, 235, 0.34);
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1), 0 8px 18px rgba(15, 23, 42, 0.06);
    }
    100% {
        border-color: rgba(148, 163, 184, 0.25);
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}


#upload-card .card-body {
    padding: 1.75rem;
    border-radius: 1rem;
    border: 1px solid #e0e5f5;
}

#file-list-card .table th,
#file-list-card .table td {
    vertical-align: middle;
    border-top: none;
}

#file-list-card .table thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    border-bottom: 1px solid #e5e7f2;
}

#file-list-card .table tbody tr {
    border-bottom: 1px solid #eef0f8;
}

#file-list-card .table tbody tr:last-child {
    border-bottom: none;
}

#progress-card .progress {
    background-color: #e4ebf5;
    border-radius: 999px;
    overflow: hidden;
}

#overall-progress-bar {
    background: linear-gradient(90deg, #4a6cf7, #7b8cff);
}

#current-file-status {
    min-height: 1.2rem;
}

.badge-status {
    font-size: 0.75rem;
    padding: 0.25em 0.75em;
    border-radius: 999px;
    border: 1px solid transparent;
}

.badge-status.pending {
    background-color: #eef2ff;
    color: #4b5563;
    border-color: #e0e7ff;
}

.badge-status.reading {
    background-color: #ede9fe;
    color: #5b21b6;
    border-color: #ddd6fe;
}

.badge-status.translating {
    background-color: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.badge-status.done {
    background-color: #bbf7d0;
    color: #14532d;
    border-color: #86efac;
}

.badge-status.failed {
    background-color: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
}

.badge-status.skipped {
    background-color: #fef9c3;
    color: #854d0e;
    border-color: #fef3c7;
}

/* Buttons */

.mt-control-actions,
.mt-progress-actions,
.mt-result-actions {
    gap: 0.65rem;
}

.mt-result-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

main .mt-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0.58rem 1.12rem;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease,
        background-color 0.16s ease, color 0.16s ease;
}

main .mt-action-button:hover,
main .mt-action-button:focus {
    transform: translateY(-1px);
    text-decoration: none;
}

main .mt-action-button:focus {
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.18);
}

main .mt-action-button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.28);
    outline-offset: 2px;
}

.btn-cta {
    min-width: 128px;
    border: 1px solid transparent;
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.28);
}

.btn-cta:hover,
.btn-cta:focus {
    background: linear-gradient(135deg, #1d4ed8, #4338ca);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.34);
}

.btn-cta-success {
    min-width: 138px;
    border-color: transparent;
    background: linear-gradient(135deg, #16a34a, #059669);
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(22, 163, 74, 0.24);
}

.btn-cta-success:hover,
.btn-cta-success:focus {
    background: linear-gradient(135deg, #15803d, #047857);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(22, 163, 74, 0.3);
}

.btn-cta-edit {
    min-width: 190px;
    border-color: transparent;
    background: linear-gradient(135deg, #0891b2, #2563eb);
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(14, 116, 144, 0.24);
}

.btn-cta-edit:hover,
.btn-cta-edit:focus {
    background: linear-gradient(135deg, #0e7490, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(14, 116, 144, 0.3);
}

.btn-soft {
    border-color: #cbd5e1;
    background-color: #ffffff;
    color: #334155;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
}

.btn-soft:hover,
.btn-soft:focus {
    background-color: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
    box-shadow: 0 10px 18px rgba(15, 23, 42, 0.1);
}

.btn-soft-danger {
    border-color: #fecaca;
    background-color: #ffffff;
    color: #b91c1c;
    box-shadow: 0 8px 16px rgba(185, 28, 28, 0.08);
}

.btn-soft-danger:hover,
.btn-soft-danger:focus {
    background-color: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
    box-shadow: 0 10px 18px rgba(185, 28, 28, 0.12);
}

.mt-translate-glow:not(:disabled) {
    animation: mtTranslateGlow 1.9s ease-out;
}

@keyframes mtTranslateGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.2), 0 8px 16px rgba(37, 99, 235, 0.22);
    }
    42% {
        box-shadow: 0 0 0 5px rgba(37, 99, 235, 0.12), 0 10px 18px rgba(37, 99, 235, 0.28);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0), 0 8px 16px rgba(37, 99, 235, 0.22);
    }
}

/* Disabled button appearance */
main .mt-action-button:disabled,
main .mt-action-button.disabled,
.btn[disabled],
.btn.disabled {
    opacity: 0.58;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}


/* Responsive */

@media (max-width: 576px) {
    header {
        text-align: center;
    }

    .mt-vip-promo {
        flex-direction: column;
        align-items: stretch;
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        padding: 1rem;
        border-radius: 14px;
    }

    .mt-vip-promo__text {
        font-size: 0.84rem;
    }

    .mt-vip-promo__actions {
        flex: 0 1 auto;
    }

    .mt-vip-promo__note {
        text-align: left;
    }

    #upload-card,
    #file-list-card,
    #progress-card {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        border-radius: 0;
    }

    .hero-card {
        border-radius: 0.75rem;
        padding: 1.5rem 1.25rem;
        text-align: center;
    }

    .hero-icon-wrapper {
        margin-top: 1rem;
    }

    #controls-row {
        align-items: flex-start !important;
    }
}


@media (max-width: 576px) {
    #target-lang-select,
    .mt-control-actions,
    .mt-control-actions .form-group,
    .mt-progress-actions,
    .mt-result-actions {
        width: 100%;
    }

    #target-lang-select {
        min-width: 0 !important;
    }

    .mt-progress-actions {
        flex-direction: column;
        align-items: stretch !important;
    }

    .mt-result-actions {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
    }

    main .mt-action-button {
        width: 100%;
        min-height: 44px;
        white-space: normal;
    }
}

@media (prefers-reduced-motion: reduce) {
    #drop-area,
    .donation-card,
    main .mt-action-button {
        transition: none;
    }

    main .mt-action-button:hover,
    main .mt-action-button:focus {
        transform: none;
    }

    .mt-step-glow,
    #target-lang-select.mt-select-border-glow,
    .mt-translate-glow:not(:disabled) {
        animation: none;
        box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), 0 8px 18px rgba(15, 23, 42, 0.06);
    }

    #target-lang-select.mt-select-border-glow {
        border-color: #2563eb;
    }
}
