.m3dfr-wrap {
    width: 100%;
    margin: 0;
}

.m3dfr-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e8edf3;
    border-radius: 24px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.06);
    padding: 32px;
    overflow: hidden;
}

.m3dfr-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, #111827 0%, #2563eb 50%, #60a5fa 100%);
}

.m3dfr-card__header {
    margin-bottom: 28px;
}

.m3dfr-title {
    margin: 0 0 10px;
    font-size: 32px;
    line-height: 1.15;
    font-weight: 700;
    color: #0f172a;
}

.m3dfr-subtitle {
    margin: 0;
    font-size: 16px;
    line-height: 1.65;
    color: #475569;
}

.m3dfr-form {
    display: block;
}

.m3dfr-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.m3dfr-field {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.m3dfr-field--full {
    grid-column: 1 / -1;
}

.m3dfr-label {
    display: inline-block;
    margin: 0 0 10px;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
    color: #0f172a;
}

.m3dfr-label span {
    color: #dc2626;
}

.m3dfr-input,
.m3dfr-textarea {
    width: 100%;
    border: 1px solid #d7dee7;
    border-radius: 16px;
    background: #ffffff;
    color: #0f172a;
    font-size: 15px;
    line-height: 1.5;
    padding: 14px 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    box-sizing: border-box;
}

.m3dfr-input::placeholder,
.m3dfr-textarea::placeholder {
    color: #94a3b8;
}

.m3dfr-input:focus,
.m3dfr-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
    background: #ffffff;
}

.m3dfr-textarea {
    min-height: 140px;
    resize: vertical;
}

.m3dfr-dropzone {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: 22px;
    background: linear-gradient(180deg, #fbfdff 0%, #f8fbff 100%);
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 28px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.m3dfr-dropzone:hover {
    border-color: #60a5fa;
    background: linear-gradient(180deg, #f8fbff 0%, #f2f8ff 100%);
    box-shadow: 0 12px 32px rgba(37, 99, 235, 0.08);
}

.m3dfr-dropzone:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.m3dfr-dropzone.is-dragover {
    border-color: #2563eb;
    background: linear-gradient(180deg, #eff6ff 0%, #e8f1ff 100%);
    transform: translateY(-1px);
    box-shadow: 0 16px 36px rgba(37, 99, 235, 0.14);
}

.m3dfr-dropzone.has-file {
    border-style: solid;
    border-color: #22c55e;
    background: linear-gradient(180deg, #f6fff8 0%, #effcf3 100%);
}

.m3dfr-dropzone__inner {
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.m3dfr-dropzone__icon {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    background: #ffffff;
    border: 1px solid #dbe4ee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    flex-shrink: 0;
}

.m3dfr-dropzone__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.m3dfr-dropzone__text strong {
    display: block;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;
    color: #0f172a;
}

.m3dfr-dropzone__text span {
    display: block;
    font-size: 15px;
    line-height: 1.5;
    color: #475569;
}

.m3dfr-dropzone__hint {
    font-size: 13px;
    line-height: 1.6;
    color: #64748b;
    max-width: 560px;
}

.m3dfr-file-preview {
    margin-top: 14px;
}

.m3dfr-file-preview__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid #d9f0df;
    border-radius: 16px;
    background: #f7fff9;
    box-sizing: border-box;
}

.m3dfr-file-preview__meta {
    min-width: 0;
}

.m3dfr-file-preview__name {
    font-size: 15px;
    line-height: 1.4;
    font-weight: 600;
    color: #0f172a;
    word-break: break-word;
}

.m3dfr-file-preview__size {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.4;
    color: #64748b;
}

.m3dfr-file-preview__remove {
    border: 0;
    background: transparent;
    color: #dc2626;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
    transition: opacity 0.2s ease;
}

.m3dfr-file-preview__remove:hover {
    opacity: 0.75;
}

.m3dfr-actions {
    margin-top: 28px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.m3dfr-submit {
    appearance: none;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #111827 0%, #1e3a8a 100%);
    color: #ffffff;
    font-size: 15px;
    line-height: 1;
    font-weight: 700;
    padding: 16px 26px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 14px 32px rgba(17, 24, 39, 0.16);
}

.m3dfr-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(17, 24, 39, 0.2);
}

.m3dfr-submit:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14), 0 18px 36px rgba(17, 24, 39, 0.16);
}

.m3dfr-submit:disabled,
.m3dfr-submit.is-loading {
    opacity: 0.72;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
}

.m3dfr-message {
    margin-top: 20px;
    border-radius: 16px;
    padding: 15px 18px;
    font-size: 14px;
    line-height: 1.6;
    box-sizing: border-box;
}

.m3dfr-message strong {
    font-size: 15px;
}

.m3dfr-message--loading {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
}

.m3dfr-message--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.m3dfr-message--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

@media (max-width: 991px) {
    .m3dfr-card {
        padding: 26px;
        border-radius: 22px;
    }

    .m3dfr-title {
        font-size: 28px;
    }

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

    .m3dfr-dropzone {
        min-height: 200px;
        padding: 24px;
    }
}

@media (max-width: 767px) {
    .m3dfr-card {
        padding: 20px;
        border-radius: 18px;
    }

    .m3dfr-title {
        font-size: 24px;
    }

    .m3dfr-subtitle {
        font-size: 15px;
    }

    .m3dfr-dropzone {
        min-height: 180px;
        padding: 20px 16px;
        border-radius: 18px;
    }

    .m3dfr-dropzone__icon {
        width: 58px;
        height: 58px;
        border-radius: 16px;
    }

    .m3dfr-dropzone__text strong {
        font-size: 18px;
    }

    .m3dfr-file-preview__item {
        flex-direction: column;
        align-items: flex-start;
    }

    .m3dfr-submit {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

/* Полностью скрываем нативный input file */
.m3dfr-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

/* На всякий случай убираем кнопку выбора файла в некоторых браузерах */
.m3dfr-file-input::-webkit-file-upload-button {
    display: none;
}

.m3dfr-file-input::file-selector-button {
    display: none;
}