/**
 * Стили формы заявки (шорткод [motor_docs_form]).
 * Основной цвет задаётся через переменную --mdm-primary-color (inline из настроек).
 */
.mdm-public-container,
.mdm-public-container * {
    box-sizing: border-box !important;
}

.mdm-public-container {
    max-width: 700px;
    margin: 40px auto;
    font-family: sans-serif;
}

.mdm-styled-form {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border: 1px solid #e1e1e1;
    overflow: hidden;
}

.mdm-form-header {
    background: var(--mdm-primary-color, #0073aa);
    padding: 40px 30px;
    color: #fff;
    text-align: center;
    font-size: 18px;
}

.mdm-form-header h2 {
    margin: 0 0 10px;
    color: #fff;
    font-size: 26px;
    border: none;
}

.mdm-form-section {
    padding: 30px;
    border-bottom: 1px solid #f0f0f0;
}

.mdm-section-head {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.mdm-step-num {
    background: var(--mdm-primary-color, #0073aa);
    color: #fff;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
}

.mdm-grid-2 {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.mdm-grid-2 .mdm-field {
    flex: 1;
    min-width: 250px;
}

.mdm-field {
    margin-bottom: 20px;
}

.mdm-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 12px;
}

.mdm-field .required {
    color: #d63638;
}

.mdm-field input,
.mdm-field select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
}

.mdm-file-upload input {
    display: none;
}

.mdm-file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    border: 2px dashed #cbd5e0;
    border-radius: 10px;
    cursor: pointer;
    background: #f8fafc;
}

.mdm-form-footer {
    padding: 40px 30px;
    background: #f9f9f9;
    text-align: center;
}

.mdm-submit-btn {
    background: var(--mdm-primary-color, #0073aa);
    color: #fff;
    border: none;
    padding: 18px 30px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
}

.mdm-submit-btn:hover {
    filter: brightness(0.9);
}

.mdm-success {
    padding: 12px;
    background: #d4edda;
    color: #155724;
    border-radius: 8px;
}

.mdm-error {
    padding: 12px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 8px;
}

#mdm-form-messages {
    margin: 10px 0;
}

.mdm-contact-lines {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mdm-contact-line {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px;
}

.mdm-contact-line .mdm-line-group {
    flex: 1;
    min-width: 160px;
}

.mdm-contact-line .mdm-line-group label,
.mdm-line-code-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 12px;
    color: #1e293b;
}

.mdm-contact-line .mdm-line-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.mdm-contact-line .mdm-line-code {
    flex: 0 0 110px;
    display: flex;
    flex-direction: column;
}

.mdm-contact-line .mdm-line-code input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.mdm-contact-line .mdm-line-btn {
    flex: 0 0 120px;
    display: flex;
    align-items: stretch;
}

.mdm-contact-line .mdm-field-btn {
    flex: 0 0 auto;
    height: 100%;
    font-size: 12px;
    line-height: 1.1;
    box-sizing: border-box;
    white-space: normal;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.mdm-contact-line .mdm-line-msg {
    width: 100%;
    margin-top: 8px;
}

.mdm-btn-send-code {
    background: var(--mdm-primary-color, #0073aa);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 14px;
    height: 100%;
    min-width: 140px;
}

.mdm-btn-send-code:hover {
    background: #005a87;
}

.mdm-btn-send-code:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.mdm-line-msg.mdm-sms-msg, #mdm-email-error, #mdm-phone-error {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
}

.mdm-line-msg.mdm-sms-msg.success {
    background: #d4edda;
    color: #155724;
}

.mdm-line-msg.mdm-sms-msg.error, #mdm-email-error, #mdm-phone-error {
    background: #f8d7da;
    color: #721c24;
}

.mdm-resend-wrap {
    margin-top: 6px;
    font-size: 13px;
}

.mdm-resend-wrap a {
    color: #2271b1;
    text-decoration: none;
}

.mdm-resend-wrap a:hover {
    text-decoration: underline;
}

.mdm-footer-verify {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 20px 24px;
    margin-bottom: 20px;
}

.mdm-honeypot {
    position: absolute !important;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.mdm-captcha-wrap-hidden {
    display: none !important;
}

.mdm-captcha-wrap {
    flex-shrink: 0;
}

.mdm-captcha-wrap .smart-captcha,
.mdm-captcha-wrap #captcha-container {
    height: 78px !important;
    min-width: 280px;
    max-width: 100%;
}

.mdm-footer-verify .mdm-checkbox-field {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.mdm-footer-verify .mdm-checkbox-field input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 0;
}

.mdm_policy {
    font-size: 18px;
    line-height: 1.4;
    margin: 0;
    cursor: pointer;
}

.mdm_policy a {
    text-decoration: underline;
}

.mdm-form-note {
    font-size: 14px;
}

@media (max-width: 768px) {
    .mdm-public-container {
        margin: 24px 16px;
    }
    .mdm-styled-form {
        border-radius: 10px;
    }
    .mdm-form-header {
        padding: 30px 20px;
    }
    .mdm-form-section {
        padding: 24px 20px;
    }
    .mdm-form-footer {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .mdm-public-container {
        margin: 20px 8px;
    }
    .mdm-styled-form {
        border-radius: 8px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    }
    .mdm-form-header h2 {
        font-size: 20px;
    }
    .mdm-form-header p {
        font-size: 14px;
    }
    .mdm-grid-2 {
        gap: 16px;
    }
    .mdm-grid-2 .mdm-field {
        min-width: 100%;
    }
    .mdm-contact-line .mdm-line-code {
        flex: 1 1 120px;
    }
    .mdm-contact-line .mdm-line-btn {
        flex: 1 1 120px;
    }
    .mdm-footer-verify {
        align-items: flex-start;
        justify-content: flex-start;
        gap: 16px;
    }
    .mdm-footer-verify .mdm-checkbox-field {
        max-width: none;
    }
    .mdm-captcha-wrap .smart-captcha,
    .mdm-captcha-wrap #captcha-container {
        min-width: 260px;
    }
    .mdm_policy {
        font-size: 14px;
        text-align: left;
    }
}
